A new focus measure method using moments
Introduction
The problem of focusing cameras is important in computer vision and many industrial applications. For example, in the Printed Circuit Board Assembly (PCBA) inspection, the camera focus needs to be adjusted according to the dimensions of the components on the board in order to obtain their clear images for inspection. As illustrated in Fig. 1, the task of focusing a camera is to find the in-focus position of the camera from images acquired at several different axial positions [1]. In this task, a focus measure which is a function of the axial position plays a key role. The function value at a particular position represents the relative sharpness of image.
Among the available focus measure methods, the shape of the focus function is determined by how the focus measure is constructed. It also depends upon the camera parameters and the imaged object. In Ref. [2] several focus measure methods have been studied. Among them the Tenegrad measure, which is considered as the best, is constructed through thresholding the gradient magnitude. Since this criterion function depends upon the content of the scene and the processing window, it is impossible to evaluate its performance in all circumstances. Using the sum-modified Laplacian operator, Nayar [3] proposed a focus measure which is sensitive to noise. Subbarao [4] proposed some schemes based on the energy of image, the energy of image gradient (EIG), and the energy of Laplacian of the image, respectively. These schemes perform better than other available methods, especially in terms of monotonicity and noise sensitivity. Unfortunately, their performances still depend on imaged objects. The focus criteria may exhibit some local maxima when the image of the object has significant high frequency content. Moreover, all of the above mentioned methods do not provide explicit expressions of the focus measure criteria as functions of the blur parameter.
It is well known that the image of an object is determined by the object and the imaging system. Recently, Flusser and Suk [5], [6] found the relationship between the moments of the defocused image, the focused image, and the Point Spread Function (PSF) which describing the imaging system. However, they concentrated on a set of features, which are independent of the imaging system. Here our objective is to extract an additional set of features, which describe some properties of imaging systems, especially the blur level. Still using the moments relationship described in Ref. [6], we propose a method to measure the focus. By this method, an explicit relationship between the defocused image and the blur parameter can be established. After appropriate normalization, the obtained focus measure curve can be made independent of image of the object.
The remaining part of the paper is organized as follows. In Section 2, we formulate our problem. Section 3 is devoted to the derivation of the focus measure method using central moments of images. In Section 4, the performance of the proposed method is evaluated theoretically. Some simulation results are presented in Section 5. In Section 6, the scheme is applied to a PCBA inspection system. The simulation results and the successful practical application verify the effectiveness of the proposed method. Finally, this paper is concluded in Section 7.
Section snippets
Problem formulation
Fig. 1 shows the image formation and defocus in a convex lens. If an object is focused through a convex lens, the Gaussian lens law holds, i.e.where F is the focal length, u is the distance between the lens and the object position of the perfect focus, and v is the distance between the lens and the sensor plane.
If the object at position z is displaced from the focused position, a defocused image will appear on the sensor plane. The blurred or defocused image g(x,y) can be modeled as
The focus measure method
As our method is based on moments, we present some fundamentals on moments first. Then we describe the focus measure method and give the frequency domain analysis.
Performance analysis
In this section, we first derive expressions for the expected value (mean) and variance of the focus measure modeled in Section 3. Then its independence property is established.
Simulation results
In this section, we use synthetic images to test the performance of our proposed method.
Practical application
The proposed scheme was applied to a PCBA inspection system. Note that this system is not specially designed for vision testing. Instead, it is designed for industrial use. For the system to be tested, the farthest distance from an object to the camera lens is 100 mm and the nearest is 0 mm. Because special lighting is equipped in this PCBA machine for the purpose of inspecting solder quality, the illumination here varies from the near end to the far end dramatically and it is uncontrollable.
Conclusions
In this paper, a new focus measure approach is presented. This approach is based on global information, i.e. the central moments of images. By this scheme, the parameter of blur has an explicit expression and a focus measure curve can be made independent of the imaged objects by appropriate normalization. However, the proposed method has the following limitations. The proposed method cannot overcome the image overlap problem, i.e. for a given image area, the gray levels at the border of this
Acknowledgements
The authors would like to thank the anonymous reviewers for their valuable comments and suggestions.
References (10)
- et al.
Image feature invariant with respect to blur
Pattern Recognition
(1995) - et al.
Autofocusing in microscopy based on the OTF and sampling
Bioimaging
(1994) Focusing
International Journal of Computer Vision
(1987)- et al.
Shape from focus
IEEE Transactions on Pattern Analysis and Machine Intelligence
(1994) - et al.
Focusing techniques
Optical Engineering
(1993)
Cited by (86)
Analysis of different parameters of influence in industrial cameras calibration processes
2021, Measurement: Journal of the International Measurement ConfederationCitation Excerpt :The criteria for quantifying the focus of an image are usually based on the evaluation of the gradient function [9]. In the past, several experimental evaluation on focus measures have been researched [3,10,11]. D. Wang et al. [12] demonstrated a fast auto-focusing technique, which employed internal optical elements to directly sense the deviations in back focal distance of the lens and restore the imaging system to a best-available focus.
Sectional techniques for 3D imaging of microscopic and macroscopic objects
2017, OptikCitation Excerpt :With the non-confocal method such obstacles have to be resolved by sophisticated software. In spite of the difficulties, many acceptable procedures for the non-confocal 3D reconstructions have been published so far [9,10,13–27]. There are two basic variants of the non-confocal microscopic 3D reconstructions, namely the concepts called ‘Shape-From-Focus’ (SFF) and ‘Extended Depth-of-Field’ (EDF).
Retinal image quality assessment using generic image quality indicators
2014, Information FusionCitation Excerpt :A wide range of approaches can be found on the literature: based on image gradient [43–46], based on high pass filtering with the Laplacian operator [45–47] and based on grey-level variance [45,46], all early proposals for measuring the degree of focus. More recently, some new focus measures have been proposed, such as central moments [48], discrete wavelet transform [49–51], Chebyshev moments [52] and steerable filters [53]. Moreover, some of the retinal image quality assessment methods apply explicit focus measures, based on histogram analysis [16], on image gradient magnitude [27] or on the application of a Laplacian operator together with a spatial frequency analysis [17].
A fast auto-focusing technique for the long focal lens TDI CCD camera in remote sensing applications
2013, Optics and Laser Technology3D shape from focus using LULU operators and discrete pulse transform in the presence of noise
2013, Journal of Visual Communication and Image RepresentationCitation Excerpt :Asada [14] in 1998 described eliminating windowing method. Zhang [15] in 2000 proposed 2nd/4th order central moment as a sharpness detector. Helmi [16] in 2002 introduced new techniques based on mean, curvature and point focus methods.
Blur Invariants for Image Recognition
2023, International Journal of Computer Vision