Focus measure for speckle noisy images based on ... - CiteSeerX

0 downloads 0 Views 346KB Size Report
Lensless camera y. Figure 1. A hologram reconstruction system. The quality of the reconstructed images is dependent on various factors. Much work has beenĀ ...
Focus measure for speckle noisy images based on wavelet multiresolution analysis R. Yu, A. R. Allen and J. Watson Department of Engineering, University of Aberdeen, Aberdeen AB24 3UE, UK

ABSTRACT

Focusing is an important problem in computer vision. In general, edge sharpness is used as a focus measure. For images with speckle noise, it is dicult to extract reliable edge sharpness information. We solve this problem by using wavelet multiresolution analysis. A quadratic spline wavelet base is used for decomposing the images: as the scale of the decomposition increases, the modulus of speckle noise decreases and the edge sharpness is retained. We take the energy of the modulus of the decomposed image as a focus measure, and test it no images taken from the reconstruction of laser holograms. The results show that it is a feasible method for autofocusing. Keywords: Focus measure, Wavelet multiresolution analysis, Speckle noise

1. INTRODUCTION

The problem of focusing occurs in many image capture systems. In order to obtain a well focused image, one often has to continuously adjust the camera parameters, for instance, camera position, aperture of the camera or lens. Using a computer to process the images, it is useful to derive a measure which quanti es how well focused the images are. This measure will help in adjusting the camera parameters so that a clear image can be obtained. A good focusing technique uses a focus measure which is monotonic and has only one maximum where the image is best focused. Many focusing techniques have been investigated and proposed for achieving these goals.1{4 These techniques are generally based on the observations: (1) the well focused images appear to have good edge sharpness and (2) they contain more information. The criteria of the focusing measure are therefore chosen by the edge gradient or the signal power from the frequency contents. For use as a focus measure, edge gradients are normally calculated by the Sobel edge operator or the di erences between the grey levels of adjacent pixels.1,2 The criterion function is chosen as the sum of thresholded edge gradients. These methods are used for autofocusing in microscopy.2,3,5 Based on the second observation, Ref. 4 proposed three focusing measures which are calculated by the image energy, image gradient energy and the energy of Laplacian of the image, see (1), (2) and (3). They proved that these three measures are theoretically sound.

Z1Z1j ( ?1 ?1 Z 1Z1 ()= jr ( ?1 ?1 Z 1Z1 ()= jr (

fi x; y )j2 dxdy

M1 (i) = M2 i M3 i

?1 ?1

(1)

fi x; y )j2 dxdy

(2)

fi x; y )j2 dxdy

(3)

2

where fi (x; y) is the image, r and r2 are the gradient and Laplacian operator, respectively. In general, measure (2) works well. This is not surprising because focused images have good edge sharpness and thus have large edge gradients. In practice, images are often contaminated by various types of noise. The edge gradient algorithms will cause problems, such that there will be local maxima on the focus measure, since these algorithms amplify the high frequency part of the signal and noise normally also appears as high frequencies. Ref. 4 suggests that before carrying out the focusing measure calculation, the image should be ltered using a Gaussian Other author information R.Y.(correspondence): Email: [email protected]; A.R.A.: Email: [email protected]; J.W.: Email: [email protected]

1

low-pass lter. They proved that the focus criteria are still theoretically sound under these conditions. More directly, Ref. 6 pointed out that the focus criterion should take the signal power of the middle frequencies into account. They concluded that a band-pass lter should be used to preprocess the images before carrying out the focus measurement. This conclusion is consistent with the images being preprocessed by a Gaussian low-pass lter and then carrying out the focus measure of Ref. 4's M2 (i). From a signal analysis point of view, the images are mixed with noise of di erent frequency contents. The focus measure should use certain frequency bands which represent the edge sharpness. To pick out these particular frequencies is the key issue of these focusing techniques. This paper presents the use of wavelet multiscale analysis in the focus measurement of speckle noisy images.

2. Focusing in hologram imaging

A three-dimensional structure can be recorded by holography and then be reconstructed in a laboratory. Using a TV camera and an image digitizing device, this reconstructed image can be captured and digitized in a computer. Fig. 1 shows an o -axis hologram reconstruction system. In order to detect the real size of the object from the hologram reconstruction, one usually does not use a lens, instead the camera image detector is used to directly view the reconstructed object. Moving the camera along the z direction as in Fig. 1, one can obtain a well focused image. The focusing problem is to nd the camera position where the best focused image is obtained.

Laser source PC Hologram plate

Collimating lens

Image grabber z y

Spatial filter Lensless camera

Figure 1. A hologram reconstruction system. The quality of the reconstructed images is dependent on various factors. Much work has been done to obtain precision replay of holograms.7,8 However, the images taken from the reconstruction of a laser hologram normally contain speckle noise due to the coherent laser light source used. The coherent light scattered from a rough surface or non-uniform transmission medium will cause interference. This interference pattern manifests itself as speckle noise. Speckle noise is random noise with a negative exponent distribution.9 It has been identi ed as a multiplicative noise expressed as: f (x; y ) = g (x; y )v (x; y ) (4) where g(x; y) is the signal and v(x; y) is the noise. The speckle size  is proportional to the wavelength of the coherent light source,10 i.e.,  = F (1 + M ), where  is the wavelength of the coherent light, F the lens F number and M the magni cation of the optical system. Compared with typical sizes of image features, the speckle size is relatively small because  is in nm range, so we normally see the speckle as some random dark and bright spots in the images. 2

From (4), we can see that the noise v(x; y) is ampli ed by g(x; y) times. This e ect is more serious in the very bright or high intensity areas of the image. Focus measures (1), (2) and (3) will not work well since the speckle noise is in the high frequency band. Preprocessing is needed before carrying out the focus measure: the aim of the preprocessing is to reduce speckle noise and keep edge sharpness information. This is implemented by using wavelet multiscale decomposition analysis.

3. Wavelet analysis

Z

The Wavelet Transform is the convolution of a signal with a dilated and translated wavelet base function,11 expressed as: 1 f (x) a;b (x)dx W f (a; b) = (5) ?1

( x?a b )

where f (x) is the signal, a;b (x) = the wavelet base function, a the dilation and b the translation. A signal can be transformed into multiscale decompositions through the dilation a. On each decomposition, the features of the signal are well localized through the translation b. Properly choosing the wavelet base function, we can detect the signal features in its decompositions and carry out multiscale analysis. For instance, Ref. 12,13 use a specially designed wavelet base function which is much like an edge detector to analyze multiscale edges and signal singularity features. As mentioned in section 2, the images taken from the replay of a hologram contain both the useful signal and speckle noise. It is not straightforward to measure the focus level from these images by simply using the focus measure (1), (2) or (3). To perform multiscale edge analysis, Ref. 12 proposed a wavelet base function as a derivative of a scaling function, i.e., (x) = ddx(x) , where (x) is a scaling function. Furthermore, if the scaling function is a Gaussian, the wavelet transform is then equivalent to the multiscale Canny edge detector.14 Using this approach, the 2-dimensional dyadic wavelet base function can be written as j y x (x; y ) = @2j (x; y ) ; (6) (x; y) = @2 (x; y) 2j

where the subscript

2j

@x

2j

@y

is the dilation. The wavelet transform of an image f (x; y) is then given as @ @2j )(x; y) = 2j @x (f  2j )(x; y) @x @ @ j W2yj f (x; y ) = f  (2j 2 )(x; y ) = 2j (f  2j )(x; y ) @y @y

W2xj f (x; y ) = f  (2j

(7)

(8) where  denotes the convolution operator. The edge can be detected by calculating the modulus of the wavelet coecients expressed as M2j f (x; y ) = jW2xj f (x; y )j2 + jW2yj f (x; y )j2 (9)

q

We take the energy of the modulus of the wavelet coecients as the focus measure. Its discrete form can be expressed as: 1 jM2j f (x; y)j2 (10) MWj = NM

XX y

x

where N and M are the numbers of the image row and column, respectively. This is equivalent to (2), since the modulus of the wavelet coecients M2j f (x; y) represents the modulus of the edge gradient operator. Based on the theorems in Ref. 4, the focus measure (10) is monotonic, and theoretically sound. As the scaling factor 2j increases, we obtain a multiscale focus measure of the image f (x; y). Ref. 12 shows that if the uniform Lipschitz regularity of the signal is equal to or greater than zero, i.e., the signal is di erentiable or discontinuous but bounded(such as a step edge), the amplitude of the modulus maxima (9) should increase when the scaling factor 2j increases, and if the uniform Lipschitz regularity is less than zero, such as a Dirac, the modulus maxima should decrease when the scaling factor increases. These properties are important for the processing of speckle noisy images because any individual random speckle can be approximated as a Dirac, as mentioned in section 2. To speed up the reduction of the modulus of the speckle noise, an orthonormal wavelet base with 4 vanishing moment has been tested. We will show some results in the next section. 3

4. Results

The reconstruction of the laser holograms is shown in Fig. 1. We use a Hitachi KPM3EK CCD camera without a lens in order to detect the real size of the object. The video signal goes to a Matrox meteor image capture board in a Viglen Pentium 90 computer. The PC is running under the Linux operating system. The camera position is controlled along the z direction. For each position of the camera, we grab an image into the computer and use the algorithm mentioned in the last section to get the focus measure. The wavelet transform used for the multiresolution decomposition is performed by the WAVE2 package provided by WL Hwang, S Mallet and S Zhong at NYU (This software package can be obtained with anonymous ftp://cs.nyu.edu/pub/wave). The dyadic wavelet transform12 is used for decomposing the images. The scaling function (x) is a cubic spline and the wavelet function (x) is a quadratic spline with compact support and one vanishing moment. The coecients of the corresponding smooth lter H and detailed lter G are given as12 : H : [0:125; 0:375; 0:375; 0:125]; G : [?2; 2]

(11)

Fig. 2 shows the scaling and wavelet functions drawn using the iterated ltering algorithm.15 0.8

3 scaling function

0.7

wavelet 2

0.6 1

0.5 0.4

0

0.3

-1

0.2 -2

0.1 0

-3 0

10

20

30

40

50

60

70

0

(a)

10

20

30

40

50

60

70

(b)

Figure 2. The graph of Mallat and Zhong's scaling function and wavelet.

Figure 3. Part of Newport RES-2 resolution target image and the modulus of wavelet decompositions. Fig. 3 shows the results of the Newport RES-2 resolution target hologram image. The left image in Fig. 3 is the raw image. The others from left to right show the modulus of the wavelet transform at decompositions from level 1 to level 4. We can see clearly that the modulus of the edges becomes stronger and the noise decreases as the decomposition level increases. Fig. 4 shows the focus measure results for the di erent decomposition levels. The step size of the camera movement is 100 m. Fig. 4(a) is the focus measure using algorithm (2). Fig. 4(b)-(e) are the results of di erent decomposition levels. The horizontal axis is the camera position and the vertical is the normalized focus measure results. Due to the speckle noise, we can not get a good focus measure from decomposition level 1. 4

As the decomposition level increases, the modulus of speckle noise decreases and the edge sharpness is retained. We obtained a good focus measure at level 3 as shown in Fig. 4(d). Fig. 5 shows the images of a crack on a mechanical part. Fig. 6 is the results of the focus measure(with 40 m step size). The results show that we obtained a good focus measure at decomposition level 2. Focus measure of M2 1.1 1 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0

5

10 15 Camera position

20

(a) Focus measure at scale 2

Focus measure at scale 4

1.1 1 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2

Focus measure at scale 8

1.1 1 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0

5

10 15 Camera position

(b)

20

Focus measure at scale 16

1.1 1 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0

5

10 15 Camera position

20

1.1 1 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0

(c)

5

10 15 Camera position

20

0

(d)

5

10 15 Camera position

20

(e)

Figure 4.

(a) Focus measure results using algorithm 2; (b)-(e) Focus measure results using modulus images of wavelet decomposition at scales from 21 to 24 . (Quadratic spline wavelet)

Figure 5. Part of crack image and the modulus of wavelet decompositions. In order to Compare with the quadratic spline wavelet base, we also used an orthonormal spline wavelet base with 4 vanishing moments. Fig. 7 shows the shape of the scaling and wavelet functions. The wavelet function is di erent from the quadratic spline although the scaling function is the same. The focus measure results of the same images used for Fig. 4 are shown in Fig. 8. From the results, we can see that although the orthonormal wavelet base has higher order vanishing moments, it is no better at retaining the edge sharpness than the quadratic spline wavelet base. 5

Focus measure at scale 2

Focus measure at scale 4

1.1

Focus measure at scale 8

1.1

Focus measure at scale 16

1.1

1.1

1

1

1

1

0.9

0.9

0.9

0.9

0.8

0.8

0.8

0.8

0.7

0.7

0.7

0.7

0.6

0.6

0.6

0.6

0.5

0.5

0.5

0

5

10 15 Camera position

20

0

5

(a)

10 15 Camera position

20

0.5 0

5

10 15 Camera position

(b)

20

0

5

(c)

10 15 Camera position

(d)

Figure 6. Focus measure results using modulus images of wavelet decomposition at scales from 2 0.8

20

1

to 24 .

0.8 scaling function

0.7

wavelet

0.6

0.6

0.4

0.5

0.2

0.4

0

0.3

-0.2

0.2

-0.4

0.1

-0.6

0

-0.8 0

10

20

30

40

50

60

70

0

10

20

30

(a)

40

50

60

70

(b)

Figure 7. The orthonormal spline wavelet base function. Focus measure at scale 2

Focus measure at scale 4

1.1 1 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2

Focus measure at scale 8

1.1 1 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0

5

10 15 Camera position

(a)

20

Focus measure at scale 16

1.1 1 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0

5

10 15 Camera position

20

1.1 1 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0

(b)

5

10 15 Camera position

20

0

5

(c)

Figure 8. Focus measure results using modulus images of wavelet decomposition at scales from 2 mal spline wavelet)

5. Conclusions

10 15 Camera position

20

(d) 1

to 24 . (Orthonor-

Focusing is an important issue in hologram imaging. In general, edge sharpness is considered as a measure of focus. Due to speckle noise, it is hard to get a reliable focus measure. We used wavelet multiresolution analysis of speckle noisy images to obtain the focus measure. The images were decomposed up to level 4. Since speckle noise is approximated as a narrow impulse, the modulus of the noise decreases as the decomposition level increases, whereas 6

the modulus of the edges is still retained. The modulus of the edge is proportional to the edge sharpness. We calculate the energy of the modulus of the edges as the focus measure. The results show that a good focus measure can be obtained at certain decomposition levels of the wavelet transform, dependent on the noise level. The wavelet transform works here as a multiband lter and at the same time as an edge detector. Our approach can be used as the basis for an autofocusing technique.

REFERENCES

1. F.C.A.Groen, I.Y.Young, and G.Ligthart, \A comparison of di erent focus functions for use in autofocus algorithms," Cytometry 6, pp. 81{91, 1985. 2. E.Krotkov, \Focusing," Int. J. Computer Vision 1, pp. 223{227, 1987. 3. L.Firestone, K.Cook, K.Culp, N.Talsania, and Jr.K.Preston, \Comparison of autofocus methods for automated microscopy," Cytometry 12, pp. 195{206, 1991. 4. M.Subbarao, T.Chio, and A.Nikzad, \Focusing techniques," Optical Engineering 32(11), pp. 2824{2836, 1993. 5. T.T.E.Yeo, S.H.Ong, Jayasooriah, and R.Sinniah, \Autofocusing for tissue microscopy," Image and Vision Computing 11(10), pp. 629{639, 1993. 6. F.R.Boddeke, L. Vliet, H.Netten, and I.T.Young, \Autofocusing in microscopy based on the otf and sampling," BioImaging 2, pp. 193{203, 1994. 7. J.M.Kilpatrick and J.Watson, \Precision replay of underwater holograms," Meas. Sci. Technol 5, pp. 716{725, 1994. 8. J.M.Kilpatrick and J.Watson, \Underwater hologrammetry: reduction of aberrations by index compensation," J. Phys. D: Appl. Phys. 26, pp. 177{182, 1992. 9. J.W.Goodman, \Statistical properties of laser speckle patterns," in Maximum Entropy and Bayesian Methods, J.C.Dainty, ed., pp. 9{75, Springer-Verlag, Berlin, 1975. 10. K.J.Gasvik, \Optical techniques," in Interferogram Analysis: Digital Fringe Pattern Measurement Techniques, D.W.Robinson and G.T.Reid, eds., pp. 58{61, IOP Publishing Ltd, 1993. 11. I.Daubechies, Ten lectures on wavelets, Society for Industrial and Applied Mathematics, Philadelphia, 1992. 12. S.Mallat and S.Zhong, \Characterization of signals from multiscale edges," IEEE trans. Patt. Anal. Machine Intell. PAMI-14(7), pp. 710{732, 1992. 13. S.Mallat and W.L.Hwang, \Singularity detection and processing with wavelet," IEEE Trans. Inform. Theory 38(2), pp. 617{643, 1992. 14. J.Canny, \A computational approach to edge detection," IEEE trans. Patt. Anal. Machine Intell. PAMI-8, pp. 679{698, 1987. 15. A.Fournier and et al, Wavelets and their applications in computer graphics, SIGGRAPH'95 Course Notes, Vancouver, British Columbia, 1995.

7