Open Image Segmenter App and Load Image

This example shows how to open the Image Segmenter app and load an image.

Read an image into the MATLAB® workspace. The example uses the imread function to import an image of coins.

I = imread('coins.png');

Open the Image Segmenter app. From the MATLAB Toolstrip, open the Apps tab and under Image Processing and Computer Vision, click Image Segmenter . You can also open the Image Segmenter from the command line:


Load an image into the Image Segmenter app. Click Load Image and choose whether you want to specify the name of the file containing the image or the name of a workspace variable. The Image Segmenter app can open any file that can be read by imread.


If you want to use Image Segmenter tools to refine an existing binary mask for an image that you have already segmented, first load the image. The Image Segmenter does not enable the Load Mask button until you load an image. After you load the image, use Load Mask to load the binary mask. See Load Existing Binary Mask into Image Segmenter for more information.

To load an image from the workspace, select the Load Image From Workspace option. In the Import From Workspace dialog box, select the variable you created.

The app displays the image you loaded and displays a thumbnail of the result of the segmentation (the mask image) in the Data Browser. Initially, the thumbnail is completely black because you have not started yet. You can perform multiple segmentations using the app and each segmentation appears, with a thumbnail, in the Data Browser. To start a new segmentation click New Segmentation. The app displays the steps you take while creating the segmentation in the History part of the Data Browser.