3737: error: (-215) scn == 3 || scn ==4 in function cvtColor

asked 2015-04-09 11:53:17 -0500

Mehwish Tahir gravatar image

I am getting this error while reading images in opencv.

OpenCv Error: Assertion failed (scn == 3 || scn == 4) in cvtColor, opencv-2.4.9/modules/imgproc/src/color.cpp, line 3737 terminate called after throwing an instance of 'cv::Exception'

Need help in this regard. Thanks in advance.

edit retag flag offensive close merge delete

Comments

2

As the assertion says: your input image has neither 3 or 4 channels and thus cannot be converted. You need to fix your image src.

Guanta gravatar imageGuanta ( 2015-04-09 12:30:26 -0500 )edit
3

your input img to cvtColor either was grayscale already, or empty (not loaded)

berak gravatar imageberak ( 2015-04-09 17:06:04 -0500 )edit