当前位置: 首页>>代码示例 >>用法及示例精选 >>正文


Python skimage.transform.hough_ellipse用法及代码示例


用法:

skimage.transform.hough_ellipse(image, threshold=4, accuracy=1, min_size=4, max_size=None)

执行椭圆霍夫变换。

参数

image(M, N) ndarray

具有表示边的非零值的输入图像。

thresholdint 可选

累加器阈值。

accuracy双,可选

累加器中使用的短轴上的 bin 大小。

min_sizeint 可选

最小长轴长度。

max_sizeint 可选

最大短轴长度。如果为 None,则该值设置为较小图像尺寸的一半。

返回

result具有字段 [(accumulator, yc, xc, a, b,orientation)] 的 ndarray。

在哪里(yc, xc)是中心,(a, b)分别是长轴和短轴。这方向值跟随skimage.draw.ellipse_perimeter惯例。

注意

必须选择精度以在累加器分布中产生峰值。换句话说,具有低值的平坦累加器分布可能是由太低的 bin 大小引起的。

参考

1

Xie, Yonghong, and Qiang Ji. “A new efficient ellipse detection method.” Pattern Recognition, 2002. Proceedings. 16th International Conference on. Vol. 2. IEEE, 2002

例子

>>> from skimage.transform import hough_ellipse
>>> from skimage.draw import ellipse_perimeter
>>> img = np.zeros((25, 25), dtype=np.uint8)
>>> rr, cc = ellipse_perimeter(10, 10, 6, 8)
>>> img[cc, rr] = 1
>>> result = hough_ellipse(img, threshold=8)
>>> result.tolist()
[(10, 10.0, 10.0, 8.0, 6.0, 0.0)]

相关用法


注:本文由纯净天空筛选整理自scikit-image.org大神的英文原创作品 skimage.transform.hough_ellipse。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。