Python图像-从图像骨架中找到最大的分支 [英] Python Image - Finding largest branch from image skeleton

查看:61
本文介绍了Python图像-从图像骨架中找到最大的分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下形状的骨架化图像:

我想从骨架中提取最大分支":

我知道也许我需要提取接合点并从该点(?)上划分线,但是我不知道如何做到这一点.

是否可以使用Python Scikit Image或OpenCV做到这一点?

解决方案

我相信您可以使用OpenCV执行以下操作:

  1. 使用

    1. 在所有角落添加黑色像素

    2. 使用 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:

    1. 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).

    1. Add a black pixel at all corners

    2. Get all branches in the picture using findContours. Then check the length of each contour using arcLength and get the longest.

    这篇关于Python图像-从图像骨架中找到最大的分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆