A Novel Measurement System for Mechanical Parts

In this paper, a novel measurement system simply comprising a scanner is proposed to measure the profiles of mechanical parts (MPs) fabricated by wire electrical discharge machining (EDM). The scanner is used to acquire images of MPs, and a novel measurement procedure is employed, wherein the edge bands of MP images are extracted and then break profiles are fitted and linked to achieve more accurate profiles of MPs. The Sobel filter and image processing techniques are employed to segment edge bands of the MP images. The central moment and polynomial curve fitting are then used to find break profiles in edge bands. Finally, a Bezier curve is employed to link break profiles of edge bands of the images. Experimental results show that the proposed system is accurate and can effectively yield an estimate of the profile of an MP image. This method is immediately applicable in industry to measure MPs because of its simplicity.


Introduction
Image processing is a powerful tool and is widely used to detect and measure manufacturing devices. (1)(2)(3)(4)(5) The addendum, dedendum, module, and the tooth number of a cam can all be measured by image processing techniques such as the Laplacian of Gaussian, boundary code search, and lowand high-pass filters. (6) Machine vision has been developed to estimate the geometrical image of a weld pool. (5)(6)(7)(8)(9) The subpixel method has been applied to the evaluation of cam and flank wear measurement to increase accuracy. (10) Unfortunately, edge bands often appear in the images of mechanical parts (MPs). Their possible causes are varying MP thickness, high-magnification lenses, and unoptimized image-taking conditions. Focusing through the thickness of MPs using a charge-coupled device (CCD) camera with a high-magnification lens introduces vague edge bands, and hence, measurement errors. To reduce measurement errors, we proposed a new approach that increases accuracy for MPs. The novel system can define an optimal profile for indistinct edge bands of MP images by simply using a scanner. The purposes of this study are (1) to acquire images of MPs using a scanner, (2) to extract the inside profile, outside profile, and edge bands of MP images using a Sobel filter and other image processing techniques, (3) to depict break profiles of MP images using central moment and polynomial curve fitting, and (4) to link break profiles to obtain an optimal profile of MPs using a Bezier curve.
The organization of this paper is as follows. In § 2, we describe the basic analysis and the proposed method for detecting MP profiles. The experimental results and discussions are presented in § 3. In § 4, we present the concluding remarks.

Image acquisition system
A CCD system is a traditional method for acquiring images. In general, the system includes a CCD camera with a zoom lens, a frame grabber, and a personal computer. The main disadvantage of the CCD system is its immobility because of its large size.
In this study, a novel system was designed to measure MP profiles. This system included a scanner, and a notebook computer (Intel Pentium 4 processor, 2.4 GHz) was used to detect the MP profiles, as shown in Fig. 1. The scanner was an Epson Perfection V30, which had a film scanning area of 216 × 297 mm 2 and could capture a film image with a spatial resolution of 9600 dpi. In the study, the film image was measured with a spatial resolution of 300 dpi. Images were stored in the hard drive of the notebook computer in the tagged image file format (TIF). Image processing was performed using Visual C++ 6.0 programming.

Micro-mechanical part (MMP) edge band segmentation
To obtain images of MPs, a scanner was employed. Usually, the edges of the acquired images are indistinct because of the low depth of field (DOF) of the CCD camera. Figure 2(a) shows a cam made by wire electrical discharge machining (EDM), and Fig. 2(b) shows the distribution of gray levels on the detected line D 1 D 2 . The gray levels vary from 30 to 250, which indicates the existence of an edge band (vague region) in the MP images. A thresholding method is usually used in segmenting the object from background images and results in a binary image. The size of the segmented object is determined in accordance with the threshold value. The cam size is larger when a larger threshold value is adopted and vice versa. Therefore, the cam size depends on the threshold value.
The effective segmentation of MP images is a significant procedure. The following procedures are proposed to segment the edge band of an MP image effectively. The edge of a cam image was scanned along the detection line D 1 D 2 , which crosses the object and background. The distribution of gray levels on the detection line is shown in Fig. 3. D 1 O, BD 2 , and OB lines denote the object, the edge band, and the background, respectively. The locations of O and B could be determined using the variation of gray levels along the D 1 D 2 line. The edge band can be extracted easily using a Sobel filter and the threshold-value method. The edge band of a MP image can be determined using a Sobel filter and other image processing techniques, such as a binary operation, removal of particles, hole filling, and a boundary chain code search. (11) By following the segmentation methods described below, the inside profile, outside profile, and edge band of an MP image can be segmented.
-The edge band of an MP image is determined using a Sobel operator and a threshold-value method. -Noise elimination and hole filling are applied using image processing techniques.
-The inside profile, outside profile, and edge band are extracted using a boundary chain code search.

Profile fitting
Determining the optimal profile of the MP image accurately is an important procedure. The following procedures are proposed to fit the optimal profile. The edge band is segmented into sub-bands along the normal direction of the outside profile. The total number of sub-bands is   determined in accordance with the size of the edge band. The orientation of sub-bands must be determined in the x-y plane to carry out polynomial curve fitting. The orientation is used to adopt the polynomial function forms (pff) as pff(y) = k n y n + k n−1 y n−1 + ... + k 1 y + y 0 , with coefficients r i (i = 0, 1, 2, …, m) and k j (j = 0, 1, 2, …, n). The polynomial function forms (pff) given above are determined from the central moments of the sub-bands. The central moments of 2nd order are defined as where (x, y) is the coordinate of a pixel, f(x, y) is the gray level value, and (x, y) is the central coordinate of the object. The decision algorithms for ppf are described as The relationship between the distribution of pixels and the central moments of 2nd order, M 2,0 and M 0,2 , in subareas are shown in Fig. 4. The segment lines of the profile of the MP can be found using the central moments and polynomial curve-fitting procedures.

Merging break-profile curves
The polynomials that define a curve segment (in two dimensions) are in the form of with parameter t in between the [0,1] interval. With T = [t 3 t 2 t 1 1] and the coefficient matrix C as Eq. (6) is rewritten as Bezier curves are often employed to joint points in computer graphics. There are four control points, the starting and ending tangent vectors, in a Bezier curve. The Bezier curve (12) interpolates the two end control points, P 1 and P 4 , and approximates the other two control points, P 2 and P 3 , as shown in Fig. 5. The starting and ending tangent vectors are determined by control vectors P 1 P 2 and P 3 P 4 . The terms S and E are defined as The Bezier curve equation can be represented by where the Bezier geometry vector G B consists of four control points and is written as G B = [P 1 P 2 P 3 P 4 ] T . The Bezier basis matrix M B is defined as In this study, the Bezier curve was used to establish the new link curve, which linked the two break-profile curves (A and B) in the edge band of the MP image, as shown in Fig. 6. The endpoints of curve A (P A1 and P A2 ) and curve B (P B1 and P B2 ) are taken as four control points. The new link curve can be estimated using a Bezier curve algorithm.  The algorithm for MP measurement was developed using image processing techniques, such as a Sobel filter, a boundary chain code search, central moments and polynomial curve fitting, and a Bezier curve. The measurement steps for the algorithm are shown in Fig. 7.

Results
In this research, a Sobel operator, a binary operation, removal of particles, hole filling, and a boundary chain code search were employed to extract the edge band of wire EDM cam images, as shown in Fig. 8(a). Central moments and polynomial curve fitting were used to estimate the break-profile curves of the cam image in Fig. 8(b)    the break-profile curves [ Fig. 8(b)] to establish an estimated profile of the cam image. Results obtained by the two methods were then compared. As shown in Fig. 8(c), the blue curve indicates the outside profile of the cam, and the red curve is the inside profile obtained through Soble and thresholding operations; the magenta curve is the profile estimated [ Fig. 8(d)] by the proposed method.
As an example, four cams were measured by the proposed method and the chain-code method, as shown in Table 1. The results show that the proposed method can achieve more accurate measurements than the chain-code method. Hence, the proposed method can achieve a more accurate result in the measurements of MPs.

Discussion
In general, the accuracy of measurements is proportional to the image resolution, i.e., high image resolution gives high accuracy. Under normal conditions, using the subpixel method for edge-tracing procedures increases measurement accuracy. However, such a method is not suitable for an MP with a wide edge band. In this paper, the central moment, polynomial curve fitting, and a Bezier curve were more suitable for determining the optimal profile for MPs and were as accurate as the subpixel method.

Conclusions
In this study, a novel measurement method based on a machine vision system was proposed for measuring profiles of MPs made by wire EDM. The first step was to segment the edge band of an MP image using a Sobel operator and image processing techniques. The second step was to determine break-profile curves in the edge band using central moments and polynomial curve fitting. In the final step, a Bezier curve was employed to link the break-profile curves of the edges of the MP image. The experimental results showed good accuracy and the profile of the MP could be effectively estimated. Thus, a novel system was established to measure the profile of cams. This method is immediately available for industrial applications in MP measurements; hence this study may be a useful reference for industrial tasks requiring the measurement of MPs.