Effacer les filtres
Effacer les filtres

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

2 vues (au cours des 30 derniers jours)
daniel
daniel le 1 Avr 2014
Commenté : Image Analyst le 1 Avr 2014
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.

Réponse acceptée

Image Analyst
Image Analyst le 1 Avr 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 commentaires
Sean de Wolski
Sean de Wolski le 1 Avr 2014
label2rgb(bwlabel(skel))
Image Analyst
Image Analyst le 1 Avr 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.

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by