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)

3 ビュー (過去 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!
  1 件のコメント
Ben
Ben 2023 年 10 月 27 日
Thank you so much Sanjana, this is a great answer and it works perfectly. Thanks for the additional links as well, you've been a great help
Ben

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by