I try to show an Image with the OpenCV-function 'imshow()'.
cv::Mat im = cv::imread("/home/franek/Schreibtisch/image.jpg",cv::IMREAD_GRAYSCALE);
cv::imshow("original", im);
Now it tells me:
OpenCV Error: Assertion failed (scn == 3 || scn == 4) in cvtColor, file /build/opencv-L2vuMj/opencv-3.2.0+dfsg/modules/imgproc/src/color.cpp, line 9716
terminate called after throwing an instance of 'cv::Exception'
what(): /build/opencv-L2vuMj/opencv-3.2.0+dfsg/modules/imgproc/src/color.cpp:9716: error: (-215) scn == 3 || scn == 4 in function cvtColor
When I replace cv::IMREAD_GRAYSCALE with cv::IMREAD_COLOR, the picture is shown and everything is fine. But I need a graysca