OpenCV Error: Assertion failed ((scn == 3 || scn == 4) && (depth == CV_8U || depth == CV_32F)) in cvtColor
My image datasets are all gray images,they all only have one channel,not three channels. I use SSD to do training and testing on my datasets with caffe. and I have one problem ,for example:
OpenCV Error: Assertion failed ((scn == 3 || scn == 4) && (depth == CV_8U || depth == CV_32F)) in cvtColor, file /home/dell1714/NVIDIA/opencv/opencv-3.0.0/modules/imgproc/src/color.cpp, line 7946 terminate called after throwing an instance of 'cv::Exception'
what(): /home/dell1714/NVIDIA/opencv/opencv-3.0.0/modules/imgproc/src/color.cpp:7946: error: (-215) (scn == 3 || scn == 4) && (depth == CV_8U || depth == CV_32F) in function cvtColor
so how to solve this opencv problem,thanks a lot!
could you please provide code? are you sure that file that you try to open exists? try to show it using opencv and see what happens