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.
댓글 수: 0
채택된 답변
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
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!