Python采用霍夫椭圆变换检测图片中的椭圆物体
1、打开IDLE软件,并且载入先关的函数库。import matplotlib.pyplot as pltfrom skimage import data,draw,color,transform,feature

3、在灰度图的基础上,进行边缘检测,代码如下。edges = feature.canny(image_gray, sigma=2.0, low_threshold=0.55, high_threshold=0.8)

5、获取我们的处理得到的椭圆。best = list(result[-1])yc, xc, a, b = [int(round(x)) for x in best[1:5]]orientation = best[5]

7、我们检测的结果如下。

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
阅读量:24
阅读量:24
阅读量:28
阅读量:53
阅读量:61