Ask Your Question

Revision history [back]

how to solve this error error: C:\build\2_4_winpack-bindings-win32-vc14-static\opencv\modules\imgproc\src\color.cpp:3783: error: (-215) scn == 3 || scn == 4 in function cv::cvtColor

import cv2 import numpy as np

faceDetect=cv2.CascadeClassifier('haarcascade_frontalface_default.xml'); cam=cv2.VideoCapture(0);

while(True): ret,img=cam.read(); gray=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) faces=faceDetect.detectMultiScale(gray,1.3,5); for(x,y,w,h) in faces: cv2.rectangle(img,(x,y),(x+w,y+h),(0,255,0),2) cv2.imshow("Face",img); if(cv2.waitKey(1)==ord('q')): break; cam.release() cv2.destroyALLWindows()

click to hide/show revision 2
retagged

updated 2019-03-17 06:19:02 -0600

berak gravatar image

how to solve this error error: C:\build\2_4_winpack-bindings-win32-vc14-static\opencv\modules\imgproc\src\color.cpp:3783: error: (-215) scn == 3 || scn == 4 in function cv::cvtColor

import cv2 import numpy as np

faceDetect=cv2.CascadeClassifier('haarcascade_frontalface_default.xml'); cam=cv2.VideoCapture(0);

while(True): ret,img=cam.read(); gray=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) faces=faceDetect.detectMultiScale(gray,1.3,5); for(x,y,w,h) in faces: cv2.rectangle(img,(x,y),(x+w,y+h),(0,255,0),2) cv2.imshow("Face",img); if(cv2.waitKey(1)==ord('q')): break; cam.release() cv2.destroyALLWindows()

how to solve this error error: C:\build\2_4_winpack-bindings-win32-vc14-static\opencv\modules\imgproc\src\color.cpp:3783: error: (-215) scn == 3 || scn == 4 in function cv::cvtColor

import cv2 import numpy as np

faceDetect=cv2.CascadeClassifier('haarcascade_frontalface_default.xml'); cam=cv2.VideoCapture(0);

while(True): ret,img=cam.read(); gray=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) faces=faceDetect.detectMultiScale(gray,1.3,5); for(x,y,w,h) in faces: cv2.rectangle(img,(x,y),(x+w,y+h),(0,255,0),2) cv2.imshow("Face",img); if(cv2.waitKey(1)==ord('q')): break; cam.release() cv2.destroyALLWindows()

how to solve this error error: C:\build\2_4_winpack-bindings-win32-vc14-static\opencv\modules\imgproc\src\color.cpp:3783: error: (-215) scn == 3 || scn == 4 in function cv::cvtColor

import cv2 import numpy as np

faceDetect=cv2.CascadeClassifier('haarcascade_frontalface_default.xml');
cam=cv2.VideoCapture(0);

cam=cv2.VideoCapture(0);

while(True): ret,img=cam.read(); gray=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) faces=faceDetect.detectMultiScale(gray,1.3,5); for(x,y,w,h) in faces: cv2.rectangle(img,(x,y),(x+w,y+h),(0,255,0),2) cv2.imshow("Face",img); if(cv2.waitKey(1)==ord('q')): break; cam.release() cv2.destroyALLWindows()

cv2.destroyALLWindows()

how to solve this error error: C:\build\2_4_winpack-bindings-win32-vc14-static\opencv\modules\imgproc\src\color.cpp:3783: error: (-215) scn == 3 || scn == 4 in function cv::cvtColor

import cv2 import numpy as np

faceDetect=cv2.CascadeClassifier('haarcascade_frontalface_default.xml');
cam=cv2.VideoCapture(0);

while(True):
    ret,img=cam.read();
    gray=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
    faces=faceDetect.detectMultiScale(gray,1.3,5);
    for(x,y,w,h) in faces:
        cv2.rectangle(img,(x,y),(x+w,y+h),(0,255,0),2)
    cv2.imshow("Face",img);
    if(cv2.waitKey(1)==ord('q')):
        break;
cam.release()
cv2.destroyALLWindows()

how to solve this error error: C:\build\2_4_winpack-bindings-win32-vc14-static\opencv\modules\imgproc\src\color.cpp:3783: error: (-215) scn == 3 || scn == 4 in function cv::cvtColor

import cv2 import numpy as np

faceDetect=cv2.CascadeClassifier('haarcascade_frontalface_default.xml');
cam=cv2.VideoCapture(0);

while(True):
    ret,img=cam.read();
    gray=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
    faces=faceDetect.detectMultiScale(gray,1.3,5);
    for(x,y,w,h) in faces:
        cv2.rectangle(img,(x,y),(x+w,y+h),(0,255,0),2)
     cv2.imshow("Face",img);
    if(cv2.waitKey(1)==ord('q')):
        break;
cam.release()
cv2.destroyALLWindows()

how to solve this error error: C:\build\2_4_winpack-bindings-win32-vc14-static\opencv\modules\imgproc\src\color.cpp:3783: error: (-215) scn == 3 || scn == 4 in function cv::cvtColor

import cv2 import numpy as np

 faceDetect=cv2.CascadeClassifier('haarcascade_frontalface_default.xml');
 cam=cv2.VideoCapture(0);

 while(True):
     ret,img=cam.read();
     gray=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
     faces=faceDetect.detectMultiScale(gray,1.3,5);
     for(x,y,w,h) in faces:
         cv2.rectangle(img,(x,y),(x+w,y+h),(0,255,0),2)
         cv2.imshow("Face",img);
     if(cv2.waitKey(1)==ord('q')):
         break;
 cam.release()
 cv2.destroyALLWindows()