Quantcast
Channel: OpenCV Q&A Forum - Latest question feed
Viewing all articles
Browse latest Browse all 19555

imread flag for reading color image and equalizeHist output

$
0
0
So i took an image with photo booth, ordinary jpeg, but when loading it i get a assertion error that it needs to be CV_8UC1: OpenCV Error: Assertion failed (_src.type() == CV_8UC1) in equalizeHist, file /Users/alefveld/Downloads/opencv/modules/imgproc/src/histogram.cpp, line 3688 libc++abi.dylib: terminating with uncaught exception of type cv::Exception: /Users/alefveld/Downloads/opencv/modules/imgproc/src/histogram.cpp:3688: error: (-215) _src.type() == CV_8UC1 in function equalizeHist If i use imread with ANYDEPTH flag it works (as opposed to using no flags at all). But then when i use equalizeHist, it pretty much seems to convert it to grayscale. Mat image=imread(filenames[0],CV_LOAD_IMAGE_ANYDEPTH); if(!image.data) { cout << "Could not open or find the Shouldn't imread just be able to load any image? What flag should i use for loading a normal color image? And why is equalizeHist making the image look gray-ish. That way it almost seems pointless to convert it to grayscale. Thanks for your help - as always.

Viewing all articles
Browse latest Browse all 19555

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>