How to extract a new/truncated Ground Truth Object based only on a subset of the original pixel labeled images (simply by image sequential number, not Type or Group)

1 次查看(过去 30 天)
We started pixel labeling 1000 images using the Image Labeler app, but ran out of resources after labeling only 500 images
So now our exported outputs include an exported Ground Truth object based nominally on 1000 images, but with pixel label data for only the first 500 images, and also a PixelLabelData exported folder based on data for just the first 500 images
We want to use a truncated Ground Truth object, and an associated truncated PixelLabelData folder, and a truncated image data folder (with only the first 500 images), for subsequent semantic segmentation work
How do we extract/export a new truncated Ground Truth object, and its associated truncated PixelLabelData folder, based only on the first 500 images?

采纳的回答

Sanjana
Sanjana 2023-10-27
Hi Ben,
I understand that you are trying to truncate the “GroundTruth” object and associated “PixelLabelData” folder so that they contain the information with respect to only the first 500 Images.
To achieve the above, you can truncate the “groundTruthDataSource” and the “LabelDefintions” objects in the groundTruth object obtained upon exporting labelled data from Image Labeler app.
Please refer to the following code to achieve the above,
%gTruth is the exported GroundTruth Object from the Image Labeler App
truncatedDataSource = groundTruthDataSource(gTruth.DataSource.Source(gTruth.DataSource(1:requiredNumberOfImages,:)));
truncatedLabelData = gTruth.LabelData(1:requiredNumberofImages,:);
truncatedgTruth = groundTruth(truncatedDataSource,gTruth.LabelDefinitions,truncatedLabelData)
Please refer to the following documentation for further information,
Hope this helps!

更多回答(0 个)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by