Computing Moments by Prefix Sums

  • Authors:
  • Feng Zhou;Peter Kornerup

  • Affiliations:
  • -;-

  • Venue:
  • Computing Moments by Prefix Sums
  • Year:
  • 1995

Quantified Score

Hi-index 0.00

Visualization

Abstract

Moments of images are widely used in pattern recognition, because in suitable form they can be made invariant to variations in translation, rotation and size. However the computation of discrete moments by their definition requires many multiplications which limits the speed of computation. In this paper we express the moments as a linear combination of higher order prefix sums, obtained by iterating the prefix sum computation on previous prefix sums, starting with the original function values. Thus the $p''$th moment $m_p=\sum^N_{x=1}x^pf(x)$ can be computed by $O(N{\cdot}p)$ additions followed by $p$ multiply-adds. The prefix summations can be realized in time $O(N)$ using $p+1$ simple adders, and in time $O(p{\cdot}{\log}N)$ using parallel prefix computation and $O(N)$ adders. The method of prefix sums can also be used in the computation of two-dimensional moments for any intensity function $f(x,y)$. Because the image size is usually much larger than the moment order $(p+q)$ for image moments, if the ratio of the time between two adjacent picture elements to the delay time of an adder is $\rho$, only $\lceil\frac{q+1}{\rho}{\rceil}+1$ or $\lceil\frac{p+1}{\rho}{\rceil}+1$ adders are required for the computation of moments $m_{pq}$ of the order $(p+q)$. Using a bit-serial addition method, it is sufficient with 13 full adders and some shift registers to realize 10 order 3 image moment computations ($m_{00}, m_{01},m_{10},m_{02},m_{20},m_{12},m_{21},m_{03},m_{30}$) for a 512*512 size image at the TV rate. In 1986 Hatamian published a computationally equivalent algorithm, based on a cascade of filters performing the summations. Our recursive derivation allows for explicit expressions and recursive equations for the coefficients used in the final moment calculation. Thus a number of alternative forms for the moment computation can be derived, based on different sets of prefix sums. This allows some simplifications in the implementation of moment computations.