BossSensor icon indicating copy to clipboard operation
BossSensor copied to clipboard

run camera.py error

Open wei123021 opened this issue 8 years ago • 1 comments

OpenCV Error: Assertion failed (scn == 3 || scn == 4) in cvtColor, file /io/opencv/modules/imgproc/src/color.cpp, line 9748 Traceback (most recent call last): File "camera_reader.py", line 17, in frame_gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) cv2.error: /io/opencv/modules/imgproc/src/color.cpp:9748: error: (-215) scn == 3 || scn == 4 in function cvtColor

wei123021 avatar May 15 '17 11:05 wei123021

I occured to this problem too. And I find out the reason is that you are using an image that is neither with 3 channels nor 4 channels. Check out your image. Probably it's already a grayscale image with only 1 channel.

Donny-Hikari avatar Sep 27 '17 17:09 Donny-Hikari