Got Questions? Get Answers.
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:
reading images from folder

Subject: reading images from folder

From: talal hammouri

Date: 21 Apr, 2009 07:22:01

Message: 1 of 9

 Dear all,

  I have a problem of how to read 100 images from a folder in the desktop , would you please inform me of how to read these images using matlab code (i'm beginer of using MATLAB).

Subject: reading images from folder

From: Nasser Abbasi

Date: 21 Apr, 2009 08:33:28

Message: 2 of 9


"talal hammouri" <talalah@yahoo.com> wrote in message
news:gsjs6p$i1v$1@fred.mathworks.com...
> Dear all,
>
> I have a problem of how to read 100 images from a folder in the desktop
> , would you please inform me of how to read these images using matlab
> code (i'm beginer of using MATLAB).

Make a loop, inside the loop, use imread, store each image read in a
different entry in a vector?

help for
help imread

--Nasser

Subject: reading images from folder

From: Naeem

Date: 30 Mar, 2010 11:19:06

Message: 3 of 9

"talal hammouri" <talalah@yahoo.com> wrote in message <gsjs6p$i1v$1@fred.mathworks.com>...
> Dear all,
>
> I have a problem of how to read 100 images from a folder in the desktop , would you please inform me of how to read these images using matlab code (i'm beginer of using MATLAB).


hey
i am facing the same problem, send the matlab code if u have one.
thanks

Subject: reading images from folder

From: Steven Lord

Date: 30 Mar, 2010 13:37:25

Message: 4 of 9


"Naeem " <nshayan@gmail.com> wrote in message
news:hosmna$qfp$1@fred.mathworks.com...
> "talal hammouri" <talalah@yahoo.com> wrote in message
> <gsjs6p$i1v$1@fred.mathworks.com>...
>> Dear all,
>>
>> I have a problem of how to read 100 images from a folder in the
>> desktop , would you please inform me of how to read these images using
>> matlab code (i'm beginer of using MATLAB).
>
>
> hey i am facing the same problem, send the matlab code if u have one.
> thanks

See question 4.12 in the newsgroup FAQ.

--
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ

Subject: reading images from folder

From: Naeem

Date: 31 Mar, 2010 09:19:04

Message: 5 of 9

"Steven Lord" <slord@mathworks.com> wrote in message <hosuq2$4lr$1@fred.mathworks.com>...
>
> "Naeem " <nshayan@gmail.com> wrote in message
> news:hosmna$qfp$1@fred.mathworks.com...
> > "talal hammouri" <talalah@yahoo.com> wrote in message
> > <gsjs6p$i1v$1@fred.mathworks.com>...
> >> Dear all,
> >>
> >> I have a problem of how to read 100 images from a folder in the
> >> desktop , would you please inform me of how to read these images using
> >> matlab code (i'm beginer of using MATLAB).
> >
> >
> > hey i am facing the same problem, send the matlab code if u have one.
> > thanks
>
> See question 4.12 in the newsgroup FAQ.
>
> --
> Steve Lord
> slord@mathworks.com
> comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
>
thanks Steve lord
i used the code given below to read and add noise to bmp files from a folder. now i want to write these files into a new folder under the same name like bus_0000.bmp, bus_0001.bmp, etc (or overwrite them).

bmpFiles = dir('*.bmp');
for k = 1:length(bmpFiles)
  filename = bmpFiles(k).name;
  data1 = imread(filename);
   J = imnoise(data1,'gaussian',0,0.1);
end

Subject: reading images from folder

From: Sadik

Date: 31 Mar, 2010 09:40:09

Message: 6 of 9

Hi Naeem,

You can add a single more line to overwrite it, but it certainly is a better practice to make a new folder and save things there:

mkdir NoisyImages
bmpFiles = dir('*.bmp');
for k = 1:length(bmpFiles)
  filename = bmpFiles(k).name;
  data1 = imread(filename);
   J = imnoise(data1,'gaussian',0,0.1);
   imwrite(J,['NoisyImages\' filename]);
end

Best.

Subject: reading images from folder

From: Naeem

Date: 31 Mar, 2010 16:41:25

Message: 7 of 9

"Sadik " <sadik.hava@gmail.com> wrote in message <hov59o$r5p$1@fred.mathworks.com>...
> Hi Naeem,
>
> You can add a single more line to overwrite it, but it certainly is a better practice to make a new folder and save things there:
>
> mkdir NoisyImages
> bmpFiles = dir('*.bmp');
> for k = 1:length(bmpFiles)
> filename = bmpFiles(k).name;
> data1 = imread(filename);
> J = imnoise(data1,'gaussian',0,0.1);
> imwrite(J,['NoisyImages\' filename]);
> end
>
> Best.

thanks Sadik

it worked.

Subject: reading images from folder

From: Bella Sam

Date: 26 May, 2012 13:19:07

Message: 8 of 9

Hi, I would like to know if it is possible to like, list all the names of the images into GUI without using looping. Because I wanted user to just click the next image name from the list without 'Upload New Image'-thingy after they finished analyzing with the one they clicked before.

p.s. Does this badly effect the computational time (or anything related to my GUI performance)

Thanks in advance :)

Subject: reading images from folder

From: ImageAnalyst

Date: 26 May, 2012 15:50:20

Message: 9 of 9

On May 26, 9:19

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