HI,i want user defined band of image in multiband image processing in GUI in matlab.In the belowUI code ,it is default selected band as 4,3,2 ,but i want this to be user defined in GUI.

4 ビュー (過去 30 日間)
c = multibandread('paris.lan', [512, 512, 7], 'uint8=>uint8',...
128, 'bil', 'ieee-le', {'Band','Direct',[4 3 2]});
imshow(c)
  2 件のコメント
Aarti Dwivedi
Aarti Dwivedi 2018 年 7 月 5 日
https://www.mathworks.com/help/matlab/ref/ginput.html If you are looking to get user input from mouse please check the above link to see if it fits your needs.

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

採用された回答

Image Analyst
Image Analyst 2018 年 7 月 5 日
Have 3 edit fields, one for each ban. The user can type into it. If you're using GUIDE, you can do
band1 = str2double(handles.edtBand1.String);
band2 = str2double(handles.edtBand2.String);
band3 = str2double(handles.edtBand3.String);
bandsToUse = [band1, band2, band3];
multiBandImage = multibandread('paris.lan', [512, 512, 7], 'uint8=>uint8',...
128, 'bil', 'ieee-le', {'Band','Direct',bandsToUse });
imshow(multiBandImage)
  2 件のコメント
deepika
deepika 2018 年 7 月 5 日
Thank you. but i want pixels range to be user defined. the code given below:
im=multibandread('paris.lan',[512,512,7],'uint8=>uint8',... 128,'bil','ieee-le',{'Band','Direct',[x,y,z]}); Nof_bands=7; for k=1:Nof_bands t_value=u(:,:,k);
x(k)=double(t_value(38,333));
y(k)=double(t_value(38,334));
z(k)=double(t_value(39,333));
b(k)=double(t_value(39,334));
x1(k)=double(t_value(486,115));
y1(k)=double(t_value(486,116));
z1(k)=double(t_value(487,115));
b1(k)=double(t_value(487,116));
avg(k)=double(x(k)+y(k)+z(k)+b(k))/4;
avg1(k)=double(x1(k)+y1(k)+z1(k)+b1(k))/4;
end
d=[1:1:7];
axes(handles.axes1);
plot(d,avg,'r',d,avg1,'g');
Image Analyst
Image Analyst 2018 年 7 月 5 日
See this link to format your code properly.
You can do the same thing with edit fields for user input. Or you can display one frame and ask the user to draw a box over it with imrect() or rbbox().

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeHyperspectral Image Processing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by