Beispiel #1
0
    def __init__(self, world, filename=None, simulator=None):
        logging.info('Initialising vision')
        if simulator:
            self.capture = SimCapture(simulator)
        else:
            self.capture = MPlayerCapture(self.rawSize, filename)
            #self.capture = Capture(self.rawSize, filename)

        self.threshold = threshold.PrimaryRaw()
        self.pre = Preprocessor(self.rawSize, self.threshold, simulator)
        self.featureEx = FeatureExtraction(self.pre.cropSize)
        self.interpreter = Interpreter()
        self.world = world
        self.gui = GUI(world, self.pre.cropSize, self.threshold)
        self.histogram = Histogram(self.pre.cropSize)

        self.times = []
        self.N = 0

        debug.thresholdValues(self.threshold.Tfg, self.gui)

        logging.debug('Vision initialised')