How to visualise Hyperspectral Image in colour?
Mostrar comentarios más antiguos
I am using hyperspectral datasets from this website: http://www.spectir.com/free-data-samples/. I can visualise a picture in gray but not in colour. How can I convert the gray image to an RGB colour image?
Thanks in advance
1 comentario
Yogesh Awate
el 15 de Nov. de 2017
Can someone send me the whole program?
Respuestas (2)
Image Analyst
el 11 de Oct. de 2012
Put each spectral channel into one of the color channels:
rgbImage = cat(3, spectralChannel1, , spectralChannel3, , spectralChannel8);
imshow(rgbImage);
or whatever channels you want to use.
12 comentarios
Alexandros Polykarpou
el 11 de Oct. de 2012
Editada: Alexandros Polykarpou
el 11 de Oct. de 2012
Image Analyst
el 11 de Oct. de 2012
rgbImage = cat(3, reflectance, radiance, zeros(size(radiance)));
imshow(rgbImage);
Alexandros Polykarpou
el 11 de Oct. de 2012
Image Analyst
el 11 de Oct. de 2012
Are the images monochrome or color? I'm assuming they're monochrome. What does this say:
size(reflectance)
size(radiance)
Alexandros Polykarpou
el 11 de Oct. de 2012
Image Analyst
el 11 de Oct. de 2012
Editada: Image Analyst
el 11 de Oct. de 2012
Tell me why your spectral image is already in color. Each spectral band should be one monochrome image. Is the image gray? Are the red, green, and blue channels all identical? Can you call grab just one channel:
grayImage = reflectance(:, :, 2); % Get green channel.
Alexandros Polykarpou
el 12 de Oct. de 2012
Image Analyst
el 12 de Oct. de 2012
No. A gray colormap should make the image look grayscale, not blue + other colors.
Alexandros Polykarpou
el 12 de Oct. de 2012
Image Analyst
el 12 de Oct. de 2012
When you do this:
slice=reflectances(:,:,15);
it takes the 15th color plane of reflectances. This is a 2D image - it is not color. When you use imagesc(slice), it (for some reasons that I've never figured out) applies some kind of bizarre colormap. However when you apply the gray colormap, it should fix it and show up in gray. I think you called colormap() incorrectly. You should use colormap(gray(256)) - no single quotes. Even better, use imshow() instead of imagesc().
Alexandros Polykarpou
el 12 de Oct. de 2012
worku jifara
el 9 de Feb. de 2017
i think this may be helpful for you load('ref_crown3bb_reg1.mat') x=reflectances(:,:,17); figure; imagesc(x); colormap('gray');brighten(0.5); y = reflectances(:,:,25); figure; imagesc(y); colormap('gray');brighten(0.5); z=reflectances(:,:,33); figure; imagesc(z); colormap('gray');brighten(0.5); all=cat(3,x,y,z); figure; imshow(all)
Image Analyst
el 15 de Nov. de 2017
0 votos
See this paper that describes a variety of ways to convert spectral bands to RGB: http://my.ece.msstate.edu/faculty/du/JSTARS-VIS.pdf
Categorías
Más información sobre Color and Styling en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!