Research on Dimensional Measurement Based on Sub-pixel Edge Detection

Weidong Yang, Jiaxing Wang, Kai Peng, Dan Sun2012

Abstract

With the development of modern industry, image measurement technology—with its high speed, high precision, and non-contact advantages—has received significant attention. In machine vision systems used for measuring mechanical parts, the accuracy of edge positioning directly influences the precision of measurement results. This paper analyzes sub-pixel location methods based on Gray Moment Theory and Gaussian Fitting Theory. Through experimental size measurements of mechanical parts, these methods are compared against classical edge detection operators to evaluate performance and accuracy, providing a practical reference for sub-pixel edge detection in industrial applications.

Introduction

In modern industrial inspection, machine vision is preferred for its speed and non-contact nature. However, traditional edge detection operators (such as Sobel, Canny, or LOG) are limited to pixel-level accuracy. If a camera sensor's resolution dictates that one pixel represents 0.2mm, a standard operator can only measure within that 0.2mm margin of error. For high-precision mechanical parts, this is insufficient. The challenge lies in identifying the "true" edge that exists between the discrete grid of pixels. This research explores mathematical modeling to bridge this gap through sub-pixel positioning.

Theoretical Framework

Gray Moment Theory

This method treats an edge as a transition between two gray levels ($h_1$ and $h_2$). By calculating the first three orders of gray moments in the image data and matching them to an ideal "step function" model, the algorithm solves for the exact sub-pixel coordinate ($k$) where the transition occurs.

Sub-pixel edge location model using Gray Moment Theory illustrating the transition between gray levels

Gaussian Fitting Theory

This approach assumes that the gradient (the rate of change in brightness) across an edge follows a Gaussian (bell-shaped) curve. The "true" edge is identified as the peak of this curve. By applying a logarithmic transformation and the least-squares principle, a quadratic curve is fitted to the data, with the vertex representing the sub-pixel edge position. Gaussian fitting offers the advantage of rotation invariance, simplifying setup in factory environments.

Experimental Setup and Results

Methodology

The measurement workflow consists of three main steps:

  1. Coarse Location: A standard Sobel operator identifies the general area of the edge.
  2. Preprocessing: Image filtering is applied to remove noise.
  3. Sub-pixel Refinement: Either Gray Moment or Gaussian Fitting is applied within a small window (e.g., 11 pixels) around the coarse edge to find the precise coordinate.
The mechanical part target (left) and its coarse edge detection result (right)

Comparative Analysis

The experiment measured a rectangular mechanical part with a known width of 39.00 mm. A 15mm target was used for calibration, establishing a transformation factor of $k = 0.1852$ mm/pixel. The results demonstrate that sub-pixel methods provide significantly more granular data than standard pixel-level detection:

Method Left Edge (pixel) Right Edge (pixel) Distance (pixel) Dimensions (mm)
Sobel (Pixel-level) 234 445 211 39.0772
Moments Theory 234.8288 445.1341 210.3053 38.9485
Gaussian Fitting 234.4230 445.3536 210.9306 39.0643

Conclusion

While the Sobel operator provides a result close to the target, sub-pixel methods provide the fractional data necessary for statistical process control in manufacturing. Gaussian fitting is mathematically elegant but highly sensitive to noise and specific gray-value trends. Currently, the Gray Moment method is more practical for standard mechanical parts due to its robustness. Future work will focus on optimizing these algorithms for real-time processing on high-speed assembly lines.

Summary updated

Abstract

With the development of modern industry, image measurement technology with its high speed ,high precision and non-contact advantages receives high-profile attention. In the machine vision system the size of the process of mechanical parts measured, it is found that the accuracy of the edge position directly influence the accuracy of the measurement results. According to the research on the current sub-pixels positioning of image processing technology, this paper firstly makes a theory analysis and research about sub-pixel location methods based on gray level moment theory and the theory of Gaussian fitting. Then through the parts size measurement experiment, under the premise of contrast location with classical edge detection operators, some groups of data are extracted respectively compared to both of the detection performance and accuracy.Thus it provided the reference for the sub-pixels edge detection algorithm in the actual application.
BibTeX
@misc{yang2012research,
  author = {Weidong Yang and Jiaxing Wang and Kai Peng and Dan Sun},
  title = {{Research on Dimensional Measurement Based on Sub-pixel Edge Detection}},
  year = {2012},
  doi = {10.2991/emeit.2012.286},
}
Figure