def run(self): """Start loop which gets a new image, then processes it""" while True: cv_im = self.get_new_image()[0] surface = colorblob.convert_cv_to_pg(cv_im) self.__last_surface = surface if self.__do_train: self.__gui.run_iterate(surface) for colorlist in self.__colorlist_list: blob = colorblob.ColorBlob(colorlist) blob.detect(surface) x = blob.get_centroid()[0] y = blob.get_centroid()[1] size = blob.get_size() name = colorlist.get_file_basename() if size > 0: self.add_property('name', name) self.add_property('x', x) self.add_property('y', y) self.add_property('size', size) self.store_observation() self.update()
def run(self): """Start loop which gets a new image, then processes it""" while True: cv_im = self.get_new_image()[0] surface = colorblob.convert_cv_to_pg(cv_im) self.__last_surface = surface if self.__do_train: self.__gui.run_iterate(surface) for colorlist in self.__colorlist_list: blob = colorblob.ColorBlob(colorlist) blob.detect(surface) x = blob.get_centroid()[0] y = blob.get_centroid()[1] size = blob.get_size() name = colorlist.get_file_basename() if size > 0: self.add_property('name', name) self.add_property('x', x) self.add_property('y', y) self.add_property('size', size) self.store_observation() self.update()
def get_colorlist(self, filename): for colorlist in self.__colorlist_list: if colorlist.get_file_basename() == filename: return colorlist return None
def get_colorlist(self, filename): for colorlist in self.__colorlist_list: if colorlist.get_file_basename() == filename: return colorlist return None