quaternion-based signal processingsep · the quaternion. two applications of hypercomplex image...

5
Quaternion-based Signal Processing Ben Witten* and Jeff Shragge, Stanford University SUMMARY Hypercomlex numbers are primarily used for pattern recognition, offer many useful applications to geophysics. Image disparity es- timation is a hypercomplex, phase-based technique, using quater- nions that can find differences between subtly varying images. This technique relies on applying a quaternionic Fourier transform, a quaternionic Gabor filter and exploits the symmetries inherent in the quaternion. Two applications of hypercomplex image dispar- ity estimation examined here are time lapse analysis and boundary detection. INTRODUCTION Hypercomplex numbers are multi-dimensional numbers that have more than one complex plane. The most common type of hyper- complex numbers have one real and three complex dimensions. These were introduced by Hamilton (1866) who termed them quater- nions. The most common application of quaternions has been to- wards Maxwell’s equations. Recently, however, quaternions have been applied to signal processing, most notably pattern recogni- tion. They are useful for color image analysis where previous tech- niques have failed because each complex quaternion axis can be associated with an RGB axis (Sanwine and Ell, 2000) which al- lows for color edge detection. In addition, they can be used for image segmentation, finding structure based not only upon color, but repeating patters. This has proven useful for finding defects in textiles (Bülow and Sommer, 2001). Another application is image disparity, which is used by Bülow (1999) to show how a pattern changes between two frames of a movie. Image disparity techniques offer many geophysical applications be- cause only organized structures and patterns are detected by image disparity. Thus, noise will have minimal effect. Since it is a phase based technique, even low amplitude signal still retain enough in- formation to be viable for image disparity estimation. The applica- tions that will be discussed here are time lapse analysis and edge detection. To this end we show the basics of hypercomplex math- ematics define the the quaternionic Fourier transform. We then de- fine the Gabor filter and extend it to the quaternionic case. This will allow for the image disparity estimation to be calculated based upon multiple complex phases. HYPERCOMPLEX MATHEMATICS The set of hypercomplex numbers is defined as q = q 0 + n X l =1 i l q l , q l ∈<. (1) Hypercomplex numbers define a n+1-dimensional complex space with i l orthonormal to i m , for l 6 = m. For all cases presented in this paper l will be limited to 3. Such numbers are quaternions, which can be represented as q = q 0 + iq 1 + jq 2 + kq 3 , where i , j , k are imaginary numbers that satisfying the following relations: ij =- ji = k, and i 2 = j 2 = k 2 =-1. (2) The multiplication table for quaternion unit vectors is shown in Table 1. With these definitions, quaternionic addition between two quaternions, q and p, can be defined as q + p = (q 0 + iq 1 + jq 2 + kq 3 ) + ( p 0 + ip 1 + jp 2 + kp 3 ) = (q 0 + p 0 ) + i (q 1 + p 1 ) + j (q 2 + p 2 ) + k(q 3 + p 3 ), (3) and multiplication as qp = (q 0 + iq 1 + jq 2 + kq 3 )( p 0 + ip 1 + jp 2 + kp 3 ) = (q 0 p 0 - q 1 p 1 - q 2 p 2 - q 3 p 3 ) + i (q 0 p 1 + q 1 p 0 + q 2 p 3 - q 3 p 2 ) + j (q 0 p 2 + q 2 p 0 - q 1 p 3 + q 3 p 1 ) + k(q 0 p 3 + q 3 p 0 + q 1 p 2 - q 2 p 1 ). (4) Table 1: The multiplication table for quaternion algebra. 1 i j k 1 1 i j k i i -1 k - j j j -k -1 i k k j -i -1 Notice that multiplication in equation 4 is not commutative due to the quaternionic algebra rules defined in table 1. Quaternions are often separated into two parts, q 0 and q = iq 1 + jq 2 + kq 3 , respec- tively called the scalar and vector part of the quaternion. Using this definition, the conjugate of q q , is ¯ q = q 0 - q = q 0 - iq 1 - jq 2 - kq 3 (5) and the norm of a quaternion is defined by || q ||= p q ¯ q = q q 0 2 + q 1 2 + q 2 2 + q 3 2 . (6) It is useful to formulate a polar representation of the quaternion, with phase and modulus. For any complex number, z = a + ib, the argument or phase-angle is defined as atan2(b, a). If z is written it the form z =| r | e i γ , then γ is the phase (argument) of z, de- noted arg(z)=γ . Quaternions contain three complex subfields and, correspondingly, three phases components which are: φ = atan2(n φ ,d φ ), (7) θ = atan2(n θ ,d θ ), (8) ψ = arcsin(n ψ ), (9) where n φ , d φ , n θ , d θ , n ψ come from the equivalence of two homo- morphic quaternion transformations and are defined as n φ = 2(q 2 * q 3 + q 0 * q 1 ), (10) d φ = (q 0 ) 2 - (q 1 ) 2 + (q 2 ) 2 - (q 3 ) 2 , (11) n θ = 2(q 1 * q 3 + q 0 * q 2 ), (12) d θ = (q 0 ) 2 + (q 1 ) 2 - (q 2 ) 2 - (q 3 ) 2 , (13) n ψ = 2(q 1 * q 2 + q 0 * q 3 ). (14) Quaternionic Transform Analogous to complex numbers, quaternions can be represented by a magnitude and three phases with q =|| q || e i φ e j θ e kψ . (15) 2862 SEG/New Orleans 2006 Annual Meeting

Upload: others

Post on 05-Jul-2020

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Quaternion-based signal processingsep · the quaternion. Two applications of hypercomplex image dispar-ity estimation examined here are time lapse analysis and boundary detection

Quaternion-based Signal ProcessingBen Witten* and Jeff Shragge, Stanford University

SUMMARYHypercomlex numbers are primarily used for pattern recognition,offer many useful applications to geophysics. Image disparity es-timation is a hypercomplex, phase-based technique, using quater-nions that can find differences between subtly varying images. Thistechnique relies on applying a quaternionic Fourier transform, aquaternionic Gabor filter and exploits the symmetries inherent inthe quaternion. Two applications of hypercomplex image dispar-ity estimation examined here are time lapse analysis and boundarydetection.INTRODUCTION

Hypercomplex numbers are multi-dimensional numbers that havemore than one complex plane. The most common type of hyper-complex numbers have one real and three complex dimensions.These were introduced by Hamilton (1866) who termed them quater-nions. The most common application of quaternions has been to-wards Maxwell’s equations. Recently, however, quaternions havebeen applied to signal processing, most notably pattern recogni-tion. They are useful for color image analysis where previous tech-niques have failed because each complex quaternion axis can beassociated with an RGB axis (Sanwine and Ell, 2000) which al-lows for color edge detection. In addition, they can be used forimage segmentation, finding structure based not only upon color,but repeating patters. This has proven useful for finding defects intextiles (Bülow and Sommer, 2001). Another application is imagedisparity, which is used by Bülow (1999) to show how a patternchanges between two frames of a movie.

Image disparity techniques offer many geophysical applications be-cause only organized structures and patterns are detected by imagedisparity. Thus, noise will have minimal effect. Since it is a phasebased technique, even low amplitude signal still retain enough in-formation to be viable for image disparity estimation. The applica-tions that will be discussed here are time lapse analysis and edgedetection. To this end we show the basics of hypercomplex math-ematics define the the quaternionic Fourier transform. We then de-fine the Gabor filter and extend it to the quaternionic case. Thiswill allow for the image disparity estimation to be calculated basedupon multiple complex phases.

HYPERCOMPLEX MATHEMATICS

The set of hypercomplex numbers is defined as

q = q0 +

n∑

l=1il ql , ql ∈ <. (1)

Hypercomplex numbers define a n+1-dimensional complex spacewith il orthonormal to im , for l 6= m. For all cases presented in thispaper l will be limited to 3. Such numbers are quaternions, whichcan be represented as q = q0 + iq1 + jq2 + kq3 , where i , j ,k areimaginary numbers that satisfying the following relations:

i j = − j i = k, and i2 = j2 = k2 = −1. (2)

The multiplication table for quaternion unit vectors is shown inTable 1. With these definitions, quaternionic addition between twoquaternions, q and p, can be defined as

q + p = (q0 + iq1 + jq2 + kq3)+ (p0 + ip1 + j p2 + kp3)= (q0 + p0)+ i(q1 + p1)+ j (q2 + p2)+ k(q3 + p3), (3)

and multiplication as

qp = (q0 + iq1 + jq2 + kq3)(p0 + ip1 + j p2 + kp3)= (q0 p0 −q1 p1 −q2 p2 −q3 p3)

+ i(q0 p1 +q1 p0 +q2 p3 −q3 p2)+ j (q0 p2 +q2 p0 −q1 p3 +q3 p1)+ k(q0 p3 +q3 p0 +q1 p2 −q2 p1). (4)

Table 1: The multiplication table for quaternion algebra.1 i j k

1 1 i j ki i −1 k − jj j −k −1 ik k j −i −1

Notice that multiplication in equation 4 is not commutative due tothe quaternionic algebra rules defined in table 1. Quaternions areoften separated into two parts, q0 and q = iq1 + jq2 +kq3 , respec-tively called the scalar and vector part of the quaternion. Using thisdefinition, the conjugate of q, q̄, is

q̄ = q0 −q = q0 − iq1 − jq2 − kq3 (5)

and the norm of a quaternion is defined by

|| q ||=√

qq̄ =

q02 +q12 +q22 +q32. (6)

It is useful to formulate a polar representation of the quaternion,with phase and modulus. For any complex number, z = a + ib, theargument or phase-angle is defined as atan2(b,a). If z is writtenit the form z =| r | eiγ , then γ is the phase (argument) of z, de-noted arg(z)=γ . Quaternions contain three complex subfields and,correspondingly, three phases components which are:

φ = atan2(nφ , dφ), (7)θ = atan2(nθ , dθ ), (8)ψ = arcsin(nψ ), (9)

where nφ ,dφ ,nθ ,dθ ,nψ come from the equivalence of two homo-morphic quaternion transformations and are defined as

nφ = 2(q2 ∗q3 +q0 ∗q1), (10)

dφ = (q0)2 − (q1)2 + (q2)2 − (q3)2, (11)nθ = 2(q1 ∗q3 +q0 ∗q2), (12)dθ = (q0)2 + (q1)2 − (q2)2 − (q3)2, (13)

nψ = 2(q1 ∗q2 +q0 ∗q3). (14)

Quaternionic TransformAnalogous to complex numbers, quaternions can be represented bya magnitude and three phases with

q =|| q || eiφe jθekψ . (15)

2862SEG/New Orleans 2006 Annual Meeting

Page 2: Quaternion-based signal processingsep · the quaternion. Two applications of hypercomplex image dispar-ity estimation examined here are time lapse analysis and boundary detection

Quaternion-based Signal Processing

ψ will be considered to be 0 since only 2-D images are discussedin this paper.

Ell (1992) introduced the quaternionic Fourier transform (QFT) fortwo-dimensional signals,

Fq (u) =

R2e−i2πux f (x)e− j2πvyd2x, (16)

where x = (x , y)T and u = (u,v)T ∈ R2 and f is a two-dimensionalquaternion signal. Because two-dimensional signals can be decom-posed into even and odd components along either the x- or y-axis,f can be written

f = fee + foe + feo + foo ,

with, for example, foe denoting the part of f that is odd with re-spect to x and even with respect to y. The QFT can now be decom-posed to

Fq (u) =

R2cos(2πux)cos(2πvy) f (x)d2x

−i∫

R2sin(2πux)cos(2πvy) f (x)d2x

− j∫

R2cos(2πux)sin(2πvy) f (x)d2x

+k∫

R2sin(2πux)sin(2πvy) f (x)d2x. (17)

The QFT is an invertible transform and most standard Fourier the-orems hold for QFTs with minimal variation. These theorems willnot be re-derived here, as complete proofs of the QFT extension ofRayleigh’s, the shift, the modulation, the derivative, and the convo-lution theorem exist elsewhere (Ell, 1992; Bülow, 1999).

QUATERNIONIC GABOR FILTERS

The three different types of signal phase, as described by Bülow(1999) are global, instantaneous, and local. Global phase is the an-gular phase of the complex Fourier transform of a signal. It givesa real-valued number for each point in the frequency domain thatis indicative of the relative position of the frequency components.Instead of giving the phase of a certain frequency component, in-stantaneous and local phase give the phase at a certain position ina real signal. The instantaneous and local phases, however, do thisin different ways. The instantaneous phase is the angular phase ofthe complex value at each signal position. The instantaneous phasehas the drawback that while it provides local information, that in-formation depends on the entire signal. This causes the instanta-neous phase at any point to be affected by changes at any otherpoint in the image, regardless of separation distance. To overcomethis problem, quadrature filters are employed. The local phase isdefined as angular phase of the quadrature filter response at a par-ticular position of the signal. In this paper, in order to obtain alocal quaternion phase, quaternionic Gabor filters are used. Whilequaternionic Gabor filters are not exact quaternionic quadrature fil-ters, they are a good approximation to them.

Gabor filters are linear time-invariant (LTI) filters that exhibit manyuseful properties, which have led to their use in a wide range ofsignal processing applications. The impulse response of a two-dimensional Gabor filter is

h(x , y;u0,v0,σ ,ε) = g(x , y;σ ,ε)ei2π (u0 x+v0 y) (18)

where g(x , y;σ ) is the Gaussian with aspect ratio ε,

g(x , y;σ ,ε) = e−x2+(εy)2

σ2 . (19)

Analogous to equation 18, a quaternionic Gabor filter is definedsuch that the impulse response to the filter is,

hq (x , y;u0,v0,σ ,ε) = g(x , y;σ ,ε)ei2πu0 x e j2πv0 y

= g(x , y;σ ,ε)eiω1 x e jω2 y (20)

where g(x , y;σ ,ε) is defined as in equation 19. The quaternionicGabor filter can be split into its even and odd symmetries, just asthe QFT and the original image. In that case the filter h can bewritten as

hq (x , y;u0,v0,σ ,ε) = (hqee + ihq

oe + jhqeo + khq

oo). (21)

Note that hqee , hq

oe , hqeo , and hq

oo are real-valued functions (see Fig-ure 1).

Figure 1: The hee , hoe , heo , and hoo symmetries of a quaternionicGabor filter

QUATERNIONIC DISPARITY ESTIMATION

Given two images, f1 and f2, it is possible to find a vector field,d(dx ,dy ), that relates the local displacement between f1 and f2(i.e. f1(x) = f2(x+d(x) ). Therefore, if the QFT of f1 is,

f1(x , y) =⇒ Fq (u,v), (22)

then by the shift theorem,

f2(x , y) = f1(x +dx , y +dy) =⇒ ei2πudx Fq (u,v)e j2πudy . (23)

Knowing that f1 and f2 have local quaternionic phases (φ1,θ1,ψ1)and (φ2,θ2,ψ2) and assuming that φ varies only in x and θ variesonly in y, then the displacement d(x) is given by

dx (x) =φ2(x)−φ1(x)

ure f(24)

dy (x) =θ2(x)− θ1(x)

vre f. (25)

The accuracy of the displacement depends strongly on the choice ofthe reference frequencies, ure f and vre f . The local model approachfor quaternions outlined by Bülow (1999) will be used. This modelassumes that the local phase at corresponding points of the two im-ages will not differ, �1(x ,y)=�2(x + dx ,y + dy ), where �=(φ,θ ).An estimate for d is obtained by a first-order Taylor expansion of� about x

�2(x+d) ≈�2(x)+ (d ·∇)�2(x). (26)

Solving for d in equation 26 gives the disparity estimate for thelocal model. The disparity is estimated using equation 24 and thereference frequencies given by,

ure f =∂φ1∂x

(x), vre f =∂θ1∂y

(y). (27)

2863SEG/New Orleans 2006 Annual Meeting

Page 3: Quaternion-based signal processingsep · the quaternion. Two applications of hypercomplex image dispar-ity estimation examined here are time lapse analysis and boundary detection

Quaternion-based Signal Processing

The local quaternionic phase components for anywhere in an imageare given by

φ(x) =atan2(nφ(x),dφ (x))

2, (28)

θ (x) =atan2(nθ (x),dθ (x))

2, (29)

where n and d are related to the rotation matrix of a quaternion andare,

nφ = −2(kqeo (x)kq

oo(x)+ kqee (x)kq

oe (x)), (30)

dφ = (kqee (x))2 − (kq

oe (x))2 + (kqeo(x))2 − (kq

oo(x))2, (31)nθ = −2(kq

oe (x)kqoo(x)+ kq

ee (x)kqeo (x)), (32)

dθ = (kqee (x))2 + (kq

oe (x))2 − (kqeo (x))2 − (kq

oo(x))2. (33)

The k-functions are the responses of a symmetric component ofthe quaternionic Gabor filter to the image (e.g. kee=(hee ∗ f )(x)).From equations 28 and 29 the derivatives of the local phase com-ponents are computed

∂xφ(x) =

dφ(x) ∂∂x nφ(x)−nφ (x) ∂

∂x dφ(x)n2φ

(x)+d2φ

(x), (34)

∂yθ (x) =

dθ (x) ∂∂y nθ (x)−nθ (x) ∂

∂y dθ (x)

n2θ (x)+d2

θ (x). (35)

Therefore, the disparity depends on the rate of change of the localphase as approximated by the quaternionic Gabor filters.

Figure 2 shows an instructive example with a shifted rectangularblock. The upper left panel is the original block position while theupper right panel shows the same block shifted down and to theright by four points. On the bottom, the disparity is shown as botha magnitude and vector plot of the shift.

APPLICATIONS

Time LapseOne application for this procedure is assessing the temporal varia-tion of time-lapse images. When seismic data are acquired in thesame location at different times, disparity estimation can be usedto visualize changes in the subsurface caused by compaction orfluid flow. This was done with three migrated images from theDuri Field in Indonesia that were collected over a 20 month period.The original images (Lumley, 1995) are shown in figure 3 with themagnitude of the disparity between the images. The magnitudeof the disparity offers very little information for this application.The vector representation, displayed in figure 4 with each vectorscaled by 2, however, better accentuates the change providing use-ful information. Although it is hard to distinguish by looking at themigrated images, there are subtle changes that can be seen. Theleft edge of the hump near the center of the image increases slopefrom the left panel of figure 3 to the right. This slight change isdetected by the image disparity algorithm and can be seen withdownward pointing arrows near that have been circled in figure 4,corresponding to the left slope of the hump. This may be relatedto the insertion of an observation well near that location. The ar-rows do distinguish changes throughout the image, but it is verydifficult to tell if these correspond to real changes, noise, or someslight variation caused by a change in acquisition. Figure 5 showsthe original slice (time 0) overlain with the vector change betweenit the final time.

Edge DetectionThis procedure can also be used as an automated edge detection

20 40 60 80100

20406080

10020 40 60 80100

20406080

100

20 40 60 80100

20406080

10020 40 60 80100

20406080

100

Figure 2: Top row: the input images. Bottom row: The disparity asa magnitude and a vector representation of disparity

20 40 60

100

200

300

400

500

60020 40 60

100

200

300

400

500

60020 40 60

100

200

300

400

500

600

Figure 3: Two images from the same location at Duri Field at dif-ferent times. Left:The magnitude of the change relative to the firstimage.

10 20 30 40 50 60 70

0

100

200

300

400

500

600

Figure 4: The disparity as a vector plot, sub-sampled by 2 in the xdirection and 12 in the y direction.

2864SEG/New Orleans 2006 Annual Meeting

Page 4: Quaternion-based signal processingsep · the quaternion. Two applications of hypercomplex image dispar-ity estimation examined here are time lapse analysis and boundary detection

Quaternion-based Signal Processing

Figure 5: The original image from Duri field with how the subsur-face changed overlaid on it.

20 40 60

100

200

300

400

500

60020 40 60

100

200

300

400

500

600

Figure 6: The original image and the boundaries found by imagedisparity with itself.

algorithm. This application can be accomplished by comparing asingle image with a slightly shifted version of itself. When thisis done the coherent structure is illuminated in the magnitude dis-play of the disparity. Figure 6 shows the boundaries that have beendetected using this algorithm for the first Duri image in figure 3.This method was also tested on a more complicated migrated dataset that contains steeply dipping reflectors, from Tang and Clapp(2006) (see figure 7). The leftmost image is a gained version of thecenter image. The edge detection, shown on the right, was donewith the ungained image (center panel). Notice that the bound-aries that are not visible were still detected because of the phase-based nature of the technique. It is encouraging that even thoughthis method fails to distinguish all of the layer boundaries that areclearly seen at the top of the original image. Although not demon-strated here, it is possible to shift only in the x-direction to highlightthe vertical edges or shift in the y-direction to accentuate the hori-zontal edges. The sum of these two shifts will yield the same resultas a single diagonal shift as done for these examples.

CONCLUSION

Hypercomplex methods in general, and quaternionic in particular,offer numerous and diverse possibilities for geophysical purposes.This method is easy to implement and efficient for time lapse anal-ysis and boundary detection. Although the edge detection applica-tion does a reasonable job, it has not been as effective for shallowfeatures as expected. The time lapse analysis offers an innovativeway to quantitatively evaluated changes over time. In future works,this technique my be extended to three dimensional problems or

200400600800100012001400

50

100

150

200

250

300

350

400200400600800100012001400

50

100

150

200

250

300

350

400200400600800100012001400

50

100

150

200

250

300

350

400

Figure 7: Edge detection example. Left: Original image. Center:The boundaries found from the original image using disparity esti-mation with itself. Right: A gained version of the original image.

applied to other applications such as velocity analysis.

REFERENCES

Bülow, T. and G. Sommer, 2001, Hypercomplex signals: A novelextension of the analytic signal to the multidimensional case:IEEE Transactions on Signal Processing, 49, 2844–2852.

Bülow, T., 1999, Hyercomplex spectral signal representations frothe processing and analysis of images: Inst. Comput. Sci. Appl.Math., Christian-Albrechts-Univ. Kiel, Kiel, Germany.

Ell, T., 1992, Hypercomplex spectral transformations: PhD thesis,Univ. Minnesota.

Hamilton, W., 1866, Elements of quaternions: Longmans Green,London.

Lumley, D., 1995, Seismic time-lapse monitoring of subsurfacefluid flow: PhD thesis, Stanford University.

Sanwine, S. and T. Ell, 2000, Colour image filters based on hyper-complex convolution: Colour image filters based on hypercom-plex convolution:, IEEE Proceedings- Vision, Image and SignalProcessing, 89–93.

Tang, Y. and R. G. Clapp, 2006, Lloyd’s algorithm for selecting ref-erence anisotropic parameters during wavefield extrapolation:76th Ann. Internat. Mtg., Soc. of Expl. Geophys.

2865SEG/New Orleans 2006 Annual Meeting

Page 5: Quaternion-based signal processingsep · the quaternion. Two applications of hypercomplex image dispar-ity estimation examined here are time lapse analysis and boundary detection

EDITED REFERENCESNote: This reference list is a copy-edited version of the reference list submitted by theauthor. Reference lists for the 2006 SEG Technical Program Expanded Abstracts havebeen copy edited so that references provided with the online metadata for each paper willachieve a high degree of linking to cited sources that appear on the Web.

REFERENCES Bülow, T., 1999, Hyercomplex spectral signal representations fro the processing and

analysis of images: Christian-Albrechts-Univ.Bülow, T., and G. Sommer, 2001, Hypercomplex signals: A novel extension of the

analytic signal to the multidimensional case: IEEE Transactions on Signal Processing, 49, 2844–2852.

Ell, T., 1992, Hypercomplex spectral transformations: Ph.D. thesis, University ofMinnesota.

Hamilton, W., 1866, Elements of quaternions: Longmans Green.Lumley, D., 1995, Seismic time-lapse monitoring of subsurface fluid flow: Ph.D. thesis,

Stanford University.Sanwine, S., and T. Ell, 2000, Colour image filters based on hypercomplex convolution:

Colour image filters based on hypercomplex convolution: IEEE Proceedings-Vision, Image and Signal Processing, 49, 89–93.

Tang, Y., and R. G. Clapp, 2006, Lloyd's algorithm for selecting reference anisotropic parameters during wavefield extrapolation: Presented at the 76th Annual International Meeting, SEG.

2866SEG/New Orleans 2006 Annual Meeting