## Abstract

We studied correlation between fractal dimensions and image contrast for metallic surfaces. The study has led to an interesting finding that the maximum fractal dimension of the object surface under imaging gives the best focal plane. The significant finding can be made use of to estimate the best focal plane or measure the focus error with high sensitivity of a few microns, which are well within depth of field of the microscopic imaging system.

©2008 Optical Society of America

## 1. Introduction

In nature, a wide variety of practical surfaces are present with the roughness or height fluctuation distribution well described as random self-affine fractals, scaling from the kilometer-scale structure of mountain terrain to nanometer-scale topology of thin films [1]. Various physical processes, including milling, ion bombardment, etc, produce such kind of surface morphology [2–4]. For analysis using a microscopic imaging system, e.g. an optical microscope or a scanning electron microscope, defocus as one of the main aberrations reduces the sharpness and contrast of the image. This blurs high frequency fine structures making it difficult to resolve them [5]. The experiments also showed defocus causes variations in magnification, depending on the field curvature of the illumination system [6]. Estimation of he defocus error is essential, espically for a microscopic imaging system with a small depth of field.

In this paper, we study correlation between fractal dimensions and contrast of the images. Our study reveals the peak of fractal dimensions from a sequence of images, having different translations along the optical axis, gives the location of the best focal plane. This is in agreement with the fact that a highest contrast of the image gives the best focal plane of an imaging system [7]. This proposed technique allows measurement of the defocus error with a sensitivity of a few microns, well within the system’s depth of field. This feature makes the technique potentially useful in an optical and electronic microscopic imaging system by reducing the defocus aberration.

## 2. Theory

In a linear shift invariant imaging system, if the object illumination is incoherent, such as incoherent white light, normally used in an optical microscope, the imaging system is treated as linear mapping of intensity. The intensity distribution on the image plane is a convolution of the intensity point spread function |*k*(*r*)|^{2} of the imaging system with the intensity *I*
_{0}(*r*′) on the object plane [8],

where * denotes a two-dimensional convolution integral, and *r*′ and *r* are the position vector on the object plane and image plane, respectively. Considering incremental variance of the intensity distribution, *σ*
^{2}(Δ*r*)=〈|*I*(*r*+Δ*r*)-*I*(*r*)|^{2}〉, where Δ*r* is an incremental distance over a fix direction. For an isotropic fractal surface, the incremental variance is expressed by the power function as a function of fractal dimension *D _{s}* [9]

Using this equation, fractal dimension deduced in Fourier domain by correlation, can be rewritten as $R(r+\Delta r,r)\propto \frac{1}{2}\left({\mid r+\Delta r\mid}^{2\left(3-{D}_{S}\right)}+{\mid r\mid}^{2\left(3-{D}_{S}\right)}-{\mid \Delta r\mid}^{2\left(3-{D}_{S}\right)}\right)$ .

One can also define the fractal dimension in a 3-D set A ε ℜ^{3}, e.g. a set of pixels in a grey-level image [10]. The three dimensions read as a set of spatial coordinates and a set of intensity values of the image. The fractal dimension (*FD*) using box counting of a set *A* in a grey image is given as,

where *N*
_{(A,ε)} denotes the number of boxes of side length, *ε*=2^{n}, *n*=1,2,3,4… An image of *M×M* pixels can be divided into box of side length ε=(2)^{n}. If the minimum grey level of the image in the grid (*i*, *j*) falls in box number *k*, and the maximum grey level of the (*i*, *j*)^{th} grid falls in box number *1*, then n is counted as [11]

Taking contributions from all grid, *N*
_{(A,ε)}=∑*n*(*i*, *j*) is counted for the different values of box dimension, ε. The FD can be estimated from the least-squares linear fit of the log(*N*
_{(A,ε)})~ log(1/*ε*) curve.

Either the incremental variance of intensity distribution in Eq. (2) or the difference of the maximum grey level and minimum grey level in Eq. (4) gives a measure of image contrast. Hence we report a correlation between the fractal dimensions and image contrast for random self-affine fractal surfaces, e.g. a metallic surface. This is using the former to estimate the latter and hence to measure the defocus error, which is fundamental in a microscopic imaging instrument or an adaptive optics system.

## 3. Experiment, results and discussion

The experiment involved a 30 mm×20 mm metallic (magnesium alloy AZ91D) specimen, illuminated with incoherent while light and imaged through a long-working-distance microscopic lens. The lens includes a 6.5× Optem® Macro Zoom Lens, a 2× lens attachment, and a close-up lens. The depth of focus of the imaging system is up to 20 µm. With a SONY CCD camera, the scattered light was subsequently digitalized and processed using a computer through a NI IMAQ-PCI card. The field of view is 2.38 mm×3.17 mm corresponding to the image resolution 576×768 pixels. We programmed the software for calculation of fractal dimension in MATLAB and used the program by Sasaki [12] as a reference.

Figure 1(a) shows the texture of a metallic surface captured on focal plane by a human visual judgment. Using the box counting method, fractal dimension (FD) was calculated from the ln(N(ε)) ~ ln(1/ε) curve, as shown in Fig. 1(b). With the box side lengths ε of 4, 8, 16, 32, and 64 pixels (or the scale ratios, 1/*ε*=(1/2)^{n}, n=2, 3, 4, 5, and 6), the value is FD=2.627. In addition, the fractal dimension *D* was obtained in Fourier domain by least–square linear fit of the log-log curve of magnitude and frequency using the equation, D=(6+β)/2, where β is the slope of the log-log curve [9]. The fractal dimension is D=(6+β)/2=2.687, as shown in Fig. 1(c).

Furthermore, the two fractal dimensions were calculated from sequences of images having a certain displacement (10 µm or 50 µm) in surface normal direction. We captured the image sequences with the first of which on the focal plane by a human visual judgment. Figure 2 shows the fractal dimension estimated by box counting method and Fourier transform method for the image sequence having a relative displacement of 50 µm in the direction normal to the object surface. Standard deviation (gradient) was calculated for comparison purposes. The maximum FD at the displacement from 50 to 100 µm gives the best focus range. For a more accurate measurement, the fractal dimensions were estimated, as shown in Fig. 3, for an image sequence having a relative displacement of 10 µm within the displacement range from 0 to 200 µm. The maximum FD shows the focal plane at the displacement of 70 µm. Note the almost identical values of standard deviation at the range from 60 to 90 µm shows the box counting dimension has a better sensitivity than standard deviation.

## 4. Conclusion

We estimate the defocus error using fractal dimensions for isotropic fractal (texture) surfaces with accuracy up to 10 µm, well within the system’s depth of field. In contrast, defocus error according to speckle correlation [13] is larger than the depth of field. We demonstrated that the maximum fractal dimension describes a good image contrast and hence represents the best focal plane in a microscopic imaging system.

## Acknowledgments

The authors would acknowledge the financial support from A*STAR (Agency for Science, Technology and Research), Singapore, through the project on “novel optical nanoprobe for nanometrology based on surface plasmon polaritons” (SERC Grant No. 072 101 0023).

## References and links

**1. **B. B. Mandelbrot, *The Fractal Geometry of Nature*, (W. H. Freeman, San Francisco, New York, 1982).

**2. **P. Kotowski, “Fractal dimension of metallic fracture surface,” Int. J. Fract. **141**, 269–286 (2006). [CrossRef]

**3. **A. Helalizadeh, H. Muller-Steinhagen, and M. Jamialahmadi, “Application of fractal theory for characterisation of crystalline deposits,” Chem. Eng. Sci. **61**, 2069–2078 (2006). [CrossRef]

**4. **D. K. Goswami and B. N. Dev, “Nanoscale self-affine surface smoothing by ion bombardment,” Phys. Rev. B **68**, 033401 (2003). [CrossRef]

**5. **J. Henry, “Accuracy issues in chemical and dimensional metrology in the SEM and TEM,” Meas. Sci. Technol. **18**, 2755–2761 (2007). [CrossRef]

**6. **G. V. Duinen, M. V Heel, and A. Patwardhan, “Magnification variations due to illumination curvature and object defocus in transmission electron microscopy,” Opt. Express **13**, 9085 (2005). [CrossRef] [PubMed]

**7. **R. N. Bracewell, *Fourier Analysis and Imaging*, (Kluwer, New York, 2003).

**8. **J. W. Goodman, *Introduction to Fourier Optics*, (McGraw-Hill, New York, 1996).

**9. **G. Franceschetti and D. Riccio, *Scattering, Natural Surfaces and Fractals*, (Elsevier, 2007).

**10. **S. S. Chen, J. M. Keller, and R. M. Crownover, “On the calculation of fractal features from images,” IEEE T. Pattern Anal. **15**, 1087–1090 (1993). [CrossRef]

**11. **N. Sarkar and B. B. Chaudhuri, “An efficient approach to estimate fractal dimension of textural images,” Pattern Recogn. **25**, 1035–1044 (1992). [CrossRef]

**12. **http://cse.naro.affrc.go.jp/sasaki/fractal/fractal-e.html.

**13. **V. Krishnakumar and A. K. Asundi, “Defocus measurement using spackle correlation,” J. Mod. Opt. **48**, 935–940 (2001).