alexanderkoumis / opencv-gpu-py

Python OpenCV GPU CascadeClassifier Wrapper
75 stars 30 forks source link

initialize py2gpu with many xml files ?! #6

Open elpimous opened 6 years ago

elpimous commented 6 years ago

hello Alexander, I'd like to make my tracker stronger, trying some haarcascades on the fly. Anything like this :

cascades 1 to 3 are different cascades files;

        if self.cascade_1:
            faces = self.cascade_1.detectMultiScale(input_image, **self.haar_params)
        # If that fails, check the profile template
        if len(faces) == 0 and self.cascade_3:
            faces = self.cascade_3.detectMultiScale(input_image, **self.haar_params)
        # If that also fails, check a the other frontal template
        if len(faces) == 0 and self.cascade_2:
faces = self.cascade_2.detectMultiScale(input_image, **self.haar_params)

Is it possible to do it with your lib ? cv2gpu.init_gpu_detector(self.cascade_1)

elpimous commented 6 years ago

tried with different instances, doesn't work ! a = cv2gpu a.init_gpu_detector(cascade_file_gpu_1) b = cv2gpu b.init_gpu_detector(cascade_file_gpu_2) c = cv2gpu c.init_gpu_detector(cascade_file_gpu_3)