View Thumbnails of Images in Folder or Datastore

You can use the Image Browser app to view reduced-size versions, called thumbnails, of all the images in a folder or an image datastore.

View Thumbnails of Images in Folder

This example shows how to use the Image Browser to view thumbnails of all the images in a folder. The example looks in the Image Processing Toolbox™ sample image folder, imdata, for a binary image that would be suitable to use with the Image Region Analyzer app. The example shows how to and open the image in the Image Region Analyzer app from within the Image Browser app.

Open the Image Browser app. From the MATLAB® toolstrip, on the Apps tab, in the Image Processing and Computer Vision group, click Image Browser . You can also open the app at the command line using the imageBrowser command.

Load images into the app. Click Load and select Load folder of images. For this example, load all the images in the Image Processing Toolbox sample image folder. In the file selection dialog box, navigate to the imdata folder. You can also specify a folder name when you open the Image Browser app at the command line.

 imageBrowser(fullfile(matlabroot,'toolbox/images/imdata/'));

The Image Browser app displays thumbnails of all the images in the folder.

View thumbnails of the sample images. To see more detail, you can use the Thumbnail Size slider to make the thumbnails bigger. You can also view an individual image in a Preview tab. For this example, select the binary image that contains many different shapes and click Preview. The Image Browser displays the image at in a Preview tab. If you want to explore the image further, you can use the zoom and pan options with the image in the Preview tab.

Open the selected image in the Image Region Analyzer app. Because you selected a binary image, the Image Browser app enables the Image Region Analyzer app icon in the Image Processing Apps section of the toolstrip. To open the app with the image you selected, click Image Region Analyzer.

View Thumbnails of Images in Image Datastore

This example shows how to use the Image Browser app to view thumbnails of images in an image datastore and export one of images to the workspace. For more information about datastores, see Getting Started with Datastore (MATLAB).

First, create an image datastore. The example creates an image datastore that contains all the sample images included with the Image Processing Toolbox.

imds = imageDatastore(fullfile(matlabroot,'toolbox/images/imdata/'));

Open the Image Browser app. From the MATLAB toolstrip, on the Apps tab, in the Image Processing and Computer Vision group, click Image Browser . You can also open the app at the command line using the imageBrowser command.

Load the images from the image datastore. Click Load and select the Load image datastore from workspace option. You can also specify the name of an image datastore in the workspace when you open the Image Browser app at the command line.

 imageBrowser(imds);

In the Pick an image datastore from the workspace dialog box, select the image datastore and click OK.

The Image Browser displays thumbnails of all the images in the image datastore.

Save one of the images in the datastore to the workspace. Right-click an image and choose the Export image to workspace option. In the Export to workspace dialog box, specify the variable name you want to use for the image.

Remove Image from Image Browser and Create Datastore

This example shows how to modify the display of thumbnails in the Image Browser app and then save the modified display in an image datastore. Removing images can be useful way of reducing clutter from the Image Browser app display when working with a folder of images that you are going to view in the app more than once. The Image Browser app does not delete the images from the file system—it only removes the thumbnail from the display.

Open the Image Browser app. From the MATLAB toolstrip, on the Apps tab, in the Image Processing and Computer Vision group, click Image Browser . You can also open the app at the command line using the imageBrowser command.

Load images into the app. Click Load and select Load folder of images. For this example, load all the images in the Image Processing Toolbox sample image folder. In the file selection dialog box, navigate to the imdata folder. You can also specify a folder name when you open the Image Browser app at the command line.

 imageBrowser(fullfile(matlabroot,'toolbox/images/imdata/'));

The Image Browser app displays thumbnails of all the images in the folder.

Right-click an image that you want to remove from the Image Browser app display. To remove it, choose the Remove from browser option on Image Browser app context menu. The Image Browser app deletes the thumbnail from the display.

Save the modified set of images displayed in the Image Browser in an image datastore. Click Export All and specify the variable name you want use for the datastore in the workspace. When you open this image datastore in the future, the Image Browser app displays only the images you saved in the image datastore.