Function to read a 16bit color composite image to matlab

23 Ansichten (letzte 30 Tage)
Hi, I was trying to open a 16 bit color composite image in matlab but everytime it gives me a dark surface when using imread. What is another function I can use to read it into matlab and perform further image analysis.
  3 Kommentare
Yonatan Degefu
Yonatan Degefu am 4 Jul. 2017
The Image is about 14 MB, too large to attach here. And its a tiff file. But I can send you a dropbox link if you send me an email.
Nirav Sharda
Nirav Sharda am 13 Jul. 2017
The following documentation link has a section that talks about how to read tiff file image data and metadata.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 13 Jul. 2017
imread() is probably valid to read the image. Using the Tiff class would be another way.
But the problem is likely not in reading the image, but rather in displaying the image. It is pretty uncommon that the full 16 bit range is used for images stored as 16 bit TIFF: it is more likely that instrument readings are being stored, such as CT images.
It is not uncommon that the used data range for 16 bit TIFF images is roughly -600 to +4000 (technically -4096 to +4095) such as for CT, or roughly 1000 to 6000 (MRI).
You can use imagesc(data), or use imshow(data, []) to have the minimum and maximum stored data mapped across the available colormap.
You will likely find, however, that the data range of interest is only a subset of what is stored. You can pass specific min and max values to imagesc() or imshow() to map the given range across the color map, with lower values mapped to the first color and higher values mapped to the second color.
Once you have identified the range of interest, then you can either zero out everything outside the range, or you can use mat2gray() and pass in the range to map the chosen range to the interval [0, 1].

Weitere Antworten (2)

Kelly Kearney
Kelly Kearney am 13 Jul. 2017
Many years ago, I had to work with some 16-bit color avi files. Those files stored the RGB color data using 16 bits per pixel: 5 bits each for red, blue, and green, and one bit unused. Assuming your images use a similar encoding, you can probably adapt that code to your tiff images; it's available here: avidread16bitcol.m.

Eslam Wafdy
Eslam Wafdy am 29 Apr. 2019
Try using imagesc(data matrix)
  1 Kommentar
Walter Roberson
Walter Roberson am 30 Apr. 2019
I talked about that in my answer. The data range of interest is often not the data range so you have to be careful about how you use imagesc()

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Convert Image Type finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by