Why do I get an all-black image result after exporting labels as a PNG file format from the Image Labeler App in MATLAB R2018b?

14 views (last 30 days)
I would like to see distinct masked areas in the generated PNG image files. However, when I export labels to a file using the Image Labeler App, I always end up with an all-black image. To export labels, I go to the menu option "Export Labels > To File" and then to the "PixelLabelData" folder, which is supposed to contain the labeled files. Why does this happen?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 18 Jan 2024
Edited: MathWorks Support Team on 29 Feb 2024
The image values in the PNG file are composed of 0, 1, and 2, which makes it difficult to distinguish the different areas; the image appears similar to what you would expect from executing the following command.
image = imread('XXX.png');
imshow(image);
To view the labeled image, execute any of the the following set of commands.
figure;
image = imread('XXX.png');
imagesc(image);
colorbar
%OR
figure; [i, m] = imread('XXX.png');
imshow(i,m)
%OR
figure; image = imread('XXX.png');
I = imadjust(image);
imshow(I); 
For more information, refer the documentation on how to use the saved file through the export functionality. Execute the following command in the command window of MATLAB R2018b to get the release specific documentation
web(fullfile(docroot, 'vision/ug/labeler-pixel-label-data-storage.html'))
Please follow the below link to search for the required information regarding the current release:

More Answers (0)

Categories

Find more on Image Processing and Computer Vision in Help Center and File Exchange

Products


Release

R2018b

Community Treasure Hunt

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

Start Hunting!