how to display images using subplot in right corner of gui

5 ビュー (過去 30 日間)
Anamika baruah
Anamika baruah 2014 年 6 月 20 日
コメント済み: Image Analyst 2014 年 6 月 21 日
I = imread('11.jpg'); I = rgb2gray(I); m=1; srcFiles = dir('fruits\*.jpg'); % the folder in which ur images exists for j = 1 : 30
filename = strcat('fruits\',srcFiles(j).name);
filenam = strcat('fruits',srcFiles(j).name);
I = imread(filename);
%I=graythresh(I);
%I=imresize(I,[20,15]);
%fr=strcat('features',filenam,'.mat');
b=dlmread('features11.mat')
%b1=dlmread(fr)
b1=dlmread('frs.mat')
sum=0;
for i=1:8
g = (b(i) - b1(j,i))^2
sum=sum+g
end
dist = sqrt(sum);
E_dist(j)=dist
disp(E_dist);
sd=sort(E_dist)
if(E_dist(j) <.0061)
subplot(3,3,m)
imshow(I);
m=m+1;
end
end
%sd=sort(E_dist)

回答 (2 件)

Dishant Arora
Dishant Arora 2014 年 6 月 20 日
h = subplot('position' , [0.7,0.7,0.2,0.2]) % [left bottom width height]
imshow(imageName , 'parent' , h);

Image Analyst
Image Analyst 2014 年 6 月 20 日
subplot(3,3,3) will be in the upper right corner. The others, with values of 1-2 and 4-9 in the third argument, will be displayed at the other locations of a 3 by 3 grid of images.
  2 件のコメント
Anamika baruah
Anamika baruah 2014 年 6 月 21 日
i dont understand your code..please give me code to display multiple image in gui in the right part using subplot
Image Analyst
Image Analyst 2014 年 6 月 21 日
You already have the code - you wrote it. Just call subplot(3,3,3) right before you call imshow() and the image will get displayed in the upper right corner. Here it is again:
subplot(3,3,3);
imshow(yourImage);

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

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by