How to plot RGB and each band image from MODIS hdf file?

3 ビュー (過去 30 日間)
nsyn
nsyn 2016 年 1 月 28 日
コメント済み: Image Analyst 2016 年 1 月 28 日
Hello,
I am new user in matlab and modis
Now, I am trying to plot RGB image and image from each band using hdf data "MOD021KM", RGB is band 1,4 and 3in modis
this is my code:
file_name = 'MOD021KM.A2015274.0320.005.2015278201601.hdf';
% open data : hdftool('MOD021KM.A2015274.0320.005.2015278201601.hdf')
% read data HDF file
EV_250_Aggr1km_RefSB = hdfread('MOD021KM.A2015274.0320.005.2015278201601.hdf', ...
'MODIS_SWATH_Type_L1B', 'Fields', 'EV_250_Aggr1km_RefSB',...
'Index',{[1 1 1],[1 1 1],[2 2030 1354]});
EV_500_Aggr1km_RefSB = hdfread('MOD021KM.A2015274.0320.005.2015278201601.hdf', ...
'MODIS_SWATH_Type_L1B', 'Fields', 'EV_500_Aggr1km_RefSB',...
'Index',{[1 1 1],[1 1 1],[5 2030 1354]});
lat = hdfread(file_name,'Latitude');
long = hdfread(file_name,'Longitude');
data = EV_250_Aggr1km_RefSB;
% initialize each band of the result image with the original image
red = squeeze(data(:,:,1,:));
green = squeeze(data(:,:,3,:));
blue = squeeze(data(:,:,4,:));
can you help me, please check it and let me know what code should I use to plot data for each band? and after that in RGB?
  1 件のコメント
Image Analyst
Image Analyst 2016 年 1 月 28 日
What does "plot" mean when you're talking about an image? Do you mean display? If so, then use imshow(). Or maybe you mean surf()?

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeHDF5 についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by