필터 지우기
필터 지우기

Image Labeler - Pixel Label from binary mask

조회 수: 13 (최근 30일)
Turimo
Turimo 2022년 5월 24일
답변: Githin George 2023년 10월 10일
Hello,
I've done some image segmentation with cluestering algorithm and the color tresholder app.
Is it possible to import these mask (from the segmentation) into pixel Label in the image Labeler app?
Thank you to anyone answering.
Best regards,
Turimo

답변 (1개)

Githin George
Githin George 2023년 10월 10일
Hi Turimo,
I understand you have few image segmentations generated using clustering algorithm and the ‘Color Thresholder App’ and would like to import it as labels in the ‘Image Labeler App’. You could try the steps below to achieve the same.
  • Export the binary mask generated in ‘Color Thresholder App’ to MATLAB workspace and save it into an image.
imwrite(BW,'yourImageLabel.png')
  • Run the following script
dataSource = groundTruthDataSource({'sourceImg.jpg'});
ldc =labelDefinitionCreator();
addLabel(ldc,'LabelName',labelType.PixelLabel);
labelDefs = create(ldc);
dataFile = {'yourImageLabel.png'};
labelData = table(dataFile,'VariableNames',{'PixelLabelData'});
% groundTruth class is the supported object format to upload labels in image labeler app
gTruth = groundTruth(dataSource,labelDefs,labelData);
  • Open ‘Image Labeler App’. Click on Import->Labels->From Workspace. Select ‘gTruth’ from the table.
I hope this helps.

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by