View Thumbnails of Images in Folder or Datastore

This example shows how to use the Image Browser app to view reduced-size versions, called thumbnails, of all the images in a folder or in an image datastore. You can also view larger resolution versions of individual images. In addition, you can use the Image Browser app to open a selected image in another app, such as the Image Region Analyzer app.

View Thumbnails of Images in Folder

To view thumbnails of all the images in a folder, open the Image Browser app from the MATLAB® toolstrip. On the Apps tab, in the Image Processing and Computer Vision section, click Image Browser .

Load images into the app by first clicking Load and then select Load folder of images. The app displays a file explorer window. Navigate to the folder you want to view. For this example, select the sample image folder, imdata.

You can also open the app at the command line using the imageBrowser function, specifying the name of the folder you want to view. For example, to view all the images in the sample image folder, use this command: imageBrowser(fullfile(matlabroot,'toolbox/images/imdata/'));.

The Image Browser app displays thumbnails of all the images in the folder. To adjust the size of the image thumbnails, use the Thumbnail Size slider in the app toolstrip.

View Thumbnails of Images in Image Datastore

To view thumbnails of all the images in an image datastore, open the Image Browser app from the MATLAB® toolstrip. On the Apps tab, in the Image Processing and Computer Vision section, click Image Browser .

Load images into the app by first clicking Load and then select Load image datastore from workspace.

For this example, create an image datastore by using the imageDatastore function containing the images in the imdata folder.

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

In the dialog box, select the image datastore variable and click OK. The Image Browser app displays thumbnails of all the images in the folder.

You can also open the app at the command line using the imageBrowser function, specifying the name of the image datastore that you want to view. For example, to view all the images in the image datastore created from the sample image folder, use this command: imageBrowser(imds);

Explore an Image in More Detail

To get a closer look at an image displayed in the Image Browser app, select the image and click Preview. You can also get a preview by double-clicking an image. The app displays the image at a higher resolution in a Preview tab. For example, view the blobs.png binary image in a Preview tab.

To explore the image displayed in the Preview tab, use the zoom and pan options visible over the top-right corner of the image when you pause over the image.

Export Images to the Workspace or an Image Datastore

If you are viewing images in a folder, you can export all the images in an image datastore. On the app toolstrip, click Export All and specify the name of the image datastore. To export an individual image from the folder, right-click the image and choose Export image to workspace. Specify the name of the workspace variable in which you want to store the image.

If you are viewing images in an image datastore, you can export an individual image into the workspace. Right-click the image, one of the images to the workspace, select the image, right-click, and then 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.

Customize View of Folder

If you are viewing images in a folder in the Image Browser app, you can modify the display of thumbnails. For example, you can delete some of the image thumbnails and then save the modified display in an image datastore. Click Export All in the toolstrip and specify the variable name you want use for the datastore. When you open this image datastore in the future, the Image Browser app displays only the images you saved. The Image Browser app does not delete the images from the file system—it only removes the thumbnails from the display.

Launch Another App from the Image Browser App

You can select an image in the Image Browser app and then open the image in another app. The Image Browser app lets you open the Image Viewer app, the Color Thresholder app, the Image Segmenter app, and the Image Region Analyzer app.

For example, in the Image Browser app select the blobs.png image. In the app toolstrip, click the Image Region Analyzer app. The Image Region Analyzer app opens containing the blobs.png image.

See Also

|

Related Topics