Python-Opencv error: (-215) scn == 3 || scn == 4 in function cv::cvtColor

后端 未结 1 875
陌清茗
陌清茗 2021-01-17 05:51
import numpy as np
import cv2
import thread, winsound

face_cascade = cv2.CascadeClassifier(\'C:\\Users\\Saddaqat\\Desktop\\Softwares\\opencv\\build\\share\\OpenCV\\         


        
1条回答
  •  醉话见心
    2021-01-17 06:11

    Well, for me it looks like the VideoCapture is not working. You should check after reading the image, if it could have read something:

    ret, cur = cam.read()
    if not ret:
        print "VideoCapture read no frame."
        break
    

    If that's the case, there has been some answers here in SO that might help you, for example: OpenCV 2.4 VideoCapture not working on Windows Basically, they say that you might have problems with the ffmpeg. Maybe you have to add it to Windows path, and/or rename it to have the OpenCV version on it.

    0 讨论(0)
提交回复
热议问题