def __init__(self, world, filename=None, simulator=None, once=False, headless=False): logging.info('Initialising vision') if simulator: self.capture = SimCapture(simulator) else: self.capture = Capture(self.rawSize, filename, once) self.headless = headless self.threshold = threshold.AltRaw() 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.Tblue, self.gui) logging.debug('Vision initialised')
def initComponents(self, crop=None): undistort = False self.pre = Preprocessor(self.rawSize, self.threshold, undistort, crop=crop) self.featureEx = FeatureExtraction(self.pre.cropSize) self.gui = GUI(self.world, self.pre.cropSize, self.threshold, self) self.world.setResolution(self.pre.cropSize)
def requires(self): return FeatureExtraction()