label_regions

15 visualizzazioni (ultimi 30 giorni)
Nicholas Dwork
Nicholas Dwork il 15 Ott 2011
I would like a function that accepts a binary image and returns an image. The output image has the same dimensions as the input image, and the value of each pixel of the output image is an index describing what region that pixel belongs to. That is, each region in the input binary image is assigned a unique index, and that index is placed in the corresponding pixels of the output image.
Does such a function exist?
For those who are familiar with IDL, I'm looking for the Matlab equivalent of label_regions.

Risposte (1)

Image Analyst
Image Analyst il 15 Ott 2011
You can use bwlabel() http://www.mathworks.com/help/toolbox/images/ref/bwlabel.html in the Image Processing Toolbox. It's still there, but there is a more efficient version called bwconncomp() http://www.mathworks.com/help/toolbox/images/ref/bwconncomp.html in newer versions of the toolbox.

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by