예제 #1
0
    def __init__(self):
        logging.info('Initialising vision')
        #required on DICE:
        #self.capture = MPlayerCapture(self.rawSize)
        self.capture = Capture(self.rawSize)

        world = World('blue') # arbitrary colour
        world.pointer=None

        self.threshold = vision.threshold.AltRaw()
        self.pre = Preprocessor(self.rawSize, self.threshold, None)
        self.gui = GUI(world, self.rawSize, self.threshold)
        logging.debug('Vision initialised')
예제 #2
0
class OpenCVPitch(Capture):
    def __init__(self, filename=None, once=False):
        Capture.__init__(self, Vision.rawSize, filename, once)
        self.tmpfile = tempfile.mktemp(suffix='.bmp')
        self.threshold = vision.threshold.PrimaryRaw
        self.pre = Preprocessor(Vision.rawSize, self.threshold)

    def __del__(self):
        os.remove(self.tmpfile)

    def get(self):
        frame = self.getFrame()

        # Remove distortions from the raw image
        frame = self.pre.standardise(frame)

        cv.SaveImage(self.tmpfile, frame)
        return pygame.image.load(self.tmpfile)
예제 #3
0
class OpenCVPitch(Capture):

    def __init__(self, filename=None, once=False):
        Capture.__init__(self, Vision.rawSize, filename, once)
        self.tmpfile = tempfile.mktemp(suffix='.bmp')
        self.threshold = vision.threshold.PrimaryRaw
        self.pre = Preprocessor(Vision.rawSize, self.threshold)

    def __del__(self):
        os.remove(self.tmpfile)

    def get(self):
        frame = self.getFrame()

        # Remove distortions from the raw image
        frame = self.pre.standardise(frame)

        cv.SaveImage(self.tmpfile, frame)
        return pygame.image.load(self.tmpfile)
예제 #4
0
 def __init__(self, filename=None, once=False):
     Capture.__init__(self, Vision.rawSize, filename, once)
     self.tmpfile = tempfile.mktemp(suffix='.bmp')
     self.threshold = vision.threshold.PrimaryRaw
     self.pre = Preprocessor(Vision.rawSize, self.threshold)
예제 #5
0
 def __init__(self, filename=None, once=False):
     Capture.__init__(self, Vision.rawSize, filename, once)
     self.tmpfile = tempfile.mktemp(suffix='.bmp')
     self.threshold = vision.threshold.PrimaryRaw
     self.pre = Preprocessor(Vision.rawSize, self.threshold)