Documentation

This is machine translation

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

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Define Ground Truth for Image Collections

The Image Labeler app provides an easy way to label rectangular regions of interest (ROIs) for object detection, pixels for semantic segmentation, and scenes for image classification.

ROI and Scene Label Definitions

  • ROI Label corresponds to either a rectangle or pixels. These labels include the name, such as "cars", and the ROI you create.

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

Using this app, you can:

  • Interactively specify rectangular and pixel regions and scene labels.

      • Use rectangle ROI labels for objects such as vehicles, pedestrians, and road signs.
      • Use pixel regions for areas such as backgrounds, roads, and buildings.

        Use scene labels for conditions like lighting, weather conditions, or events like 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 app icon.

    • 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 datastore 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 ROIs 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.

    Specify 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 plus sign, then specify a name to represent the label and then choose either Rectangle or Line for its 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.

    Mark Ground Truth

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

    Create Labels Manually

    • To draw ROI labels manually, select an ROI label definition from the left pane and use the mouse to draw the regions on the image frames.

    • To label individual pixels, see Label Pixels for Semantic Segmentation.

    • To mark scene labels manually, select a scene label defintion from the left pane and then click Add Label.

    Create Labels Using an Automation Algorithm

    1. Use the Select Algorithm section to select an algorithm for automated labeling. You can use a built algorithm, import an algorithm, or you can create one.

      • 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 Image Labeling.

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

    2. Click Automate. Only ROI and scene label definitions that are valid for the selected algorithm are used. Valid label definitions are enabled in the left pane and algorithm instructions appear in the right pane.

    3. Click Run.

    4. Examine the results of running the algorithm. If they were not satisfactory, click Undo Run and change algorithm settings by clicking Settings.

    5. When you are satisfied with the algorithm results, click Accept. Click Cancel to delete the labels generated during the automation session. The Cancel button cancels only the algorithm session, not the app session.

    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. See Train an Object Detector from Ground Truth Data (Automated Driving System Toolbox).

    See Also

    Apps

    Using Objects

    Related Topics