For a given digital image f(x,y), the 2D raw moment is defined as:
mpq=M−1∑x=0N−1∑y=0xpyqf(x,y)
where p and q are real valued integers. Alternatively, we can also get the central moments by using the following relation:
μpq=M−1∑x=0N−1∑y=0(x−¯x)p(y−¯y)qf(x,y)
where
¯x=m10m00 ¯y=m01m00
From here, we can obtain the normalized central moments by solving for ηpq defined as
ηpq=μpqμγ00
for γ=p+q2+1 where p+q=2,3...
Using Hu's Uniqueness theorem which states that if f(x,y) is a continuous piecewise function and has nonzero values only on the finite part of xy-plane, all moments of different orders exists. It also follows that the moments mpq are uniquely determined from f(x,y), and conversely, we can obtain f(x,y) from the information in the moments mpq[2].
In Hu's paper published back in 1962, he enumerated a set of seven moments that are invariant to translation, scale change, mirroring (within a minus sign) and rotation. In this activity, the goal is to calculate for these moments using the following set of images:
1. Grayscale Image
2. Synthetic Edge Image (synthetically generated)
3. Edge Image of a real object
We generate each of these images, and their corresponding rescaled and rotated versions. In total, we should have 9 images. The moments of each of these images are to be computed and are then eventually compared to one another.
We start by showing the following set of images that I generated:
Figure 1. Synthetic images (a) original (b) rotated and (c) scaled down, which are generated for analysis of Hu's invariant moments.
Figure 2. Edges of a real image for (a) original (b) rotated and (scaled down). The image of Bingbong from the movie Inside Out is obtained from google images [3]
Figure 3. Gray images of a cup (a) original (b) rotated and (c) scaled. Image is taken from google images
After generating the images, I applied the program which computes for the corresponding normalized central moments (all seven of Hu's invariant moments, ϕ1, ϕ2, ϕ3, ϕ4, ϕ5, ϕ6, ϕ7)
I got the following results:
Table 1. Hu’s invariant moments for real image edge
Moments
|
Original
|
Rotated
|
Rescaled (0.5x)
|
ϕ1
|
2.8469
|
2.8465
|
2.8469
|
ϕ2
|
4.0568
|
4.0559
|
4.0568
|
ϕ3
|
4.9024
|
4.8953
|
4.9024
|
ϕ4
|
4.6394
|
4.6449
|
4.6394
|
ϕ5
|
9.3788
|
9.3821
|
9.3788
|
ϕ6
|
5.9112
|
5.929
|
5.9112
|
ϕ7
|
8.3275
|
8.0973
|
8.3275
|
Table 2. Hu’s invariant moments for grayscale
image
Moments
|
Original
|
Rotated
|
Rescaled (0.5x)
|
ϕ1
|
-6.8124
|
-6.8124
|
-6.8125
|
ϕ2
|
-21.6559
|
-21.6559
|
-21.6559
|
ϕ3
|
-26.54
|
-26.54
|
-26.54
|
ϕ4
|
-26.021
|
-26.021
|
-26.0213
|
ϕ5
|
-54.504
|
-54.504
|
-54.5046
|
ϕ6
|
-37.0249
|
-37.0249
|
-37.0252
|
ϕ7
|
-27.5753
|
-25.2761
|
-27.5758
|
Table 3. Hu’s invariant moments for synthetic image
Moments
|
Original
|
Rotated
|
Rescaled (0.5x)
|
ϕ1
|
2.1266
|
2.1196
|
2.1266
|
ϕ2
|
-11.698
|
-11.7406
|
-11.698
|
ϕ3
|
-7.8382
|
-7.8438
|
-7.8382
|
ϕ4
|
-7.7756
|
-7.6766
|
-7.7756
|
ϕ5
|
-17.3893
|
-16.7467
|
-17.3892
|
ϕ6
|
-16.1036
|
-14.7318
|
-16.1036
|
ϕ7
|
-8.8509
|
-6.5823
|
-8.8509
|
Another related independent basis set is presented by Flusser, Suk and Zitová [3]. In this work, they identified only 6 invariants and identified which of the 7 Hu's moments is actually dependent.
The following table shows the Flusser-Suk moment invariants for the synthetic edge image.
Table 4. Flusser -Suk moment invariants for synthetic edge image.
[1] Image moment. Wikipedia. Retrieved September 1 2015.
[2] M.-K. Hu. Visual pattern recognition by moment invariants, IRE Trans. on Information Theory, 8(2):179-187, 1962.
[3] J. Flusser, T. Suk, B. Zitová. Moment and Moment Invariants in Pattern Recognition. John Wiley and Sons, 2009.
Walang komento:
Mag-post ng isang Komento