Fourfold Symmetry Detection in Digital Images Based

0 downloads 0 Views 572KB Size Report
Feb 11, 2015 - Dummit, D.S., Foote, R.M.: Abstract Algebra. John Wiley&Sons (2004). 11. Campello de Souza, R.M., de Oliveira, H.M. and Silva, D.: The Z ...
Fourfold Symmetry Detection in Digital Images Based on Finite Gaussian Fields Alexander Karkishchenko1 and Valeriy Mnukhin1 Southern Federal University, 105/42, Bolshaya Sadovaya, 344006, Rostov-na-Donu, Russia, [email protected] [email protected]

Abstract. This paper considers an algebraic method for symmetry anal-

ysis of digital images, based on the interpretation of such images as functions on "Gaussian elds". These are nite elds GF(p2 ) of special characteristics p = 4k+3, where k > 0 is an integer. It is shown that such elds may be considered as "nite complex planes" and some properties of such elds are studied. The concept of logarithm in Gaussian elds is introduced and used to dene a "log-polar"-representation of digital images. Next, an algorithm for 4-fold rotational symmetry detection in gray-level images is proposed.

Keywords: image analysis, fourfold symmetry, digital image, Gaussian numbers, nite elds, log-polar coordinates, polar representation

1 Introduction Symmetry is a central concept in many natural and man-made objects and plays a crucial role in visual perception, design and engineering. That is why symmetry detection and analysis is a fundamental task in such elds of computer science as machine vision, medical imaging, pattern classication and image database retrieval [1,2]. Numerous applications have successfully utilized symmetry for model reduction [3], segmentation [4], shape matching [1], etc. Discussing image symmetries, the crucial dierence between continuous and discrete cases must be taken into account. Indeed, a continuous object can be characterized by its symmetry group, which is invariant to rotation, scale and translation transformations. At the same time, for digital images we may talk only about some measure of symmetry, which depends on rotations and scaling. When developing algorithms for image analysis, it is quite common to proceed on the assumption of continuity of images. Then powerful tools of continuous mathematics, such as complex analysis and integral transforms, can be eciently used. However, its application to digital images often leads to systematic errors associated with the inability to adequately transfer some concepts of continuous mathematics to the discrete plane. As examples we can point to such concepts as rotation in the plane and the polar coordinate system. Being natural and elementary in the continuous case, they lose these qualities when one tries to dene

them accurately on a discrete plane. As a result, formal application of continuous methods to digital images could be complicated by systematic errors [5,6]. This raises the issue of the development of methods initially focused on discrete images and based on tools of algebra and number theory. One of such methods is considered in this paper. It is based on the interpretation of digital images as functions on "Gaussian elds". These are nite elds GF(p2 ) of special characteristics p = 4k + 3, where 0 ≤ k ∈ Z. We show that elements of such elds may be considered as "nite complex planes" and nonnegative functions on such elds may be considered as digital images of prime 'sizes' p = 7, 11, . . . , 71, . . . , 127, 257, ets. (Note that this is not a limitation since every image can be trivially extended to an appropriate size.) The signicance of such an approach is based on the fact that nite Gaussian elds inherit some properties of the continuous complex eld. In particular, we show that the concept of principal value complex logarithm can be transferred to Gaussian elds. As an immediate result, we derive "log-polar"-representation of digital images and use it for the symmetry analysis in the same fashion as for continuous images in [2,5,6,7] and for digital images in [12,15,16,17,18]. In this paper we consider the most simple case of fourfold rotational symmetry detection, which, nevertheless, has important practical applications.

2 Finite Fields of Gaussian Integers Let Z and C be the ring of integers and the complex eld respectively, let Zn = Z/nZ be a residue class ring modulo an integer n ≥ 2, and let GF(pm ) be a Galois eld with pm elements, where p is a prime and m > 0 is an integer. In number theory [9, Ch. 1.4] a Gaussian integer is a complex number z = a+bi ∈ C whose real and imaginary parts are both integers. Note that within the complex plane the Gaussian integers may be seen to constitute a square lattice. Gaussian integers, with ordinary addition and multiplication of complex numbers, form the subring Z[i] in the eld C. Unfortunately, lack of division in these rings signicantly restricts its applicability to image processing problems [14]. So it is natural to look for nite elds, whose properties would be in some respect similar to properties of C. Note, that if p = 4k + 3 is a prime, then the polynomial x2 + 1 is irreducible over Zp . As an immediate corollary, the next denition follows.

Denition 1. Let p ≥ 3 be a prime number such that p ≡ 3 (mod 4). Then the nite eld

def

C(p) == Zp [x]/(x2 + 1) ' GF(p2 )

will be called Gaussian eld. Elements of C(p) will be called discrete Gaussian numbers. Thus, Gaussian elds have p2 elements, where

p = 3, 7, 11, 19, 23, 31, 43, 47, 59, 67, 71, 79, 83, 103, . . . .

In particular, there are 87 elds C(p) for 3 ≤ p < 1000. Elements of Gaussian elds are of the form z = a + bi, where a, b ∈ Zp and i denotes the class of residues of x, so that i2 + 1 = 0. The multiplication and addition in C(p) is straightforward, just as notions of the conjugate to z number z ∗ = a − bi ∈ C(p) ∗ 2 2 and the norm N (z) p = zz = a + b ∈ Zp . (Note that in C(p) the concept of modulus |z| = N (z) is not dened.) It is easy to show that N (z1 z2 ) = N (z1 )N (z2 ) and N (z) = 0 ⇔ z = 0.

3 Polar Decompositions of Gaussian Fields Let us use the analogy between C and C(p) to represent elements of C(p) in an "exponential form". For this, let us recall the algebraic method of introducing log-polar coordinate system onto a continuous complex plane. Let C∗ be the multiplicative group of complex numbers and R = hR, +i be the additive group of reals. Note that the correspondence

0 6= z = reiθ = eln r+iθ ↔ (l, θ),

where l = ln r ∈ R and 0 ≤ θ < 2π ,

between non-zero complex numbers z and its log-polar coordinates (l, θ) may be considered as an isomorphism

C∗ ' R × (R/2πZ).

(1)

In fact, any direct product decomposition of C∗ produces a representation of complex numbers. Let us transfer the previous construction to C(p). For this, note that since C(p) is a nite eld, its multiplicative group C∗ (p) = C(p) r {0} is cyclic [10, p. 314] and is generated by a primitive element g . For example, it is easy to check that g = 2 + 7i and p = 1 + 19i are primitive in C∗ (71) and g = 1 + 5i is primitive for p = 251. We need the following elementary verifying result.

Lemma 1. For every p = 4k + 3, numbers m = (p − 1)/2 = 2k + 1 and n = 2(p + 1) = 8(k + 1) are relatively prime, gcd(m, n) = 1.

Note that mn = p2 − 1 = |C∗ (p)| and so for C∗ (p) there appears [10, p. 163] the following analogue of the decomposition (1).

Theorem 1. For every nite Gaussian eld C(p), its multiplicative group is

decomposed into direct product of cyclic groups of orders m = (p − 1)/2 and n = 2(p + 1), C∗ (p) = hgi ' Zm × Zn . (2) We will call (2) the polar decomposition of C(p). The polar decomposition can be used to transfer onto C(p) the concept of complex logarithm. For this, x any primitive element g and dene the mapping Exp g : Zm × Zn → C∗ (p) as follows:

Exp g (l, θ) = g nl+mθ = z ∈ C∗ (p),

where (l, θ) ∈ Zm × Zn .

(3)

Fig. 1. A discrete torus. Thus, Exp g is an isomorphism between the additive group of the ring Zm × Zn and the multiplicative group of the Gaussian eld C(p).

Denition 2. The mapping Exp g : Zm × Zn → C∗ (p) is called the modular

exponent to base g, and its inverse mapping Ln g : C∗ (p) → Zm × Zn is the modular logarithm to base g. Its domain Zm × Zn is called the polar domain. The "basic logarithmic identity " follows immediately:

Ln g (z1 z2 ) = Ln g (z1 ) + Ln g (z2 ) .

(4)

Note that Ln g (0) is not dened, and to evaluate (l, θ) = Ln g (z) for any z = g s ∈ C∗ (p) one just needs to solve the Diophantine equation nx + my = s and set (l, θ) = (x mod m , y mod n) ∈ Zm × Zn . (5)

Example 1. Let g = 1 + 2i ∈ C∗ (7) and z = g 2 = 4 + 4i. Then s = 2, m = 3, n = 8 and the equation 8x + 3y = 2 has the evident solution x = 1, y = −2. Hence, Ln g (4 + 4i) = (1 mod 3 , −2 mod 8) = (1, 6) ∈ Z3 × Z8 . Note that depending on g , either Ln g (i) = (0, n/4) or Ln g (i) = (0, 3n/4). We will consider the pair (l, θ) ∈ Zm × Zn as "log-polar coordinates" of the corresponding discrete Gaussian integer z . It is useful to consider Zm × Zn as a m × n-discrete torus, see Fig. 1.

4 Digital Images as Functions on Gaussian Fields Let C(p) be any Gaussian eld of a characteristic p = 4k+3 and let f (z) : C(p) → R be any real-valued function on C(p). Due to our geometric interpretation of Gaussian elds, we call f (z) a digital gray-level image of size p × p, or just p × p-image briey. Another way to describe images is based on polar decompositions of Gaussian elds. Namely, we may associate with a p×p-image f (z) an image ψ of size m×n.

For this, x any primitive element g ∈ C∗ (p) and dene a function ψ : Zm × Zn → R such that

ψ(Ln g (z)) = f (z),

0 6= z ∈ C∗ (p) .

(6)

Denition 3. The transform Pg [f ] = ψ will be called log-polar transform to base g of the image f , or just its polar transform P briey. The image ψ will be called the polar form of f .

Thus, the polar form of f may be considered as some arrangement of all its pixels except f (0, 0) in the form of a m × n-matrix, as it is shown in Fig. 2. Thus, the image f is "almost" recovered by its polar form ψ . In order to achieve full recoverability, let us formally agree to extend the polar domain by an extra element ∞, assuming that ψ(∞) = f (0, 0). Note that in such an extended polar domain Zm × Zn ∪ {∞} the polar transform P becomes invertible. The linearity of P is obvious. (Just as discrete torus is an intuitive interpretation of the polar domain, we may interpret the extended polar domain as a torus with a small sphere inside.) As the following statement shows, the transform P indeed can be regarded as a discrete analogue of the transition to the log-polar coordinate system.

Proposition 1. If Pg [f (z)] = ψ(l, θ), then P[f (wz)] = ψ(l − l0 , θ − θ0 )

(7)

where 0 6= w ∈ C(p) and Ln (w) = (l0 , θ0 ). We will apply the previous relation (7) to symmetry analysis. As is known, a continuous object is said to have r-fold rotational symmetry with respect to a point C if a rotation by an angle of 2π/r around C does not change the object. Unfortunately, this denition does not work for digital images because digital rotation is much more hard to dene (see, for example, [8, p. 377]). As a result, for digital images we may talk only about some measure of symmetry, which depends on rotations and scaling. The geometric interpretation of Gaussian elds immediately implies the following denition.

Denition 4. A digital image f is said to have fourfold central rotational symmetry if and only if f (iz) = f (z).

Let ψ = P[f ] be the polar form of a p × p-image f . We may consider ψ as an m × n-matrix, where n = 8(k + 1), m = 2k + 1 and k = (p − 3)/4 ∈ Z. Since n is multiple of 4, decompose ψ into four blocks ψt , t = 0, 1, 2, 3, of equal size m × n/4.

Proposition 2. An image f is fourfold central symmetric if and only if its polar form ψ can be decomposed into four equal blocks, ψ0 = ψ1 = ψ2 = ψ3 .

µ=1

µ = 0.8148

µ = 0.0343

Fig. 2. Images, their polar forms and measures of 4-symmetry. Proof. Since the polar transform is invertible, it follows from Denition 4, that f is fourfold symmetric if and only if P[f (ωz)] = P[f (z)] = ψ(l, θ). But it have been noted in Section 3 that Ln g (ω) = (0, ±n/4) for every primitive g ∈ C∗ (p). Hence, fourfold symmetry of f is equivalent to the condition ψ(l, θ ± n/4) = ψ(l, θ) for all

l ∈ Zm , θ ∈ Zn ,

or just ψ0 = ψ1 = ψ2 = ψ3 . Evidently, for real-world images one can expect only approximate equalities ψ0 ' ψ1 ' ψ2 ' ψ3 , so that the problem to choose an appropriate measure of symmetry µ(f ) for an image f arises. One of possible ways is the following. For any normalized polar form matrix ψ˜ = ψ/ max{ψ} of an image f we introduce ( ) ³ ´ ˜i − ψ˜j k k ψ µ(f ) = exp −αxβ , where x = max . (8) 0≤i