I just need to draw that line inside these objects. This line should aproximate these

2 次查看(过去 30 天)
- I delimited this image in 7 objects
-I don't know how should i determine these points to make that green line from the picture

回答(2 个)

Guillaume
Guillaume 2020-2-7
Maybe
skeleton = bwskel(imclose(yourimage, strel('diamond', 2)))
  3 个评论
Guillaume
Guillaume 2020-2-10
You can use
skeleton = bwmorph(imclose(BW, strel('diamond', 2)), 'skel', Inf);
To get similar (but not identical) results to bwskel. bwskel is an improved version and indeed you'll have to upgrade if you want to use it.

请先登录,再进行评论。


Image Analyst
Image Analyst 2020-2-7
Try
binaryImage = imfill(binaryImage, 'holes');
skelImage = bwmorph(binaryImage, 'skel', inf);
  4 个评论
adrian satmari
adrian satmari 2020-2-10
Thank you again!
I want to mesure this angles, beween the main spine and Y axe,
and for this I tried to aprox. these spines.
I tried with regionprops -> Orienation too, but I think is not helpful.
line - Copy.png
Guillaume
Guillaume 2020-2-10
Well, you really need to upgrade!
The bwskel I suggested has an optional input, MinBranchLength which would allow you to trim the skeleton to the main trunk. From then on, the 'Orientation' of regionprops would be a lot more accurate. Unfortunately, bwmorph doesn't have the same option.

请先登录,再进行评论。

Community Treasure Hunt

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

Start Hunting!

Translated by