how to display images using subplot in right corner of gui

조회 수: 3 (최근 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 CenterFile Exchange에서 Subplots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by