This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Get Started with the Image Labeler

The Image Labeler app labels rectangular regions of interest (ROIs) for object detection, pixels for semantic segmentation, and scenes for image classification.

ROI and Scene Label Definitions

  • An ROI label corresponds to either a rectangular or pixel region of interest. These labels contain two components: the label name, such as "cars," and the region you create.

  • A Scene label describes the nature of a scene, such as "sunny." You can associate this label with a frame.

Using the Image Labeler app, you can:

  • Interactively specify ROI labels and scene labels.

    • Use rectangular ROI labels for objects such as vehicles, pedestrians, and road signs.

    • Use pixel labels for areas such as backgrounds, roads, and buildings.

    • Use scene labels for conditions such as lighting and weather conditions, or for events such as lane changes.

  • Use built-in detection or tracking to automatically label the regions and scene labels.

  • Write, import, and use your own custom automation algorithm to automatically label a region and scene labels.

  • Export the ground truth labels for object detector training, semantic segmentation, or image classification.

Open the Image Labeler

  • MATLAB® Toolstrip: On the Apps tab, under Image Processing and Computer Vision, click the Image Labeler.

  • MATLAB command prompt: Enter imageLabeler.

Load a Video or Image Sequence and Import Labels

To load data into the Image Labeler, from the app toolstrip, click Load. You can load the following data:

  • Data Source: Add images from a folder or by using the imageDatastore function.

  • Label Definitions: Load a previously saved set of label definitions from a file. Label definitions specify the names and types of items to label.

  • Session: Load a previously saved session.

To import ROI and scene labels into the app, click Import Labels. You can import labels from the MATLAB workspace or from previously exported MAT-files. The imported labels must be groundTruth objects.

Define ROIs and Scene Label Definitions

Before you can label your images, you must define the name and type of each label category. To define an ROI label, click the Define new ROI label, specify a name to represent the label, and then choose either Rectangle or Pixel label for the label type. To define a scene label, specify a descriptive name and optionally enter a description.

In addition, you can enter descriptions for ROI and scene labels that can be used as instructions for labeling.

To create labels from the MATLAB command line, use the labelDefinitionCreator object.

Label Ground Truth

After you set up the ROI label definitions, you can start labeling. You can create labels manually or use an automation algorithm.

 Create Labels Manually

Create Labels Using an Automation Algorithm

Use the Select Algorithm section to select an algorithm for automated labeling. You can use a built-in algorithm, create a custom algorithm, or import an algorithm.

  • Built-In Algorithm: Track people using the aggregated channel features (ACF) people detector algorithm.

  • Add a Custom Algorithm: To define and use a custom automation algorithm with the Image Labeler app, see Create Automation Algorithm for Labeling.

  • Import an Algorithm: To import your own algorithm, select Algorithm > Add Algorithm > Import Algorithm.

 Run an Automation Algorithm

Export Labels and Save Session

To export the ground truth labels to the MATLAB workspace or to a MAT-file, click Export Labels. The labels are exported as a groundTruth object. Click Save to save the session. The session and the exported labels are saved as MAT-files. You can use the exported groundTruth object to train an object detector or semantic segmentation network. See Train Object Detector or Semantic Segmentation Network from Ground Truth Data.


Pixel label data and ground truth data are saved in separate files. The app saves both files in the same folder. Keep these tips in mind:

  • The groundTruth object contains the file paths corresponding to the data source and the pixel label data. If you move the data source and pixel label data to a different folder, to update the paths stored within the groundTruth object, use the changeFilePaths function.

  • If you used an image collection to create your ground truth, do not delete images from the location you loaded them from. The path to those images is saved in the groundTruth object.

  • You can move the groundTruth MAT-file to a different folder.

For more details, see How Labeler Apps Store Exported Pixel Labels and Share and Store Labeled Ground Truth Data.

See Also



Related Topics