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

5 views (last 30 days)
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.

Accepted Answer

Image Analyst
Image Analyst on 1 Apr 2014
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 Comments
Image Analyst
Image Analyst on 1 Apr 2014
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.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!