當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


Python skimage.measure.moments_hu用法及代碼示例

用法:

skimage.measure.moments_hu(nu)

計算胡的圖像矩集(2D-only)。

請注意,這組矩被證明是平移、縮放和旋轉不變的。

參數

nu(M, M) 數組

歸一化中心圖像矩,其中 M 必須 >= 4。

返回

nu(7,) 數組

胡的一組形象瞬間。

參考

1

M. K. Hu, “Visual Pattern Recognition by Moment Invariants”, IRE Trans. Info. Theory, vol. IT-8, pp. 179-187, 1962

2

Wilhelm Burger, Mark Burge. Principles of Digital Image Processing: Core Algorithms. Springer-Verlag, London, 2009.

3

B. Jähne. Digital Image Processing. Springer-Verlag, Berlin-Heidelberg, 6. edition, 2005.

4

T. H. Reiss. Recognizing Planar Objects Using Invariant Image Features, from Lecture notes in computer science, p. 676. Springer, Berlin, 1993.

5

https://en.wikipedia.org/wiki/Image_moment

例子

>>> image = np.zeros((20, 20), dtype=np.double)
>>> image[13:17, 13:17] = 0.5
>>> image[10:12, 10:12] = 1
>>> mu = moments_central(image)
>>> nu = moments_normalized(mu)
>>> moments_hu(nu)
array([7.45370370e-01, 3.51165981e-01, 1.04049179e-01, 4.06442107e-02,
       2.64312299e-03, 2.40854582e-02, 4.33680869e-19])

相關用法


注:本文由純淨天空篩選整理自scikit-image.org大神的英文原創作品 skimage.measure.moments_hu。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。