label_regions

15 ビュー (過去 30 日間)
Nicholas Dwork
Nicholas Dwork 2011 年 10 月 15 日
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.

回答 (1 件)

Image Analyst
Image Analyst 2011 年 10 月 15 日
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.

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by