Can't open .xml file in read mode Opencv

1.2k Views Asked by At
import cv2

data = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')

returns:

Can't open file: 'haarcascade_frontalface_default.xml' in read mode

I'm new to all this and not quite sure what this error means.

Tried to open haarcascade_frontalface_default.xml

using cv2.CascadeClassifier('haarcascade_frontalface_default.xml')

I've looked everywhere. Any suggestions?

1

There are 1 best solutions below

3
balu On

Give the full path of the xml and it will work.