Segmentation fault: 11 in detectMultiScale

Stack Overflow Asked on October 23, 2020

I’m trying to using cv2 for face recognition. When I use haarcascade_frontalcatface.xml to recognize face, everything is ok (the same with haarcascade_eye.xml), but haarcascade_mcs_nose.xml gives me this error:

The code is below:

import cv2
image = cv2.imread('face.jpeg')
print image.shape
gray = cv2.cvtColor(image,cv2.COLOR_BGR2GRAY)
nose_detector = cv2.CascadeClassifier('haarcascade_mcs_nose.xml')
nose_zone = nose_detector.detectMultiScale(gray,1.3,3,minSize=(10,10))

I’m working on MacOS Mojave and the opencv-python version is 4.1.2. I tried to change the parameters in detectMultiScale, but it didn’t work. This problem confuses me a lot, can anyone help me resolve it please ?

Add your own answers!

Ask a Question

Get help from others!

© 2024 All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP