Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
load a sequence of images

Subject: load a sequence of images

From: St.Ivanov

Date: 23 Aug, 2012 20:16:07

Message: 1 of 5

Hi,
would you help me with the code to the following problem:
I have a sequence of 1000 image in one directory and I have to execute a certain procedure on each of the images. The result must be saved under different variable for each image so that as a result I must have 1000 .mat files. I tried to make up loops but they didn't work.

Subject: load a sequence of images

From: Maxim Vedenev

Date: 24 Aug, 2012 06:25:35

Message: 2 of 5

Example:
drs='./images_folder'; % in current directory
dr1=dir([drs '/*.jpg']); % get only jpg
f1={dr1.name}; % get only filenames to cell
for c=1:length(f1) % for each image
I=imread([drs '/' f1{car}]);
[do proceeing here]
end

------------------------------------
Maxim Vedenev, Matlab freelancer
vedenev@ngs.ru
http://simulations.narod.ru/

Subject: load a sequence of images

From: ImageAnalyst

Date: 24 Aug, 2012 21:12:35

Message: 3 of 5

Read the FAQ for several code examples:

http://matlab.wikia.com/wiki/FAQ#How_can_I_process_a_sequence_of_files.3F

Subject: load a sequence of images

From: St.Ivanov

Date: 26 Aug, 2012 14:40:16

Message: 4 of 5

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <8f23695d-1596-45e3-9c80-edafe0d19d4e@googlegroups.com>...
> Read the FAQ for several code examples:
>
> http://matlab.wikia.com/wiki/FAQ#How_can_I_process_a_sequence_of_files.3F

Thank you both of you for the useful information.

Subject: can you please help!

From: shah

Date: 14 Mar, 2014 11:39:08

Message: 5 of 5

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <8f23695d-1596-45e3-9c80-edafe0d19d4e@googlegroups.com>...
> Read the FAQ for several code examples:
>
> http://matlab.wikia.com/wiki/FAQ#How_can_I_process_a_sequence_of_files.3F

for i=1:24,
    I=imread('F:\r\MyZip\3.jpg');
        I = imcrop(I(i),[x,y,width,height]);
     I = rgb2gray(I);
I=im2double(I);
thresh=multithresh(I,2);
 seg_I = imquantize(I,thresh);
 RGB = label2rgb(seg_I);

I want all of my images in a folder to be read in matlab which I am not able to do plus I need to crop them to select only target object cz then it gives out of memory error.
How can I calculate mean grey value of each segment of the image after multithresh(A,N).

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us