def __init__(self):
     KeypointsObjectDetector.__init__(self)
     self._cascadeROI = OptimalROIDetectorSAoS()
     self._eyeROI = CascadesDetectionInterface(loadScript("main_haarcascade_eyes_union.json", True))
     self._database = []
     self._etalon = []
     self._prob = 100
     with open('keypoints.conf', 'r') as f:
         self._coff = float(f.read().replace('\n', ''))
 def importSettings(self, settings):
     if len(settings.keys()) > 0:
         logger.info("Settings loading started...")
         self.kodsettings.importSettings(settings['KODSettings'])
         self.kodsettings.dump()
         if self._cascadeROI is None:
             self._cascadeROI = OptimalROIDetectorSAoS()
         if self._eyeROI is None:
             self._eyeROI = CascadesDetectionInterface(loadScript("main_haarcascade_eyes_union.json", True))
         logger.info("Settings loading finished.")
         return True
     return False
Beispiel #3
0
    def __init__(self):
        self._d = 100

        self._face_classifier = CascadeROIDetector()
        settings = CascadeClassifierSettings()
        settings.minNeighbors = 1
        settings.minSize = (100, 100)
        self._face_classifier.classifierSettings = settings
        self._face_classifier.add_cascade(
            os.path.join(CASCADES_PATH, "haarcascade_frontalface_alt.xml"))
        self._face_classifier.add_cascade(
            os.path.join(CASCADES_PATH,
                         "haarcascade_frontalface_alt_tree.xml"))
        self._face_classifier.add_cascade(
            os.path.join(CASCADES_PATH, "haarcascade_frontalface_alt2.xml"))
        self._face_classifier.add_cascade(
            os.path.join(CASCADES_PATH, "haarcascade_frontalface_default.xml"))

        self._detector = RotatedCascadesDetector(
            loadScript(
                os.path.join(SCRIPTS_PATH,
                             "main_rotation_haarcascade_face_eyes.json")),
            loadScript(
                os.path.join(SCRIPTS_PATH, "main_haarcascade_face_size.json")))