2017-05-22 06:01:18 -0600 | received badge | ● Famous Question (source) |
2016-04-04 04:43:10 -0600 | received badge | ● Notable Question (source) |
2015-11-28 15:55:25 -0600 | received badge | ● Popular Question (source) |
2015-01-27 10:46:05 -0600 | asked a question | OpenCV Error: Assertion failed ((scn == 3 || scn == 4) && (depth == CV_8U || depth == CV_32F)) Currently i am trying to track objects by color. I've run the documentation code, however, it gives the following sentences. The documentation code is here OpenCV Error: Assertion failed ((scn == 3 || scn == 4) && (depth == CV_8U || depth == CV_32F)) in cvtColor, file /home/guerrero/opencv2.4.9/opencv-2.4.9/modules/imgproc/src/color.cpp, line 3959 terminate called after throwing an instance of 'cv::Exception' what(): /home/guerrero/opencv2.4.9/opencv-2.4.9/modules/imgproc/src/color.cpp:3959: error: (-215) (scn == 3 || scn == 4) && (depth == CV_8U || depth == CV_32F) in function cvtColor Actually, I've searched the meaning of the errors on the Internet, but it gives a limited explanation. Does anyone help me to modify the code a little bit, please? The documentation code is provided below. Thank you very much! import cv2 import numpy as np cap = cv2.VideoCapture(0) while(1): cv2.destroyAllWindows() |