You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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
The text was updated successfully, but these errors were encountered: