问题描述
我有以下形状的骨架化图像:
我想从骨架中提取最大分支":
我知道也许我需要提取接合点并从该点(?)上划分线,但是我不知道如何做到这一点.
是否可以使用Python Scikit Image或OpenCV做到这一点?
我相信您可以使用OpenCV执行以下操作:
- 使用
-
在所有角落添加黑色像素
-
使用 findContours 获取图片中的所有分支.然后使用 arcLength 并获得最长的时间.
I have a skeletonized image in the following shape:
And I want to extract the "largest branch" from the skeleton:
I know that maybe I need to extract the junction point and divide de lines from that point(?), but I have no clue how to do that.
Is there any way to do that with Python Scikit Image or OpenCV?
解决方案I believe you can use OpenCV to do the following:
- Use HarrisCorner to detect all corners in the image. This will get you the shown three green points (I drew a whole circle to highlight the location).
Add a black pixel at all corners
Get all branches in the picture using findContours. Then check the length of each contour using arcLength and get the longest.
这篇关于Python图像-从图像骨架中找到最大的分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
-