Face_detect error

Dear sir

plz help me to solve this problem, i work several day to try to work on jetson nano in opencv facedetect but fail .
I already install openCV4 , opencv but still not working
the error message is ~~~~~~~~~~~~~~~~~~~~~~~

face detection using haarcascades

facedetect.py [–cascade <cascade_fn>] [–nested-cascade <cascade_fn>] [<video_source>]

[ WARN:0] cv::samples::findFile(‘data/haarcascades/haarcascade_frontalface_alt.xml’) => ‘/home/marc/opencv/samples/python/…/…/data/haarcascades/haarcascade_frontalface_alt.xml’
[ WARN:0] cv::samples::findFile(‘data/haarcascades/haarcascade_eye.xml’) => ‘/home/marc/opencv/samples/python/…/…/data/haarcascades/haarcascade_eye.xml’
[ WARN:0] cv::samples::findFile(‘samples/data/lena.jpg’) => ‘/home/marc/opencv/samples/python/…/…/samples/data/lena.jpg’
select timeout
VIDIOC_DQBUF: Resource temporarily unavailable
Traceback (most recent call last):
File “facedetect.py”, line 78, in
File “facedetect.py”, line 52, in main
gray = cv.cvtColor(img, cv.COLOR_BGR2GRAY)
cv2.error: OpenCV(4.1.0) /home/marc/opencv-4.1.0/modules/imgproc/src/color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function ‘cvtColor’

  • please anyone could help me? thanks alot!!

  • Hi,

    How do you built the OpenCV package?

    error: (-215:Assertion failed) !_src.empty() in function 'cvtColor'

    In general, this kind of error indicates that the image is empty or invalid.
    Could you check if your image data is valid or not first?


    Dear sir

    Is that possible is something about opencv Version?
    I had already install opencv & opencv 4.1.0

    faces = face_cascade.detectMultiScale(gray, 1.3, 5)
    cv2.error: OpenCV(4.1.0) /home/marc/opencv-4.1.0/modules/objdetect/src/cascadedetect.cpp:1658: error: (-215:Assertion failed) !empty() in function ‘detectMultiScale’

    thanks you for anwser my question.
    best regards,