-
Notifications
You must be signed in to change notification settings - Fork 749
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cv2.error: D:\Build\OpenCV\opencv-3.3.1\modules\imgproc\src\color.cpp:11016: error: (-215) scn == 3 || scn == 4 in function cv::cvtColor #35
Comments
May you modify your path of the file. |
Maybe your computer can not connect to camera by python. |
I alse have the problem:anyone can help me? |
import cv2 cascPath = "/haarcascades/haarcascade_frontalface_default.xml" video_capture = cv2.VideoCapture(0) while True:
When everything is done, release the capturevideo_capture.release() after running above code getting below error : Request to any one to help in this File "C:/Users/Ahil Rayyan/Desktop/Face Recog Project/07_Nov_2018_V0.1/Video testing.py", line 13, in error: OpenCV(3.4.1) C:\Miniconda3\conda-bld\opencv-suite_1533128839831\work\modules\imgproc\src\color.cpp:11147: error: (-215) scn == 3 || scn == 4 in function cv::cvtColor |
i also encountered the error when i tred to show my images in my computer ,the code is as follows: import cv2 the result : cv2.error: C:\projects\opencv-python\opencv\modules\imgproc\src\color.cpp:10606: error: (-215) scn == 3 || scn == 4 in function cv::cvtColor what can i do to fix it |
MR QJXX, I also face the same problem. tell me solution if that is you know |
MR QJXX, I also face the same problem. tell me solution if that is you know, please |
OpenCV(3.4.1) Error: Assertion failed ((scn == 3 || scn == 4) && (depth == 0 || depth == 5)) in cv::cvtColor, file C:\Miniconda3\conda-bld\opencv-suite_1533128839831\work\modules\imgproc\src\color.cpp, line 11214 |
When I use your code,I find there is a error
First,I modified ['-src', '--source', dest='video_source', type=int,……]
to ['-src', '--source', dest='video_source', type=str,……]
Then I use this command "python object_detection_multithreading.py -src E:C.mp4",but the mistake appeared.
E:\test_opencv\object_detector_app-master_PB>python object_detection_multithreading.py -src E:C.mp4
warning: Error opening file (/build/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:808)
warning: E:C.mp4 (/build/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:809)
[INFO] elapsed time: 0.00
[INFO] elapsed time: 0.00
[INFO] elapsed time: 0.00
[INFO] elapsed time: 0.00
[INFO] elapsed time: 0.00
OpenCV Error: Assertion failed (scn == 3 || scn == 4) in cv::cvtColor, file D:\Build\OpenCV\opencv-3.3.1\modules\imgproc\src\color.cpp, line 11016
Exception in thread Thread-1:
Traceback (most recent call last):
File "E:\Anaconda3\lib\threading.py", line 914, in _bootstrap_inner
self.run()
File "E:\Anaconda3\lib\threading.py", line 862, in run
self._target(*self._args, **self._kwargs)
File "object_detection_multithreading.py", line 77, in worker
frame_rgb = cv2.cvtColor(frame, cv2.COLOR_RGB2BGR)
cv2.error: D:\Build\OpenCV\opencv-3.3.1\modules\imgproc\src\color.cpp:11016: error: (-215) scn == 3 || scn == 4 in function cv::cvtColor
How to fix it?
The text was updated successfully, but these errors were encountered: