Ask Your Question

zenified's profile - activity

2020-06-22 16:42:26 -0600 received badge  Student (source)
2016-10-12 20:08:44 -0600 received badge  Famous Question (source)
2015-09-08 16:09:33 -0600 received badge  Notable Question (source)
2015-03-01 10:34:02 -0600 received badge  Popular Question (source)
2013-08-29 00:09:58 -0600 commented answer unable to properly read 16bit tiff image

it 2 for the test image generated from Michael's code.

I found out the reason why there was an exception. The image loaded by opencv is stored in a 32F format, changing the type case to float fixed the problem.

My issue was that I have been reading the image matrix manually using the .data() operation. Which is why the matrix is always been processed as a 8 bit image.

Thanks you Michael for the your code, it helped me realized my mistake. Steven thank you for codes for formatting an imread too. I shall go and retry it on the Tiff image

2013-08-25 21:57:15 -0600 received badge  Supporter (source)
2013-08-25 20:59:08 -0600 commented answer unable to properly read 16bit tiff image

ok this is strange. Your code works for the tiff file you created. But when I replaced it with my image file the last line give me an exception at memory location

2013-08-25 20:26:10 -0600 commented answer unable to properly read 16bit tiff image

Just to check.. in line 3 the file name should be "test.tiff" right. If that is correct the output i gotten is >2 2 >400 Is this the output i am suppose to be expecting? Seems like it was able to store and output value higher then 8bit

2013-08-22 21:28:48 -0600 commented answer unable to properly read 16bit tiff image

Yup I did used CV_LOAD_IMAGE_ANYDEPTH in imread function. But it is still stored as unsigned char.

Here is the imread code i used

imgRGB = imread(src, CV_LOAD_IMAGE_ANYDEPTH | CV_LOAD_IMAGE_COLOR);
2013-08-22 04:06:59 -0600 asked a question unable to properly read 16bit tiff image

Hi, I am currently trying to use opencv to process a 16 bit tiff image. However the image matrix returned by imread seem to be filled with '255' values. I have tried various flag combination but it all does not seem to work. I tried reading a 16 bit EXR file and it was alright. As most of the values of the image is in levels higher then 255, it will seems as if the image was down converted into an 8 bit with all the level clipped.

Many Thanks