Function to read a 16bit color composite image to matlab
21 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Yonatan Degefu
el 4 de Jul. de 2017
Comentada: Walter Roberson
el 30 de Abr. de 2019
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 comentarios
Nirav Sharda
el 13 de Jul. de 2017
The following documentation link has a section that talks about how to read tiff file image data and metadata.
Respuesta aceptada
Walter Roberson
el 13 de Jul. de 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].
0 comentarios
Más respuestas (2)
Kelly Kearney
el 13 de Jul. de 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.
0 comentarios
Eslam Wafdy
el 29 de Abr. de 2019
Try using imagesc(data matrix)
1 comentario
Walter Roberson
el 30 de Abr. de 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()
Ver también
Categorías
Más información sobre Convert Image Type en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!