Moment Types

see nth) - of a Probability Density Function

Moment Type

Invariant To

Function

Raw Moment (𝑀𝑖𝑗)

𝑀𝑖𝑗 = 𝛴π‘₯𝛴𝑦π‘₯𝑖𝑦𝑗Intensity(π‘₯,𝑦)

Central Moment (𝑒𝑖𝑗)

  • translation

𝑒𝑖𝑗 = 𝛴π‘₯𝛴𝑦(π‘₯ - 𝐢π‘₯)𝑖(𝑦 - 𝐢𝑦)𝑗Intensity(π‘₯,𝑦)

where 𝐢π‘₯ and 𝐢𝑦 are centroids:

  • 𝐢π‘₯ = 𝑀10/𝑀00 = 𝛴π‘₯𝛴𝑦π‘₯Β·Intensity(π‘₯,𝑦) / 𝛴x𝛴𝑦Intensity(π‘₯,𝑦)
  • 𝐢𝑦 = 𝑀01/𝑀00= 𝛴π‘₯𝛴𝑦𝑦·Intensity(π‘₯,𝑦) / 𝛴π‘₯𝛴𝑦Intensity(π‘₯,𝑦)

Normalized Central Moment (𝑛𝑖𝑗)

  • translation
  • scale
  • 𝑛𝑖𝑗 = [𝑒𝑖𝑗] / [𝑒00(𝑖+𝑗)/2+1]
  • 𝑛𝑖𝑗 = [𝛴π‘₯𝛴𝑦(π‘₯ - 𝐢π‘₯)𝑖(𝑦 - 𝐢𝑦)𝑗Intensity(π‘₯,𝑦)] / [𝛴π‘₯𝛴𝑦Intensity(π‘₯,𝑦)](𝑖+𝑗)/2+1

Hu Moments (β„Ž1, .., β„Ž7)

  • translation
  • scale
  • rotation
  • reflection
  • β„Ž1 = 𝑛20 + 𝑛02
  • β„Ž2 = (𝑛20 - 𝑛02)2 + 4𝑛112
  • β„Ž3 = (𝑛30 - 3𝑛12)2 + (3𝑛21 + 𝑛03)2
  • β„Ž4 = (𝑛30 - 𝑛12)2 + (𝑛21 + 𝑛03)2
  • β„Ž5 = (𝑛30 - 3𝑛12)(𝑛30 + 𝑛12)[(𝑛30 + 𝑛12)2 - 3(𝑛21 + 𝑛03)2] + (3𝑛21 - 𝑛03)(𝑛21 + 𝑛03)[3(𝑛30 + 𝑛12)2 - (𝑛21 + 𝑛03)2]
  • β„Ž6Β = (𝑛20 + 𝑛02)[(𝑛30 + 𝑛12)2 - (𝑛21 + 𝑛03)2] + 4𝑛11(𝑛30 + 𝑛12)(𝑛21 + 𝑛03)
  • β„Ž7 = (3𝑛21 - 𝑛03)(𝑛30 + 𝑛12)[(𝑛30 + 𝑛12)2 - 3(𝑛21 + 𝑛03)2] - (𝑛30 - 3𝑛12)(𝑛21 + 𝑛03)[3(𝑛30 + 𝑛12)2 - (𝑛21 + 𝑛03)2]

Hu Moments is a set of 7 numbers calculated using central moments that are invariant to image transformations. The first 6 moments have been proven to be invariant to translation, scale, rotation, and reflection. While the 7th moment’s sign changes for image reflection

Coding Moments With OpenCV