MATLAB: Read all images in a folder; everything starts here

the Serious Computer Vision Blog

written by Gooly

In ordinary people’s life, it’s often the case that you need to deal with a large but not extremely huge image database with non sequential naming. Instead of reading each image when you need it, you probably would prefer to read it all into a matrix for one time, or even store it into a mat file so that you can access it much faster next time. The MATLAB function dir would be a good way to do this, see the example below.

To read in all the jpeg files in image_folder simply do the following,

Notice that this function only deals with image of the same size, which is usually the case; to be able to deal with different size images, you can use imresize in the function or other methods depending on what the task you are actually working on.

When dealing with huge image database (2GB…

View original post 24 more words

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s