Imread() Giving incorrect intensities for a uint8 Tiff [C++]
I used the imread() function to read a 5000 x 5000 UINT8 TIFF(with an indexed color map), however the actual intensities or indexes in the MAT are completely incorrect. I have tried reading the image using the following flags:
cv::IMREAD_UNCHANGED = -1,
cv::IMREAD_GRAYSCALE = 0,
cv::IMREAD_ANYDEPTH = 2,
However, the image intensities are still incorrect. The Image intensities are always displayed correctly in Matlab and ImageJ; however openCV appears to be having some issues. An example of how openCV is currently mapping the intensity values is shown below.
Correct Intensity=> OpenCV Intensity
164=>166
167=>163
146=>186
129=>204
128=>255
5/3 I looked at the issue again and realized that imread() appears to be reading the colormap values instead of the index values. I need the index values.
Please let me know if you have any questions.
what is the problem ? imread gives you grey level values ?
Imread() is not giving me index image of the indexed color image.. I want the index image, not an approximated greyscale image. You can read about index color images in the link above.
These people had similar problems with openCVpython.( Please note that I am using c++ opencv )
https://stackoverflow.com/questions/4...
https://stackoverflow.com/questions/3...
That's not possible using imread function: You can write your own function to read tiff format or you can try to make your color histogram and you should find 256 colors in your image and then retrieve a color index