image reading error [closed]
error: ........\opencv\modules\imgproc\src\color.cpp:3739: error: (-215) scn == 3 || scn == 4 in function cv::cvtColor
Help me out.
error: ........\opencv\modules\imgproc\src\color.cpp:3739: error: (-215) scn == 3 || scn == 4 in function cv::cvtColor
Help me out.
Asked: 2017-03-26 14:37:14 -0600
Seen: 117 times
Last updated: Mar 26 '17
build problems for android_binary_package - Eclipse Indigo, Ubuntu 12.04
Assertion Error in Kalman Filter python OpenCV 2.4.0
Compiling OpenCV for iOS - no product type error
A question about registration function in Opencv2.4.2
Earth Mover's Distance EMD() results in memory access error
Mergevec.cpp : Error (compilation)
This is not a problem in image reading. You are calling cvtColor with a conversion type that expects 3 or 4 channel input, and the image you give it is not 3 or 4 channels.
you are talking about RGBA channels is it? if images are storing into jpg format we will get only 3 channels, there were some different images into jpg i tried that to.., please give me some solution..
RGB would be 3, RGBA would be 4. Either should work Just after your imread(), call image.channels() to get the number of channels it has. If it's grayscale, you'll only have 1.