• Nie Znaleziono Wyników

Spatial filtering application to image comparison

N/A
N/A
Protected

Academic year: 2021

Share "Spatial filtering application to image comparison"

Copied!
5
0
0

Pełen tekst

(1)

Optica Applicata. Vol X X I I . No. 3 - 4 . 1992

S p atial filtering application to im age com parison

K. Kołodziejczyk (member of BiOS), L. Wolf (member of SPIE)

Technical University of Łódź, Institute of Physics, ul. Wólczańska 219/223, 93 - 005 Łódź, Poland.

The Fourier-transforming properties of coherent imaging system and digital filtering system as well as their application in spatial filtering technique are well known and continuously developed. Most of these systems used in image comparison are only able to detect whether the images are identical or n o t They do not provide information about the localization of differences. We present a new spatial filtering method able to detect and indicate the places where any differences occur in compared images. This method may be adopted both in coherent imaging optical systems and digital imaging systems. The sensitivity of the method is limited only by image resolution and its dynamics. Several simulation examples are provided to demonstrate the possibilities of this technique.

1. Background

The main idea of spatial filtering is to find a Fraunhofer diffraction pattern of predefined object Assuming that the effect of Fraunhofer diffraction on the complex light amplitude is described by a Fourier transformation [1], we can calculate this by the following formula:

+ 00

= f i 9(x,y)exp[ - 2ni(xvx+ y v y)]dxdy = G(vx,vy) (1)

-00

where: g{x,y) - light amplitude distribution at the two dimensional object,

x, y — spatial coordinates in the object plane.

The connection between the reduced coordinates (v*, vy) named spatial frequen­

cies and the genuine coordinates (x/,y/) in the diffraction plane is:

v , = Xf/tf, v, = yf /Xf,

where: X — wavelength of the light,

/ — focal length of the lens used to produce the Fourier hologram. Next, we have to find the complex amplitude

G(v*. vr) = A (v„ Vj.) exp [(¡ÎP (v^ »,)], (2)

and the way of its implementation.

In computer calculations g(x, y) and Giv# vy) are spatially sampled Generally,

each sample of G(v„ vy) has a complex value. Assume that we calculate G(v„ vy) at

(2)

then

G(v„ vy) = I m G(mA v, n A v) <5 (vx—mA v, vy — nA v) (3) where S(x, y) is the two-dimensional unit impulse function [2]. There are several

methods of recording this Fourier transform hologram, to mention, as an example, the Lohmann or Lee method of computer generated holograms [3]. The amplitude factor Aty^Vy) can be realized either as a dot size or the dot grey-tone level on

photographic plate. The phase (p{vx, vy) can be realized by translation of these dots in

the plane of photographic plate. In the case of digital image processing, the amplitude factor and the phase are stored in computer memory.

2. Spatial filtering

The basic setup for optical realization of a Fourier transform is shown in Figure 1. A transparency with amplitude transmittance p(x,y) is located in the front focal

plane of the lens, where x, y are the spatial coordinates in that plane. When a plane

wave a with unit magnitude impinges on the transparency from the left hand side the P

Plane wave

(x.y) Leris Ftp x.y)]

1 * Fig. 1. Basic optical setup for Fourier transformation Fourier transform of p(x,y) is formed at the back focal plane of the lens. This Fourier

transform may be used as a filter in spatial filtering [4]. To perform the Fourier transform in the computer, we use the sampled version of p{x,y) and calculate its

discrete Fourier transform, which gives a sampled version of Piv^Vy). Input

glx.y) Lens 1 F [h (x,y )]Filter Lens 2 Outputg'(x.y)

Plane wave

- » ’’ f f '’ f

I

8

Figure 2 shows the setup for coherent optical spatial filtering. The input image

g(x, y) is represented by the amplitude transmittance in the transparency at the front

focal plane of the lens 1. The filter transparency has an amplitude transmittance

H(vx, Vy). The light distribution at the back focal plane of lens 2 is specified by

g'(x, y) = g(x, y)®h(x, y)

(4)

(3)

Spatial filtering application to image comparison 157

filtering in the computer, we use the sampled version of g(x,y\ h(x,y) and

subsequently calculate three discrete Fourier transforms Giv^v,), H(v^ vy) and g’{x,y) = P ( G x H ) .

Spatial filtering is applied in many areas, such as image enhancement, matched filtering and code translation [5], [6]. When the model object is represented by

h(x, y \ the above described setup may be used to find identical elements of compared

object and the model. But in many cases of image comparison, it is necessary to detect and show the places of difference occurrence.

3. Experimental method

The scheme measurement system is shown in Figure 3. The image is captured by a CCD camera, digitalized and stored in the computer memory. All digital image files have 128 x 128 pixels with 64 gray-scale levels. A fast Fourier transform (FFT) Cooley—Tukey algorithm is applied to the image file to obtain a Fourier transform also having 128 x 128 pixels, also stored in the computer.

Videoprinter

Fig. 3. Scheme system for image comparison

For the comparison of the two images, a total number of differences of spatial frequencies’ amplitudes is computed. When this number is different from zero, the compared images are not the same. To produce the difference image (DI) with marked out places where differences occurr, we propose to compute a Fourier transform of spatial frequencies’ difference spectrum. We define the amplitude of this difference spectrum as

image PC

A(vx,vy) = f °

** y 1 A1(vxtvy) - A 2(vxtvy) in other case. (5)

A t(v*»v,) and A2(vxtvy) are the amplitude factors of compared images of Fourier

transforms, and A^iy# vy) represent the amplitude of Fourier transform of the model

image. The result of the comparison is shown on the PC screen and can be printed on the Mitsubishi CP-100B videoprinter.

4. Experimental results

The comparison of the three rectangles, one undefective and two with defects, is made to evaluate the effectiveness of this system. The undefective rectangle is treated as the model image and the rectangles are located in different places of image plane. Each rectangle is compared with all the others. The table shows the results of the

(4)

T a b le . Rectangles comparison result (4- indicates that images are identical, — indicates that they are different) Rectangle R l R2 R3 Rl + — _ R2 — + — R3 — — +

comparison. A plus sign indicates that compared images are identical, while a minus sign indicates that they are different R1 represents an undefective rectangle, R2 and R3 represent defective ones. Figure 4 shows the compared rectangles, their Fourier transforms, and difference image before and after digital filtering (DI and DFDI, respectively). Places with maximum intensity of DI indicate the differences’ localiza­ tion. Other visible traces are caused by spatial frequencies corresponding to changed

** ; Í M f t f ň í ': . c . F f t iu j m V-f ■' !

1

1 i I , T i I J y \ i i < Ki jrK «*. r m r , m m . • i \ l · .* · 'J < ■ i f · - ·> ! .;'■:·/'· > : I ·'·"···>> ' r i / ::>·;< >; * '.J ' ' ' i

Fig. 4. Comparison of two different rectangles: a — rectangle R2 with defect in right bottom corner,

b

— EFT of R2, c — undefective rectangle Rl,

d

— F F T of R l, e — difference image, f — difference image after digital filtering

dimensions of defective rectangle. These traces can be removed by application of digital filtering. Figure 4b shows the D I after cutting of background at the level of 25% m a x im u m intensity. Rectangles R l and R2 are different by one pixel in right bottom comer, and the presented method of comparison d etect and localizes this difference. It shows that the method sensitivity is limited only by image resolution. In many applications, for example fingerprints comparison [7], such high sensitivity is undesirable. To decrease the sensitivity, a division factor is introduced, and all the differences of spatial frequencies’ amplitudes are divided by this factor before summing up. It permits fixing a tolerance interval within which the images are recognized as identical.

For checking the effectiveness of the method in the case of irregular objects, two mosaics with three-pixels difference are compared. Figure 5 shows the results of

(5)

Spatial filtering application to image comparison 159

Fig. S. Comparison of two different mosaics: a — mosaic M2 with three-pixels defect, b — FFT of M2, c — model mosaic M l, 4 — FFT of M l, e — difference image, f — difference image after digital filtering

this comparison. The place of difference occurrence is detected, located and clearly marked, even without digital filtering.

The method described may also be realized in coherent optical system. In this case a spatial filter must be performed as a negative binary Fourier hologram of image pattern.

5. Conclusions

We have demonstrated an experimental system which optically reads images, digitally stores them in a computer and compares them using modified spatial filtering and Fourier analysis method. The employment of Fourier transform to difference spectrum of spatial frequencies enables obtaining an image with places of differences clearly marked o u t This difference image may be improved using digital filtering. The sensitivity of the demonstrated system is limited only by image resolution and makes it possible to detect the differences of even one-pixeL References

[1] Nabil H. Farhat [Ed.], Advances in Holography, Marcel Dekker Inc., 1975, New York and Basel, V ol 1.

[2] Wai Hon Lee, Appl. O p t 9 (1970), 639. [3] Huano T. S , Ргос. ШЕЕ 59 (1971), 1335.

[4] Brown B. R , Lohmann A. W , AppL O p t 5 (1966), 967. [5] Man Mohan Son dh i, Ргос. ШЕЕ 60 (1972), 841 [6] Javidi B , Ruiz G , Ruiz J , Proc. SPIE 1211 (1990), 313.

[7] Fielding K. H„ Horner J. L , Kakekau C. IL, O p t Eng. 30 (1991), 1958.

Cytaty

Powiązane dokumenty

[r]

Obiekty znajdujące się na Szlaku Architektury Przemysłowej Łodzi wskazane przez respondentów.. Najczęściej wskazywanym przez respondentów obiektem znajdującym się na

Abstract: The purpose of the research is to analyze the motivation and expectations of students from Ukraine with respect to higher education (HE) in the field of

Ile gąsiorów potrzeba do pokrycia krawędzi połaci dachowych na dachu przedstawionym na rysunku, jeżeli długość każdego z 4 grzbietów wynosi 4 m, a zużycie

pewno, że faktem jest, iż na gruncie nauk o sporcie nie powstała dotąd (w sensie metodolo- gicznym) – w przeciwieństwie do innych wzmiankowanych dyscyplin szczegółowych –

Odwrotna sytuacja wystąpiła wśród chłopców i dziewcząt z klasy V, gdyż wszyscy uczniowie uczęszczający do szkoły na wsi używają poprawnej repliki Bóg zapłać (20 osób),

Автор утверждает, что отрыв от коллектива является самой большой потерей для гомососа, объясняя это тем, что вовлеченность в жизнь

Modelwetten van ïVoude