Saving labels as an image file

3 views (last 30 days)
Jocelyn
Jocelyn on 11 Jun 2013
Hello,
I have segmented an image and created a matrix which gives each segmented object a unique label (similar to the matrix resulting from 'bwlabel' but many of the objects touch). I would like to save the label matrix so that I can later read it back in for further processing.
I have tried saving the matrix using 'imwrite', however the result is a binary image with all labels set to 255 rather than a grayscale leaving each with a unique identifier. I have tried saving it as a jpg, tif, and bmp, all of which give me the same results. When I use the 'label2rgb' function, the individual objects save just fine, but then I can't turn the image back into labels easily.
Thank you!
Jocelyn

Answers (0)

Categories

Find more on Convert Image Type in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!