Open Access Library Journal
Vol.05 No.04(2018), Article ID:84277,6 pages

Measurement System of Circler Diameter

Shangkun Yang

School of Automotive Engineering, Shanghai University of Engineering Science, Shanghai, China

Copyright © 2018 by author and Open Access Library Inc.

This work is licensed under the Creative Commons Attribution International License (CC BY 4.0).

Received: April 8, 2018; Accepted: April 26, 2018; Published: April 29, 2018


Sub-pixel measurement system can, to some extent, compensate the margin positioning error caused by hardware limitation. A kind of sub-pixel measurement system of circle outer diameter based on Zernike moment is established. Sub-pixel edge detection algorithm of circular workpiece based on Zernike moment is proposed and further positioning of edge points in the gradient direction by the adoption of quadratic polynomial interpolation is conducted. Finally, circle outer diameter measurements of sub-pixel accuracy are obtained by using least square method fitting the edge points. The experiment results show that the measurement accuracy of system is high, which meets the requirement of high accuracy measurement of circular workpiece.

Subject Areas:

Image Processing


Zernike Moment, Sub-Pixel, Edge Detection, Measurement of Outer Diameter

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).


In the discrete images, Anm can be represented in Equation (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).


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 P0 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.

Figure 2. Judgment of edge point.

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.

(a) (b)(c) (d)

Figure 4. The process of edge detection. (a) Image reading; (b) Integral operation of unit circle; (c) Detection in gradient direction; (d) Display of detection results.

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

(a) (b) (c)(d)

Figure 5. Measurement of outer diameter. (a) Sub-pixel edge; (b) Caliper tool; (c) Measuring of caliper tool; (d) Display of measurement results.

(a) (b)(c) (d)

Figure 6. Measurement Result and Analysis. (a) Measuring Result of No.1 Workpiece; (b) Measuring Result of No.2 Workpiece; c) Measuring Result of No.3 Workpiece; (d) Error Rate of Measurement.

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.

Cite this paper

Yang, S.K. (2018) Measurement System of Circler Diameter. Open Access Library Journal, 5: e4585.


  1. 1. Shi, C., Qiu, B., Wu, C., et al. (2006) Normal-Temperature Fog Machinery Spray Angle Measuring System Based on Machine Vision. Transactions of the Chinese Society for Agricultural Machinery, 37, 47-50.

  2. 2. Sobel, I. (1978) Neighborhood Coding of Binary Images for Fast Contour Following and General Binary Array Processing. Computer Graphics & Image Processing, 8, 127-135.

  3. 3. Canny, J. (1986) A Computational Approach to Edge Detection. IEEE Transactions on Pattern Analysis and Machine Intelligence, PAMI-8, 679-698.

  4. 4. Jensen, K. and Anastassiou, D. (1995) Subpixel Edge Localization and the Interpolation of Still Images. IEEE Transactions on Image Processing, 4, 285-295.

  5. 5. Shan, Y. and Boon, G.W. (2000) Sub-Pixel Location of Edges with Non-Uniform Blurring: A Finite Closed-Form Approach. Image & Vision Computing, 18, 1015-1023.

  6. 6. Lyvers, E.P., Mitchell, O.R., Akey, M.L., et al. (2002) Subpixel Measurements Using a Moment-Based Edge Operator. IEEE Transactions on Pattern Analysis & Machine Intelligence, 11, 1293-1309.

  7. 7. Xin, Y., Liao, S. and Pawlak, M. (2004) A Multibit Geometrically Robust Image Watermark Based on Zernike Moments. IEEE International Conference on Pattern Recognition, 4, 861-864.