how to save hyperspectral image array to image in matlab?

조회 수: 12 (최근 30일)
Wind Cloud
Wind Cloud 2014년 3월 26일
댓글: yanjie qi 2016년 3월 9일
hello everyone, i have some questions about processing hyperspectral image using matlab,and they are as follows:
(1) i use multibandread function to read one hyperspectral image and an image array is obtained. Then how can i write the array to image, such "tif","jpg" ? Because hyperspectral image has many bands, so imwrite function is useless. multibandwrite function can be used to write the array, however the result is binary image not tif or jpg.
(2) i randomly select 3 bands from the hyperspectral image array and want to display one color image. I have done this work according to the strategy in rgb image, but the composite rgb hyperspectral image cannot display. what's wrong?
  댓글 수: 2
Walter Roberson
Walter Roberson 2014년 3월 26일
If you had (say) 4 bands, what would you expect the image file to look like? You wold expect that in such a case it would render as CMYK ?
Wind Cloud
Wind Cloud 2014년 3월 26일
i want to get similar results as the function "imwrite", which means the final image type is "*.tif","*.jpg",etc. My initial purpose is to cut the whole image into many patches with the same size and same bands, and then write the image array corresponding to each patch to image with the type "*.tif","*.jpg",etc.This work is easy for rgb image with three bands using the function "imwrite".

댓글을 달려면 로그인하십시오.

답변 (3개)

Image Analyst
Image Analyst 2014년 3월 26일
You can save the variable with save() into a .mat file if all you want to do with it in the future is to read it back into MATLAB again. Of you can use multibandwrite()
  댓글 수: 2
Wind Cloud
Wind Cloud 2014년 3월 27일
this may be an eclectic choice in such case. thanks!
Image Analyst
Image Analyst 2014년 3월 27일
So is the problem solved, or not?

댓글을 달려면 로그인하십시오.


Walter Roberson
Walter Roberson 2014년 3월 26일
When you use imwrite() the expectation is that you are creating an image intended to be rendered for human eyes -- black and white, or greyscale, or pseudocolor, or true color (RGB) or CYMK. imwrite() is not intended for storing multiple bands.
.jpg files cannot store more than 3 bands.
.tiff files can store 4 bands fairly directly and will believe that it is a CMYK image.
If you use the TIFF class then you can create "tiles" and "strips". It also supports a "directory" and "subdirectories" that can be used to write multiple images or data sets to a TIFF file.
  댓글 수: 2
Wind Cloud
Wind Cloud 2014년 3월 27일
in fact, TIFF class cannot solve my problem. anyway, thanks!
Jurgen
Jurgen 2014년 3월 27일
Actually TIFF can store your hyperspectral image as one file. Just don't expect to open it in standard windows image viewer.

댓글을 달려면 로그인하십시오.


Cong Huynh
Cong Huynh 2015년 8월 14일
To load and save multispectral images (consisting of pairs of .hdr and .fla files), you could use the Scyllarus hyperspectral image processing toolbox. The MATLAB version of this toolbox is available for non-commercial use and can be downloaded from http://scyllarus.research.nicta.com.au/
The functions to look at are FLARead and FLAWrite under src/io. With these functions you can read from and write to the .fla format (ENVI-compatible), rather than any colour image format. Alternatively you can save the image to a .mat file but this option usually produces a much larger image.
  댓글 수: 1
yanjie qi
yanjie qi 2016년 3월 9일
I have tried the tool box,and I use matlab R2014a. However, most of the function I can't use them, like FLAread... and
>> G = data2graph(xdata); 未定义与 'double' 类型的输入参数相对应的函数 'data2graph'。

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Display Point Clouds에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by