MATLAB Answers

Importing labeled ground truth data using Image Labeler

32 views (last 30 days)
Amin Assadzadeh
Amin Assadzadeh on 12 Oct 2019
Answered: Rajani Mishra on 15 Oct 2019
I have labeled some data using Image Labeler. However, when I load gTruth labels and try to use the objectDetectorTrainingData(gTruth), I get the following error:
Error using boxLabelDatastore (line 216) Incorrect bounding box format. Bounding box must be an M-by-4 numeric matrix, where M specifies the number of boxes in a row. The column in the training data table that contains the bounding boxes must be a cell array.
data= load('exportedLabels.mat');
[imds,bxds] = objectDetectorTrainingData(data.gTruth);
Image Labeler seems to store bounding boxes as struct instead of Mx4 matrices, I reckon this might be the issue. How can I load the gTruth obj the right way?
How can I get gTruth data in the following format?
Any help will be much appreciated.

  0 Comments

Sign in to comment.

Answers (1)

Rajani Mishra
Rajani Mishra on 15 Oct 2019
Hi,
You can export the labeled ground truth to a MAT-file or to a variable in the MATLAB workspace. In both the cases the labeled ground truth is stored as groundTruth object. The values in that object are stored as structures. You can access the fields by using the commands like:
gTruthInterval(1,:).Car{1}.Position
where gTruthInterval is the labeled data. You can access various fields of that object as well. Please refer to the following documentation for more information:
About groundTruth object:
Hope this helps!

  0 Comments

Sign in to comment.

Sign in to answer this question.