Research on the Dimensional Accuracy Measurement Method of Cylindrical Spun Parts Based on Machine Vision

A new method for measuring the dimensional accuracy of the cylindrical spun parts based on machine vision was proposed to overcome the artificial deviation and low efficiency of manual measurement. The image acquisition system of machine vision was built up. The methods of image processing and edge extraction of cylindrical spun parts were studied. The straightness and ovality of the cylindrical spun parts were obtained by the proposed new method. The results showed that the edge contour of the cylindrical spun parts extracted by Canny edge detector is better than Sobel and Prewitt edge detector. The dimensional accuracy of the cylindrical spun parts can be obtained accurately by the proposed measurement method based on machine vision. The relative errors of the straightness and ovality between the machine vision and the manual measurement are less than 10%.


Introduction
The cylindrical spun parts are one of the most important structural components which are widely used in aviation, aerospace, automotive, defense, energy and electronics industries [1]. The cylindrical parts manufactured by power spinning have inherent advantages, such as good dimensional accuracy and high material utilization [2]. The dimensional accuracy of the spun parts is usually obtained by manual measurement. However, the artificial deviation is existed and the efficiency is low if the manual measurement was used.
Machine vision technology is simulated the human visual function by machine and obtained the information from the image objects. It has advantages such as non-contact, high accuracy and high degree of automation. Therefore, machine vision technology has been employed in several manufacturing application including measurements, assembly and inspection [3]. Babu et al. [4] utilized a machine vision system to determine the surface roughness of the milled surfaces. The result indicates that the surface roughness could be estimated with a reasonable accuracy using machine vision. Ralf et al. [5] built an automatic visual inspection for small stampings with free-form surfaces. The results showed that the typical defects of cutoffs, incomplete stampings, cracks and scratches, etc. on both sides of the parts are inspected successfully. Li et al. [6] proposed a machine vision detection method to measure the geometrical size and shape-position of step shaft. The results showed that the length, radius, roundness error of the step shaft can be measured automatically. Liu et al. [7] proposed a non-contact detection method based on machine vision to measure the geometrical size and shape-position error of the ball nut. The results showed that the proposed method is feasible and Corresponding author : a xiaogangfeng1111@163.com, b 470741286@qq.com, c 616674484@qq.com, d meqxxia@scut.edu.cn， e mewpchen@scut.edu.cn correct. However, no literature was reported about the dimensional accuracy measurement of spun parts based on machine vision.
The measurement method of dimensional accuracy based on machine vision can realize the online measurement, which lay the foundation for the intelligentialize of spinning technology. In the present work, a new measurement method of dimensional accuracy for cylindrical spun part based on machine vision was developed and experimentally tested. The image acquisition system of machine vision for cylindrical spun parts was built up and the image processing method was investigated in details. The straightness and ovality of the cylindrical spun part were automatically calculated.

Building up of the machine vision system
The machine vision technology mainly consists of image acquisition, image processing and data processing [3]. The image acquisition system built up to obtain the images of cylindrical spun parts is shown in Fig.1. It consists of four main components: LED light source, CCD camera, computer and software-MATLAB. Two LED light source is located above the spun part and irradiated it from two sides to obtain the clear image of the cylindrical spun parts and eliminate the shadow. The image is transmitted to the computer, and then processed by software-MATLAB. Fig.2 shows the image of cylindrical spun part obtained by the image acquisition system. Figure 2 Image of the cylindrical spun parts A standard block with the length L of 25mm is selected as the calibration object to acquire the actual length that a pixel presents. The image of the standard block is obtained by the image acquisition system, and the number of the pixels M is calculated. Therefore, the length that a pixel presents k= L/ M. For the image acquisition system built up in this study, k is 0.1975mm/pixel.

Image preprocessing
The digital image obtained by image acquisition system is RGB color image, which described the color of the pixel by intensity superposition of red, green and blue color. However, the edge extraction of color image is difficult. Therefore, the color image should be transformed to grayscale image. The greyscale value of the each pixel in the image is defines as the average of the color intensity of the three primary colors, as shown in Eq.1 [8]. Fig.3 shows the vertical and lateral views of greyscale image of cylindrical spun part, respectively.
where the f(i, j) is the greyscale value of the arbitrary point in the image. R(i, j), G(i, j), B(i, j) are the intensity of the red, green and blue color respectively.
(a) Vertical view (b) Lateral view Figure 3. Greyscale image of cylindrical spun part The noise is generated during the image acquisition and transmission, which makes the image not clear. Therefore, the de-noising processing is necessary. The photon noise and current noise should be considered during the image processing of the cylindrical spun part. These noises can be eliminated by spatial filtering. The method of noise elimination mainly includes mean filtering and median filtering. The edge of the image after media filtering is clearer than that of mean filtering, which is benefit for the edge extraction [3]. Therefore, the media filtering is selected. Fig.4 shows the image of cylindrical spun part after media filtering. . Cylindrical spun part image after spatial filtering Image binarization is set the grayscale value of the pixel in the image as 0 or 255 [3]. The purpose of binarization is separated the objet and background of the image. The approach is converted the grayscale image to binary image, as shown in Eq. 2 [8].
, ( ( where g(x, y) is value of the pixel in the image after binarization, f(x, y) is the greyscale value of the arbitrary pixel point in original image, T is the threshold value. Generally, the gray histogram is used to show the overall gray distribution of the grayscale image. Fig.5 shows the grey level histogram of cylindrical spun part image. It shows that the grayscale value of the background is less than 50 and that of the cylindrical spun part is more than 50. Therefore, the threshold value is selected as 50. Fig.6 shows the cylindrical spun part image after binarization. Figure 6. Binary image of cylindrical spun part

Edge extraction
Accurate extracting the edge information of the cylindrical spun part is the key to measure its dimensional accuracy. The grayscale gradient of the binary image is small parallel to the edge of the spun part, and that is large along the direction perpendicular to the edge of the spun part. Therefore, the criterion of edge detection and extraction can select the grayscale gradient reaching maximum or its second derivative is zero.
For continuous image functions, the grayscale gradient in arbitrary point (x, y) can be described as follows [8]: The magnitude and direction of the grayscale gradient are as follows [8]: y) is the angle between the gradient vector and the X-axis. The edge detectors mainly include Sobel edge detector, Prewitt edge detector and Canny edge detector. Fig.7 shows vertical view of the edge contour of the cylindrical spun part extracted by Sobel edge detector, Prewitt edge detector and Canny edge detector respectively. It shows that the contours of the spun parts extracted by Sobel edge detector are simple contours with a single pixel width. The contours extracted by Prewitt edge exist partial contours with multi-pixel. The most complete contours can be extracted by Canny edge detector. Therefore, the Canny detector is selected for edge extraction in this study. Fig. 8 shows the lateral view of the edge of cylindrical spun parts extracted by Canny detector.

Straightness calculation
The straightness e s is defined as the distance of the two nearest parallel planes, and the arbitrary generatrix on the outer surface of the workpiece is located between these two planes.
The date processing method of obtaining the straightness consists of the following stages: firstly, the starting point of straight line is obtained by Hough transform line detection, and the end point is calculated by the straight slope and the dimension of the spun part. Then the contour line is retrieved out by loop algorithm and saved as single pixel contour point set. Finally, the contour line of the spun part is obtained by linear fitting of the contour points based on least square method, and the distance from each point to the fitting straight line is calculated as shown in Eq.5. e s of the cylindrical spun part equals to the difference between the maximum and minimum of the distance. 2 1 k where k is the slope of the fitting line, b is the intercept of the fitting line. The straightness of the cylindrical spun part are 0.19 mm and 0.21mm calculated by the proposed method and manual measurement, respectively. The relative error is only 9.5%.

Ovality calculation
Ovality e o refers to the degree of the cross section of the workpiece approaching to the theoretical circle. e o is defined as the radius difference of the two nearest concentric circles, and the arbitrary point on the outer surface of the workpiece is located between these two concentric circles. The center of the concentric circles is determined by the least squares circle method.
The date processing method of obtaining the ovality consists of the following stages: firstly, the outer circle contour with single pixel of the cylindrical spun part is retrieved by loop algorithm and saved as outer contour point set(x, y). Then, the center of the outer contour is obtained by least squares fitting of the point set (x, y), which acted as the polar point in the polar coordinates. Finally, the Cartesian coordinate point set (x, y) is converted to polar point set (θ, r) by the function of [theta, rho]=cart2pol(x, y) in software-MATLAB. e s of the cylindrical spun part equals to the difference between the maximum and minimum of the polar distance .
The average values of the outer circle radius calculated by the proposed method and manual measurement are 29.00 mm and 29.02 mm, respectively. The ovality of the cylindrical spun part calculated by the proposed method and manual measurement are 0.77mm and 0.70mm calculated by the proposed method and manual measurement, respectively. The relative errors are both less than 10%. It indicates that the dimensional accuracy measurement method based on the machine vision can be considered as reliable.

Summary
A new method of measuring the dimensional accuracy of the cylindrical spun parts based on machine vision is proposed in this study. An experimental investigation is carried out to draw the following conclusions: (1) The Dimensional accuracy of the cylindrical spun parts can be obtained accurately by the proposed measurement method based on machine vision.
(2) The relative errors of the straightness and ovality between the machine vision and the manual measurement are less than 10%.