
1. Introduction
The measurement system based on machine vision is characterized by non-contact, high accuracy and high degree of automation [1] . In the machine vision measurement system, improving edge detection accuracy is an important way to achieve high accuracy measurement of the system. Sub-pixel edge detection technology has attracted wide attention due to its high measurement accuracy and strong anti-interference ability.
Traditional edge detection methods, such as Sobel algorithm [2] , LOG algorithm, and Canny algorithm [3] , can only locate the edges on pixel accuracy and have poor anti-interference ability. Jensen [4] realized the sub-pixel edge positioning of grayscale images by using interpolation method, but its computation increased rapidly with the increase of number of interpolation. Lyvers [5] presented a sub-pixel edge detection method based on geometric moment. Through the adoption of six moment templates, edge grayscale jump height, background grayscale and distance and angle between pixel center and edge are obtained, which realized sub-pixel edge positioning. Shan [6] proposed a method combining Canny operator and quadratic moment to realize sub-pixel edge positioning. Although these two algorithms can achieve sub-pixel edge positioning accuracy, the computation is large and the requirement of image grayscale is high.
2. Principle of Sub-Pixel Edge Detection
The Zernike moment of 2-D continuous function f(x,y) is defined in equation (1).
(1)
In the discrete images, Anm can be represented in Equation (2).
(2)
In order to get the Zernike moment Anm of a certain point in the image, it’s required to map its neighborhood point into the unit circle. The polar form of the integral kernel function Vnm(ρ,θ) is represented in Equation (3).
(3)
When the circular object to be detected is intersecting with the circular detection area, there is only one tangent line pass the point on the edge of the circular object in the intersection area. The mapping relationship between the edge parameters of the measured object and the edge point of pixel point can be established by using the tangent line. The ideal step model is shown in Figure 1(a). The ideal step model indicates the relationship among the circle C1 to be measured, tangent line L of a point on the edge of C1 and unit circle C2. l is the vertical distance between tangent line L and the center of unit circle C2 and ϕ is the angle between vertical line l and x axis. Define a continuous ideal edge model on the unit circle, so the gray value of intersection area between unit circle and circle to be measured is h + k, and the gray value of other areas is h. The image coordinate system, coordinate system for the unit circle and pixel point of the center point of the unit circle are (x’o’y’), (xoy) and (xs,ys) respectively.
After β is determined, 3 × 3 template that centered with p0(x0,y0) in Figure 2 is used to solve interpolation points P’0 and P’’0 that are adjacent to p0(x0,y0).
Sub-pixel edge points in gradient direction are extracted by combining Zernike moment orthogonal circle and quadratic polynomial interpolation.
(a)
(b)
Figure 1. Step model. (a) The ideal step model; (b) Step model after rotation.
3. Experimental Verification and Analysis
Circle outer diameter sub-pixel measurement system based on Zernike moment is mainly composed of image acquisition, image sub-pixel edge detection and caliper tool measurement. The system assembly and system workflow are shown in Figure 3(a) and Figure 3(b) respectively.
In order to verify the measurement accuracy of the system, three groups of circular workpieces are measured. The outer diameters are 15.002 mm, 19.997 mm and 25.002 mm respectively.
Edge detection algorithm based on Zernike moment is used to conduct sub-pixel edge extraction for circular workpieces. The process is divided into four steps as shown in Figure 4, image reading, integral operation of unit circle, detection in gradient direction and display of detection results.
It can be seen from the effect of sub-pixel edge detection that the edge algorithm composed of red line has the precision of 0.1 - 0.2 pixels, which meets the requirements of sub-pixel precision measurement.
(a)
(b)
Figure 3. Measuring system. (a) Experiment layout; (b) System flowchart.
After the sub-pixel edge is extracted, the measuring tool caliper that packaged by least square method is used to measure the outer diameter of the circle in real time. The process is shown in Figure 5.
It can be seen from the measurement result that the real-time measured result of the outer diameter of the circular workpiece is 25.0024 mm, which is very close to 25.002 mm measured by micrometer. This measurement system is applied to measure three circular workpieces, and the actual measurement results and the measurement error comparison are shown in Figure 6.
It can be seen from the outer diameter measurement results of three workpieces and measurement error rate that circle outer diameter sub-pixel measurement system based on the Zernike moment can realize the dynamic measurement precision of plus or minus 0.02 mm. So the measuring accuracy is
high, which can satisfy the circular workpiece measurement requirements in actual production.
4. Conclusion
A kind of sub-pixel measurement system of circle outer diameter is proposed in this paper. In this system, the mapping relationship between edge points and edge parameters of circular object is established based on Zernike moment and the edge points of circle are extracted. Further positioning of extracted edge points in gradient direction is conducted by using quadratic polynomial interpolation. Least square method is taken to fit the edge points after the interpolation, thus the measurement results of the circular outer diameter of the sub-pixel accuracy are obtained. The system detection and measurement accuracy are verified through the image edge detection and measurement experiment. The experiment results show that the system’s circular edge sub-pixel positioning method has higher detection and positioning accuracy than the traditional operator, and the accuracy of measurement meets the requirement of high precision and real-time measurement.