How to get a position (index(j)) of a loaded image?

조회 수: 1 (최근 30일)
levpa levpa
levpa levpa 2019년 2월 14일
댓글: Image Analyst 2020년 1월 5일
Hi,
I am new here and I need an advice. How can I get a position of the loaded image among other pictures in folder (number of index(j))?
I know how to load all images from folder - dir(). I also know how to calculate the number of pictures in a folder - N=lenght(). But now I would like to load/select the image from the folder, that will be the first in my for cycle (because for example the first 5 images are blurry - I want to start with image number 6=j, but this number is constantly changing and I do not want to change this number manually but by selecting the image).
It will looks like: for i= j:N ....
Sorry for my bad english.
I will be grateful for any help you can provide.
  댓글 수: 9
Geoff Hayes
Geoff Hayes 2019년 2월 15일
so if you start the cycle at 110 then you expect to load image 110.jpg, then 140.jpg, then 145.jpg, etc.?
levpa levpa
levpa levpa 2019년 2월 15일
Yes. I want to load all the pictures except the first five (for example five, in another folder it can be the first three images etc). So in this case will "for cycle " start with number 6(=j which I am looking for)

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

채택된 답변

Image Analyst
Image Analyst 2019년 2월 16일
You said "By displaying all of them and having the user click...."
Just list all your images in a listbox and have the user select whatever ones they want. See MAGIC
  댓글 수: 2
Kalyan Seelam
Kalyan Seelam 2020년 1월 5일
what if the list of images saved as temp.jpg,temp(2).jpg etc.,
Image Analyst
Image Analyst 2020년 1월 5일
That's fine. Just build up a cell array of filenames and send it to a listbox.
files = dir('temp*.jpg')
allFileNames = {files.name}
handles.listbox1.String = allFileNames;
If you want, you can examine each filename and parse it first for certain characters to see if you want to add it to the list or not.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Import, Export, and Conversion에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by