how do i fill in color (ex. red) specific branch in bw skeleton image

5 次查看(过去 30 天)
hey everybody, i've got this image:
as you could see this is skeleton image (1 pixel thick) with 3 branches i remove the node point so i could make calculations (such as length) on each branch separately. assuming i would like to change the color of one of the branches how do i do this (for example branch no. 3 - the long one)?
thanks in advance.

采纳的回答

Image Analyst
Image Analyst 2014-4-1
You need to label your image, say with bwlabel(). Then find out what label that branch is. Maybe you can call regionprops() and identify it by its length or centroid location, I don't know. But once you've identified it, you can use ind2rgb() with a colormap that identifies that label as red and turns the image into a true color RGB image.
  2 个评论
Image Analyst
Image Analyst 2014-4-1
You'd still have to indicate via a colormap which component gets which color, if you care about that, because label2rgb just applies a default color assignment to all branches unless you pass in a colormap of your own that specifies which branch gets which color.

请先登录,再进行评论。

更多回答(0 个)

Community Treasure Hunt

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

Start Hunting!

Translated by