필터 지우기
필터 지우기

how display a array of image using a for loop

조회 수: 7 (최근 30일)
mahendra kumar
mahendra kumar 2012년 4월 14일
i have stored 10 images in a array im=[im1,im2......],bt when i try to display it, it is not getting displaying i.e for i=1:10 figure, imshow(im(i)) plz can anyone help in figure out this problem

답변 (1개)

Image Analyst
Image Analyst 2012년 4월 14일
You're using linear indexing, which in effect only shows the first pixel of each image plane. If your images are grayscale images in a 3D array, you can do this:
for slice = 1 : size(im, 3)
imshow(im(:,:,slice), []);
drawnow;
pause(0.5); % Wait 1/2 second to show each one.
end
The colon means " all rows" or " all columns" so I'm taking all rows and all columns of each slice and displaying that entire slice.
  댓글 수: 2
mahendra kumar
mahendra kumar 2012년 4월 14일
sir actually what i m trying to do is, i hav stored 3 images in a folder i.e an eye opened,eye closed and eye half opened image. so now i want to compare a sequence of 5 eye closed image with with my image comparing code to show no eye moment detected and in the 6th comparison i like to introduce a eye opened image and display that the eye moment has been detected. so i need to put 5 eye closed and 1 eye opened image in an array and sequentially retrieve it and do the comparison and display the result... so can i do this with the for loop or do i need anything eles
Image Analyst
Image Analyst 2012년 4월 14일
편집: Walter Roberson 2012년 8월 10일
Since eyes will be so different from one person the the next, I think it would be hard to compare images directly, for example through subtraction. I think you'd be better off analyzing each image and getting a feature vector of things, like "pupil present", "skin area fraction", "iris detected", etc. You should study up here to get some idea of how people do eye detection/tracking: http://iris.usc.edu/Vision-Notes/bibliography/contentspeople.html#Face%20Recognition,%20Detection,%20Tracking,%20Gesture%20Recognition,%20Fingerprints,%20Biometrics

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

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by