Main Content

groundTruthFromOpenLabel

Convert OpenLabel JSON file to ground truth object

Since R2024b

Description

groundTruthFromOpenLabel(gTruth,jsonFile) converts ASAM OpenLABEL® format JavaScript Object Notation (JSON) data jsonFilename to ground truth gTruth.

You can use this function with the JSON file produced by the groundTruthToOpenLabel function. However, using this function with any third-party tools might produce an invalid ground truth object. If you encounter this issue, you can contact the MathWorks® Contact Technical Support help system for assistance.

example

Examples

collapse all

Add the folder that contains images, to the MATLAB® path. These data files must be available prior to converting the ASAM OpenLABEL JSON file.

imageDir = fullfile(matlabroot,"toolbox","vision","visiondata","vehicles");
addpath(imageDir);

data = load("vehicleTrainingGroundTruth.mat");
gTruthOriginal = data.vehicleTrainingGroundTruth;

Convert the ground truth object to JSON file in ASAM OpenLABEL format.

groundTruthToOpenLabel(gTruthOriginal,"vehicleGtruthOpenLABEL");

Convert JSON format file to a groundTruth object.

gTruth = groundTruthFromOpenLabel("vehicleGtruthOpenLABEL.json");

Inspect the data in the ground truth object.

imageLabeler(gTruth);

Input Arguments

collapse all

JSON file, specified by a character string. The file must contain ground truth stored in the ASAM OpenLabel format. For details regarding the JSON format, see ASAM OpenLABEL specification.

Output Arguments

collapse all

Ground truth object, returned as a groundTruth.

Version History

Introduced in R2024b