A subpixel edge detection method based on an arctangent edge model

A subpixel edge detection method based on an arctangent edge model

Accepted Manuscript Title: A subpixel edge detection method based on an arctangent edge model Author: Qiucheng Sun Yueqian Hou Qingchang Tan PII: DOI:...

867KB Sizes 53 Downloads 264 Views

Accepted Manuscript Title: A subpixel edge detection method based on an arctangent edge model Author: Qiucheng Sun Yueqian Hou Qingchang Tan PII: DOI: Reference:

S0030-4026(16)30236-4 http://dx.doi.org/doi:10.1016/j.ijleo.2016.03.058 IJLEO 57455

To appear in: Received date: Revised date: Accepted date:

29-7-2015 4-12-2015 29-3-2016

Please cite this article as: Qiucheng Sun, Yueqian Hou, Qingchang Tan, A subpixel edge detection method based on an arctangent edge model, Optik - International Journal for Light and Electron Optics http://dx.doi.org/10.1016/j.ijleo.2016.03.058 This is a PDF file of an unedited manuscript that has been accepted for publication. As a service to our customers we are providing this early version of the manuscript. The manuscript will undergo copyediting, typesetting, and review of the resulting proof before it is published in its final form. Please note that during the production process errors may be discovered which could affect the content, and all legal disclaimers that apply to the journal pertain.

A subpixel edge detection method based on an arctangent edge model Qiucheng Sun1, Yueqian Hou2, Qingchang Tan3 1

School of mathematics, Changchun Normal University, Changji Highway (North) 677, Changchun 2

College of Mechanical Science and Engineering, Changchun University, Changchun, China 3 College of Mechanical Science and Engineering, Jilin University, Changchun, China [email protected]

Abstract: The sub-pixel edge detection method is widely applied in image processing to improve accuracy of measurement and recognition. Detection methods often encounter difficulties with low computational efficiency or poor robustness. To address such difficulties, a new least-squared-error-based method is proposed in this paper. First, a one-dimensional solution is derived by means of an arctangent edge model. In the two-dimensional situation, the Sobel operator and the cubic surface fitting method are used to determine the normal direction of edge. Then, two-dimensional edge detection can be transformed into a one-dimensional problem that can be solved with a one-dimensional solution. Because there is no complicated surface fitting in this least-squared-error-based method, it will provide an opportunity to ascertain quickly the accurate location of an edge. The experiment is described at the end of the paper, comparing three edge detection methods. The results indicate that the new detection approach has robustness equal to the traditional least-squared-error-based methods, while run time is much faster and very close to the moment-based methods. The above advantages indicate this approach is very suitable for on-line accurate detection.

Keyword: Sub-pixel edge detection, Sobel operator, Arctangent edge model

1. Introduction Edge detection is a fundamental task in many image processing applications such as motion analysis [1, 2], image segmentation [3], pattern recognition [4-6], vision measurement[7-12], remote sensing and medicine [13-16], etc. Many pixel-level edge detection algorithms have been proposed, e.g., Sobel, Roberts, Prewitt and Canny Operators, which are widely studied in the

literature [17]. Usually, the accuracy of these algorithms is inadequate for applications where precise and fine edges are required. Therefore, traditional pixel-level detection algorithms have been developed for sub-pixel detection; these attempt to obtain the location and orientation of the edge within a pixel. Currently, edge detection algorithms at the sub-pixel level fall into three main categories: moment-based, interpolation-based and least-squared-error-based. In the moment-based algorithms, a closed-form solution is derived using the moment integral operator to detect edge location and orientation; these require no interpolation or iteration. As previously described in detail [18], the first moment-based work was proposed by Tabatabai and Mitchell [19]. In this work, edge parameters (location, orientation, contrast and background) are solved from four grey moments by means of an ideal step edge model. Subsequently, a method proposed in the literature [20] instead uses spatial moments for edge detection; six masks are given to calculate geometric moments, which in turn are used to determine four parameters of the step edge. Currently, other moment-based studies are proposed such as Zernike moment [21] and Fourier-Mellin Moment [22]. In the moment-based methods, the number of moment templates used in convolutions is not less than three; therefore, they may be computationally expensive when the image window is large. Additionally, the calculation of edge orientation sometimes is very sensitive to noise in the moment-based methods. The interpolation-based algorithms attempt to achieve subpixel edge accuracy by interpolating the grey values of an image or their derivatives. A method is proposed in [23] to extract edges and lines by Steger, in which a second-order polynomial is used to interpolate the data of a gradient image. Subsequently, a work presented in [24] first uses a Canny detector and then applies Hermite interpolation to estimate the areas of the edges. Recently, some new methods are proposed in this category of edge detection algorithms, e.g., [25, 26]. All these methods are computationally efficient, but the performance may be poor in noisy images. The least-squared-error-based methods attempt to obtain the subpixel edge location by fitting the grey values of the image with an assumed edge model. Nalwa and Binford [27] proposed a least squared-error method using the hyperbolic tangent function as the edge model. In [28], a method is proposed where a local energy function is used to help determine the parameters of the edge. In the method, three types of edge (step, ramp, and roof) can be detected based on their responses to the convolution. To improve computational efficiency, a quadratic polynomial

gradient is used for least squares fitting in the studies [29]. A recent work has been presented by Jian Ye [30], who proposes a high-precision detection algorithm based on a Gaussian edge model. Another recent work based on deformable models has been carried out by Bouchara and Ramdani [31]. In general, these methods are effective and reliable in noisy image processing, but are computationally expensive. In this paper, a new subpixel edge-detection algorithm is proposed to improve robustness and computational efficiency. In the algorithm, a new blurred-edge model is given; the model is called an arctangent model. A least-squared-error solution is derived for both one- and two-dimensional situations. An evaluation of the proposed algorithm’s performance is also included using a comparison with the methods proposed in [20, 30]. The paper is organized as follows. A blurred arctangent edge model is given in Section 2. Sections 3 and 4 derive the solution for the one- and two-dimensional situations, respectively. Experimental studies are given in Section 5. The paper ends with conclusions. 2. Arctangent edge model As shown in Fig. 1, an ideal edge can be modelled as a step function for the one-dimensional situation without considering the blurring effect:

 h u  x   h  k

xR xR

(1)

where u ( x) is light intensity at x , R is the subpixel location of the edge, and h and k are the intensity of background and contrast, respectively. With understanding of the image formation process [32], the blurring effect of the camera system should be taken into account. Therefore, an assumed blurred-edge model is used in the least-squared-error-based algorithms such as the Gaussian edge model as shown in Fig. 2. This model is obtained by convolving u(x) in Eq. (1) with the Gaussian kernel as the impulse response function, whose mathematical form is complex and difficult to solve. In general, the other blurred-edge models are also complex. Therefore, an arctangent edge model is given for the one-dimensional situation in this paper:

y  a1 arctan(a2 x  a3 )  a4

(2)

where a1 ,a2 ,a3 ,a4 are undetermined coefficients in the model. In mathematics, the arctangent

function is an elementary function, and the profiles of the function are as shown in Fig. 3. Compared with the grey distribution of the real edge, it can be observed that the arctangent function can well embody a real edge as shown in Fig. 4. Because the elementary function is easy to solve, the efficiency of the detection algorithm will be improved significantly. 3. One-dimensional edge detection In the process of sub-pixel edge detecting, the edge detection method at the pixel level should be used first to locate the edge in the image window that contains the edge. Therefore, in this section, the Sobel operator is used to detect the edge by calculating partial derivatives in a 3  3 neighbourhood. The reason for using the Sobel operator is that it is insensitive to noise, and it has relatively simpler masks than do other two-order operators such as the Laplace operator. According to the Sobel operator, partial derivatives in x and y directions are calculated as:

Sx  {I ( x  1, y 1)  2I ( x 1, y)  I ( x 1, y 1)} {I ( x 1, y 1)  2I ( x 1, y)  I ( x 1, y 1)} S y  {I ( x 1, y  1)  2I ( x, y  1)  I ( x  1, y 1)}

(3)

{I ( x 1, y 1)  2I ( x, y 1)  I ( x 1, y 1)} where I ( x, y ) is the discrete light intensity of the image. The gradient value of each pixel is calculated according to g ( x, y )  S x2  S y2 ; then, a threshold value t is selected. If

g ( x, y )  t , this point is regarded as an edge point. In this way, all edge points in the window can be detected at the pixel level by means of the operator, as shown in Fig. 5. Then, a row of pixel points is selected along the direction perpendicular to the edge, with an edge point as the centre in the window, as shown in Fig. 4(a). Using the above data, the operation for fitting the arctangent model will become a problem of multi-dimensional optimization defined as Minimize  (a1 , a2 , a3 , a4 ) . This multi-dimensional optimization problem can be solved using an appropriate numerical search algorithm. For computational efficiency, the Levenberg-Marquardt Optimization method is adopted here for optimization. When the parameters of the model are determined, the sub-pixel location of the edge is obtained as R  

a3 based on the symmetry of function. a2

4. Two-dimensional edge detection In one-dimensional edge detection, the profile of the edge model function is a blur curve,

whereas in the two-dimensional situation, the profile of the edge model function is a smooth surface. In this paper, the surface is defined as a one-dimensional oriented surface constant in one direction, as shown in Fig. 6. Fitting this 1-D surface is equivalent to treating the data as strictly one-dimensional by projecting it along the direction (edge direction) of invariance onto a plane. Therefore, the proposed model is different from the Gaussian edge model extended to its two-dimensional counterpart. When the normal direction is determined, which is perpendicular to the edge direction, all pixel points can be projected to the normal line through the origin in the window, as shown in Fig. 7. In this way, two-dimensional edge detection can be transformed to a one-dimensional problem. Then, the question first is addressed as a reliable direction finder of surface in the window in this section. The direction steps are as follows: 1). Obtaining an initial estimate for the direction To obtain the normal direction of the edge, the normal directions of all edge points in the window are solved first. In this paper, the grey gradient of the edge point is approximated as the normal direction of the edge. So, the normal direction of an edge point

(x0, y0 ) can be expressed

as (Sx0 , Sy0 ) , which can be solved using equation (3). In this way, the normal directions of all the edge points are obtained, as shown in Fig. 8. Then, the normal direction of the edge can be obtained by solving the mean value of the above normal directions, and this direction can be used as an initial estimate for the next operation. 2). Obtaining the direction by fitting Refine the above estimate of the direction of variation by fitting a 1-D cubic surface with the least-squares-error criterion:

I [ x, y ]  a0  a1 X  a2 X 2  a3 X 3

I [ x, y ] is light intensity at ( x, y ) ; X  x cos( )  y sin( ) ;  , a refined estimate of  0 , is the angle between the normal line and the X axis, and

 0  arctan

S y0 S x0

. The resulting equations

are non-linear in the angle. However, due to the reliable initial estimate, the search typically requires a couple of iterations. Finally, a least-squares 1-D arctangent curve oriented in the direction found in the above

operation can be obtained by fitting. Then, the edge in the window can be located combined with the known edge direction. 5 Experimental analysis 5.1 Robust test To verify the robustness of the proposed method, we investigate the method by performing edge detection experiments on real images, the compare the results with the methods of the Gaussian [30] and Moment [20] models. First, the edge in the window is detected by the proposed, Gaussian and Moment-based methods, respectively, as shown in Fig. 9. Then, Gaussian noise is added to the image as shown in Fig. 10, and the edge in the window is detected again by these methods. Figure 11 shows that the disturbance of the moment-based method is great. This is because the edge orientation of the method is obtained by calculating the ratio of the two perpendicular intercepts of the edge, and this ratio is very sensitive to noise, as noted in [24]. Because the least-squared-error-based method is not sensitive to noise, the proposed and Gaussian methods have higher stability than the moment-based method; the disturbance of the detection result is also very small even if the noise strength continued to increase. 5.2 Accuracy test Because the real position of the edge is unknown in the image, it is difficult to directly evaluate the accuracy of the algorithm according to the detection results. To test the accuracy of the proposed method, a measurement experiment is carried out in which the three methods are compared. In the experiment, a sample with a black pattern and white background is mounted on a linear translation stage as shown in Fig. 12 and is translated along the same direction in increments of 0.01mm. Simultaneously, sample images are acquired by the CCD camera with a 25 mm lens, and the image resolution is 13761024 pixels. The sample surface is placed parallel to the CCD sensor, and the edge should be located in the centre of the image. As shown in Fig. 13, a new edge position can be detected by using the edge detection method after each displacement. Because the influence of image distortion is very small, a linear relationship between the actual and pixel displacements of the edge can be found. Based on the fitting residual, the accuracy of the edge detection algorithm is evaluated. Using the same image data, three sets of results are obtained by means of the three detection algorithms. The fitting results are shown in Fig. 14; the mean absolute deviation of the proposed method is 0.0152 pixel, while the deviations of the

Gaussian and Moment models are 0.0162 and 0.0223 pixels, respectively. It can be observed that the proposed method has high detection accuracy. 5.3 Run time In the experiment, a computer with a Pentium-2.3 GHz CPU was used to run an image processing program implemented by Matlab 2012. By detecting the edge in the same window ( 1111 ), the run times of three methods are tested in this study. The average run time of the proposed method is approximately 0.0096s, while the times of the Gaussian and Moment models are 0.392s and 0.0024s, respectively. The run time of the proposed method is very close to the method of moment and is much less than the run time of the Gaussian model method. Therefore, this method is more suitable for this application. 6. Conclusions A new least-squared-error-based method is developed which operates on a window based on an arctangent edge model to determine the location of an edge. In the presence of noise, the method is shown to have a relatively small bias compared with the moment operator, which indicates that the method has better robustness. The run time of the method is much faster than the Gaussian method and very close to the moment operators, which indicates this approach is very suitable for on-line detection.

Acknowledgement The work described in this paper is partially supported by the National Nature Science Foundation of China under Grant 61201084, Foundation of Jilin provincial development and Reform Commission, Foundation of Science and Technology Department of Jilin Province, Natural Science Foundation of Changchun Normal University. Reference [1]. Guan T, Duan L Y, Yu J Q, et al. Real-time camera pose estimation for wide-area augmented reality applications. IEEE computer graphics and applications, 2011, 31(3): 56-68. [2]. Guan T, Wang C. Registration based on scene recognition and natural features tracking techniques for wide-area augmented reality systems. IEEE Transactions on Multimedia, 2009, 11(8): 1393-1406. [3]. Al-Amri S S, Kalyankar N V, Khamitkar S D. Image segmentation by using edge detection. International Journal on computer science and engineering, 2010, 2(3): 804-807.

[4]. Sun L, Ge H, Yoshida S, et al. Support vector description of clusters for content-based image annotation. Pattern Recognition, 2014, 47(3): 1361-1374. [5]. Gao Y, Wang M, Tao D, et al. 3-d object retrieval and recognition with hypergraph analysis. IEEE Transactions on Image Processing, 2012, 21(9): 4290-4303. [6]. Gao Y, Wang M, Ji R, et al. 3D object retrieval with hausdorff distance learning. IEEE Transactions on industrial electronics, 2014, 61(4): 2088-2098. [7]. J. Apolinar Muñoz-Rodríguez, Ramón Rodríguez-Vera. Evaluation of the light line displacement location for object shape detection. Journal of Modern Optics, 2003, volume 50(1):137-154. [8]. Muñoz-RodrıG ́ uez J A, Asundi A, Rodriguez-Vera R. Recognition of a light line pattern by Hu moments for 3-D reconstruction of a rotated object. Optics & Laser Technology, 2005, 37(2):131–138. [9]. MuÑ J A, oz-Rodrí, guez. Modeling of a mobile setup by networks for object contouring. Optical Engineering, 2008, 47(5):525-534. [10]. Muñoz-Rodriguez J A. Supplying interpolation and continuity in surface modeling via Bezier networks and optical metrology. Optical Engineering, 2014, 53(9):2199-2203. [11]. Alanís F C M, Rodríguez J A M. Self-calibration of vision parameters via genetic algorithms with simulated binary crossover and laser line projection. Optical Engineering, 2015, 54. [12]. Rodríguez J A M. Online self-camera orientation based on laser metrology and computer algorithms. Optics Communications, 2011, 284(24):5601–5612. [13]. Coppin P R, Bauer M E. Digital change detection in forest ecosystems with remote sensing imagery. Remote sensing reviews, 1996, 13(3-4): 207-234. [14]. Xu L, Jin S, Yin G. A Track Association Algorithm Based on Leader-Follower On-line Clustering in Dense Target Environments. Radioengineering, 2014, 23(1): 259-265. [15]. Xu L, P Ma, X Su. Integral Track Association for Laser Triangulation Sensor in a Dense Target Environment. Lasers in Engineering. 2013, 24(5-6): 375-390. [16]. Xu L, Jin S, Yin G. Track fusion via track filter in dense sensor environments. Measurement. 2013, 46(10): 3871-3875. [17]. Canny J. A computational approach to edge detection. Pattern Analysis and Machine Intelligence, IEEE Transactions on, 1986 (6): 679-698. [18]. Sun Q C, HowY Q, Tan Q C, et al. A Robust Edge Detection Method with Sub-pixel Accuracy, Optik, 2014, 125 (14):3449-3453. [19]. Tabatabai A J, Mitchell O R. Edge location to subpixel values in digital imagery, IEEE Transactions on Pattern Analysis and Machine Intelligence, 1984, 6(2), p. 188-201.

[20]. Lyvers E P, Mitchell O R, Precision edge contrast and orientation estimation, IEEE Transactions on Pattern Analysis and Machine Intelligence, 1988, 10(6), p. 927-937. [21]. Qu Y Q, Cui C S, Chen S B, et al. A fast subpixel edge detection method using Sobel-Zernike moments operator. Image and Vision Computing, 2005, 23(1): 11-17. [22]. Bin T J, Lei A, Jiwen C, et al. Subpixel edge location based on orthogonal Fourier–Mellin moments. Image and Vision Computing, 2008, 26(4): 563-569. [23]. Steger C. Subpixel-precise extraction of lines and edges. International Archives of Photogrammetry and Remote Sensing, 2000, 33(3): 141-156. [24]. Hermosilla T, Bermejo E, Balaguer A, et al. Non-linear fourth-order image interpolation for subpixel edge detection and localization. Image and vision computing, 2008, 26(9): 1240-1248. [25]. Zhang L, Wu X L. An edge-guided image interpolation algorithm via directional filtering and data fusion. IEEE Transactions on Image Processing, 2006 15 (8): 2226-2238. [26]. Gao C B, Zhou J L, Zhang W H. Edge Detection Based on the Newton Interpolation's Fractional Differentiation. INTERNATIONAL ARAB JOURNAL OF INFORMATION TECHNOLOGY, 2014, 10(3): 223-228. [27]. Nalwa V S, Binford T O. On detecting edges, IEEE Transaction on Pattern Analysis and Machine Intelligence. 1986 8(6): 699-714. [28]. Kisworo M, Venkatesh S, West G. Modeling edges at subpixel accuracy using the local energy approach. IEEE Transactions on Pattern Analysis and Machine Intelligence, 1994, 16(4): 405-410. [29]. Rockett P. The accuracy of sub-pixel localisation in the canny edge detector, in: In Proc. of the British Machine Vision Conference, BMVC, 1999, pp: 392-401. [30]. Ye J, Fu G K, Poudel U P. High- accuracy edge detection with blurred edge model, Image and Vision Computing, 2005, 23(5): 453-467. [31]. Bouchara F, Ramdani S. Subpixel edge refinement using deformable models. JOSA A, 2009, 26(4): 820-832. [32]. Elder J H, Zucker S W. Local scale control for edge detection and blur estimation, IEEE Transaction on Pattern Analysis and Machine Intelligence, 1998, 20, p. 699–716.

Figure 1 Step model

Figure 2 Blurred edge model

(a) (b) Figure 3 Arctangent edge model ((a) One-dimensional arctangent function(b)Two-dimensional arctangent function)

(a) (b) Figure 4 Grey distribution of edge ((a) One-dimensional grey distribution (b) Two-dimensional grey distribution)

Figure 5 Edge detection by Sobel operator

Figure 6 One-dimensional oriented surface

Figure 7 Sketch map of projection

Figure 8 The initial estimate of direction

Figure 9 Edge detection in the clear image

Figure 10 The image with the white Gaussian noise

(a) (b) Figure 11 The detection results of the three methods ((a) The result for the clear image (b) The result for the noise image)

(a) (b) Figure 12 Translation experiment ((a) The translation stage (b) The image of the sample)

(a) (b) Figure 13 Displacement detection ((a) The actual displacement of the edge (b) The pixel displacement of the edge)

(a) (b) (c) Figure 14 The fitting results ((a) The proposed method (b) Gaussian model (c) Moment-based method)