필터 지우기
필터 지우기

Define one axe for many images

조회 수: 2 (최근 30일)
Ali Jaber
Ali Jaber 2016년 4월 4일
편집: Ali Jaber 2016년 4월 24일
I have 10 axes in which I want the most relevant images to be shown in. So I defined them as follows. But I have a problem that if the first image is not relevant, the axes1 remains empty. Can I just define one axe for all images? How to do that?
  댓글 수: 5
Ali Jaber
Ali Jaber 2016년 4월 4일
I can't since I want the old image to stay appeared..
Ali Jaber
Ali Jaber 2016년 4월 4일
any help plz?

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

채택된 답변

Geoff Hayes
Geoff Hayes 2016년 4월 4일
Ali - if you want to ignore the images which are not relevant (does this mean that cosTheta <= 0.5?) then use a different local variable to access the axes handles. For example,
atAxes = 1;
for k=1:10
a = trainZ(k,:);
b = testZ;
cosTheta = dot(a,b)/(norm(a)*norm(b));
if(cosTheta > 0.5)
str = strcat('C:\Users\User\Desktop\images\',num2str(k),'.jpg');
img = imread(str);
axes(handles.axes(atAxes));
atAxes = atAxes + 1;
imshow(img);
end
end
Note how we use atAxes so that we update the appropriate axes with a "relevant" image. So if 4 of our 10 images are relevant, then only the first four axes are updated with the images.
Is this what you are looking for? Or do you require something more to ensure that the unused axes are hidden or removed?
  댓글 수: 2
Ali Jaber
Ali Jaber 2016년 4월 4일
Thank you very much.. This is exactly what I want. Concerning not relevant images (cosTheta <= 0.5), I take it as example since I am not sure about it. Do you have any idea that may help me?
Geoff Hayes
Geoff Hayes 2016년 4월 4일
Ali - without knowing more about what your code is doing or what you consider to be "relevant", I can't comment on the use of cosTheta. What does it represent to you?

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

추가 답변 (1개)

Image Analyst
Image Analyst 2016년 4월 4일
You can display more than one image in an axes if you stitch them together.
tallImage = [image1; image2];
wideImage = [image1, image2];

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by