Crater wear measurement using computer vision and automatic focusing

Crater wear measurement using computer vision and automatic focusing

Journa~ of ELSEVIER Journal of Material; Processing Technology 58 (1996) 362-367 Materials Processing Technology Crater wear measurement using com...

2MB Sizes 1 Downloads 136 Views

Journa~ of

ELSEVIER

Journal of Material; Processing Technology 58 (1996) 362-367

Materials Processing Technology

Crater wear measurement using computer vision and automatic focusing Min-yang Yanga and Oh-dal Kwon b a Dept. of Mechanical Engineering, Korea Advanced Institute of Science and Technology, 373-1 Kusung-dong Yusung-gu Taejon 305-701 Korea, E_mail: myyang @ sorak.kaist.ac.kr b Dept. of Mechanical Engineering, KAIST and Assistant Manager, Samsung Electronics

Abstract In this paper we present a technique to measure the crater wear using image processing and automatic focush-ag. The new contour detection algorithm, which can adapt in a noisy image, is suggested. It is suitable for eliminating high frequency noises without blurring and with lower processing time. An automatic focusing technique is applied to measure a crater wear depth with a onedimensional search algorithm for finding the best focus. This method is implemented in the tool microscope driven by a serve motor. The results show that the contour and the depth of crater wear can be measured reliably.

Key words: Crater wear, Contour detection, Autofocusing

1. Introduction In machining processes, tool wear has a significant effect on surface quality of workpiece and machining errors. Especially, in the case of high speed nmchining, crater wear becomes considerable and if it occurs once it may end in tool failure. Therefore it is important to measure the accurate amount of crater wear. Numerous techniques of tool wear measurement have been proposed [1-2], Tool wear measurement techniques can be classified into two groups: direct and indirect. The direct methods for quantitative measurement of crater wear can also be either optical or non-optical methods [3-5]. Among these methods, the computer vision technique using image analysis has many advantages for tool wear measurement that it is easy to get an accurate amount of wear, convenient for use and comparatively fast. Recently several methods have been studied [6-8]. They are using slit projection light or diffraction grating to produce a deflected optical profile. These methods have the advantage of describing the shape of crater wear detail, but cannot be easily implemented because of their complexity and high image processing time. In this paper, a new system that can measure the crater wear of a cutting tool using computer vision techniques has been studied. To detect a shape of crater in noisy images, a new contour detection method has been developed. For obtaining the crater depth, an automatic focusing technique has been implemented with a serve system also. The experimental results proved the effectiveness of the proposed system. 09244)136196/$15.00© 1996 ElsevierS¢ien~ S.A. All rights rescued P//0924-0136 (gJ) 02208-1

2. Contour detection Contour or edge detection is a useful technique to serve a simple analysis of image by reducing file amount of data without loss of structural information. In the ease of crater wear, the crater area and its centroid and crater width can be obtained from the contour. A lot of contour detection methods have been proposed [9-10]. Some of these operators such as the Gradient or tile Lap|acian are very simple and often used. A problem encountered in contour detection of crater wear is the noise from the rake face image. The rake face may be contaminated by chips or oil, but these kinds of noises can be removed easily. What is worse, when an image of a cutting tool is focused, its texture comes out clearly so that high frequency noises become dominant. In this section, a new algorithm is introduced to eliminate high frequency noises easily for detecting the contour of the noisy image of crater wear. To attenuate the high frequency noise, low-pass filtering has been proved useful. However this operation usually results in blurring the image. To accomplish this task without blurring, image consolidation is applied.Ill] For an LxL neighborhood, consolidation is equivalent to averaging the original image over the neighberhood followed by sampling at intervals L unit apart. The intensity of the reduced image It(n, m) can be formed by that ofthe original image Io(i, j) according to the relation l

nxL+LmxL+L

Zr°¢i'J)

(1)

i=nxL j=mxL

and then the LPF and the Median filter can be convoluted. An image of the rake face on which crater exists can usually be divided into three regions. One is background, other is rake

363

Min-yang Yang. Oh-dal Kwon / dou~al oj'Matermh" Processing Technology 58 (~996) 362-367

face and the other is crater wear or fracture. In order to extract the worn region from the tool image it is impert~t to select an adequate threshold of gray level. The optimal threshold is determined with utilizing the zerotho and first-order cumulative moments of the gray-level histogram [12]. After thresholding, most of noises are cleaned and the contour is detected by the Laplaci~ zero°crossh~g method. Then, edge l ~ n g techniques have been employed to connect between broken pi×els since the contour boundary may often be broken due to the noise in the image The above-mentioned technique is useful for easy, adequate and fast detection of the contour on the rake face. To recover the accuracy, however, it is necessary to return to its original size. Since a pixel of reduced contour equals to LxL pixels of the original contour, each pixel in the reduced contour is transformed to the center pixel of LxL region discretely connected with linear lines making a closed loop. Tiffs closed loop has an uneven shape and smaller than the original size. Eight-neighborhood chain codes used for describing boundaries enable us to develop a new dilation algorithm. Since chain codes have information of input or output direction vector, the dilation can advance toward the normal direction between two vectors. However, since pixels are discrete points the normal direction is not expressed as one point so that some points inflate one or more points and others disappear. For example, CCW direction coding, this relation is shown in the Fig. 1 (b) and as follows.

Zin o out I ( 0°' skip

[

(2)

) 0 °, inplate one or more

Fig. 1 (a) shows the result for a dilatior~ operation. ~ a dilation bound is constrained in the e~e~a~ form as h~ tiffs example, the contour dilates to the form finally. Tiffs algorithm can also be extended to ~e shr~age process as switching its role. It has a great advantage of ~v~g time. Generally, when a dilation operation is applied, all the pixels of an image are participated in the process. Consequently, fine da'm to be processed is the same as an image size 512x4gO (240k). On the other hand, this algorithm uses only botmd~ coding data (l-2k), therefore the processing time can be reduced remarkably.

3.

Autofocuslng

Automatic focusing techniques have been investigated on two ways basically. One is that some kinds of optical devices are used for focusing and the other is used only camera parameters such as the distance between the lens and the image detector and focal length of the lens [13-15]. The former can measure accurately and the latter is simple to implement. In this paper, the latter is considered. 3. I. Criterion function

To recognize a point to be focused automatically, a criterion of best focus must be developed. It is known that the quality of focus is proportional to the amount of high frequency energy present in the spatial power spectrum. Several focus m ~ s ~ e operators have been proposed [14-15]. Some of focus criterion functions have been examined include Laplacian, Gradient, entropy and gray-level variance. Among these operators, the Laplacian has good performance having sharp peak as shown in Fig. 2. 1300

Grodienl

/ ,._.kop!oclo~

v

"~.2 "E

E-, co

markof skippoint

.

(a) An example of dilation processing 8.direction Chain coding

~ ~ ~

~

Zin *out = 0° one pointinflation

tzin.eut = _1350 ~ Zin'eut =45° skip the point and next pointl rl I I two pointinflation Zin • out = --90° skip the point

Zineout=

45 ° skipthe point

~ ~

~

Zin • out = 90° three point inflation

Zine°ut=135° four point inflation

,

.

.

~

0.098

Z- direction(mm) Fig. 2. Criterion evaluation on several operators The Laplacian L(x,y) is °2I V2I(x Y) = ~ T +

O2I ~2

(3)

The Laplacian can be generated by the convolution operation with the 3x3 kernels HL(X,y) in spatial domain.

(b) Schematic description of the insufficient and redundant points of dilation Fig. 1. Conception of dilation algorithm for CCW direction coding

.

0.0 -0.098

-2

L(x,y) = I(x,y) 0 HL(x,y)

1

_hi HL =

4

a-2

1

(4)

364

Min-yang Yang, Oh-dal Kwon/Journal of Materials Processing Technology 58 (1996) 362-367

Fig. 3 (a) depicts the criterion function of the Laplacian. As the X-Y table moves on Z-axis by 0.002mm the criterion function value varies in proportion to focus of the tool on the table. R can be seen the function has some small peaks due to overlapping the variance of each point value. It seems to be high fi'equency noises so a digital low-pass filter has been designed for eliminating them. A simple type ofl]R filter is given by

M M Yn=Zbixn-i+ZajYn-j i=o

(5)

j=1

Fig. 3 (b) shows the HR filter output of the criterion function. The monotonous increasing and decreasing, robust and accurate criterion function can be obtained. However, because of phase and magnitude distortion, the peak point appears after a bit time delay.

is difficult to determine the value of 8 for m ~ g efficiency. The Golden section method searches max~um point accurately but it converges local maximum in some cases. The Polynomial interpolation method converges fast and rarely local maximum but it has trouble to f'md maximum point accurately. Therefore to get robustness and accuracy, a new method that is a kind of Hybrid is developed. The Hybrid method uses the HR filtered Laplacian for the criterion function. Fig. 4 shows the searching procedure. First, using the Polynomial method, the two approximate maximum points can be found with the X-Y table moving t o forward direction and backward direction. The polynomial interpolation method is simply constructed any quadratic function q(c0=ao+aiC~-a2c~2 where ao, ap and a2 are the unknown coefficients. Since the function f(cQ at the arbitrary 3 points, which is the same value as the fimction q(cQ, is known three equations with three unknowns can be solved. The maximum point of the ~" on the curve q(c0 can be calculated by solving the necessary condition dq(~')/dc~=0 and verifying the sufficiency condition. 1 ¢x = - 2--~2a I

d2q if d - ~

--

~ -0.1 0 Z-direction(mm) (a) Original function value using Laplacian operator

105.-

0. . . .

-O,l

~

2a2(0

(6)

Then, the maximum point must be laid between the two approximate maximum points so the interval of uncertainty can be given as the distance between them. The next task is to start reducing the interval of uncertainty using the Golden section method. Upper and lower limits and the interval of uncertainty are given as c% = C~p, cq = ~p-2 and I = c% -c~ ! . To reduce the interval of uncertainty, two function values (%,c%) are used within the interval I that are cq = cq +0.382I, c% -- cq +0.618I by the golden ratio. Further refinement of the interval of uncertainty can be accomplished by computer program.

/

~

Interval for Rbonacci

as, I ~

0,I

Z-direction(mm)

=

f(oO' I

(b) HI( filtering of (a) with order 3 and coef. a=[O.O, 0.333, 0.0], b=[O.1667, 0.5, 0.5, O.1667] Fig. 3. Repeatability performance of Laplacian operator and its LPF output

'

Quadratlcapprox. qla)

' - ' ~ / /

Backward

lVJ~A II ' l ~ f

search

Real function

•4~ Forward direction Backward direction

3.2. Search algorithm

The optimal search algorithm for maximizing the criterion t~mc~.ion v~!ue "~s explained as follows. If the function is sufficiently smooth and unimodal, a one-dimensional optimization problem for finding maximum of the function can be applied. For this problem a step size and search direction must be determined. Several techniques to solve this problem are well known such as the Equal interval search, the Golden section search and the Polynomial interpolation method [16]. These methods have been applied to the system. As the result, several problems are discovered. Since the efficiency of the Equal interval search method depends on the initial step 8, it

Fig. 4. The searching procedure of the Hybrid method The equivalent procedure is given below. Hybrid method begin

Initialize while i = 0 to 1 d o while surpass max. point d o cL = i'8, p = 1,2,3... e n d whi~'e determine ¢zu, ai, I,~i compute ao, ap a2,...~ app. max. pt.(i) = ct

M*n-yang gang, Oh-dog Kwo~ / Jour~al of Matergats Processing Technology 58 (7996) 362-367

if i = 0 then do 8 = -1"8 end while etu = max(app, max. pt.(O),app, mar:. pt.(1)) % = mhl(app, man. pt.(O),app, max. pt.(1)) detem~e I, %, %, while I < e do if f(aa)>f(%,) fl~en max. point exist between % and %, update etj, %', P, %', %,' end if e~se if f(%)
stop

365

through the CCD camera by frame grabber wifit 256 digitized gray levels. The image is analyzed vdth the personat computer. The resolution of the system has been considered in ~uee aspects as shown in TaNe ]l. Table 1 Classification of sys{em resolution Classificaion Servo system resolution Pixel size resolution Optical device resolution

Resolution DC servo motor Harmonic drive X-Y table lead Magnifying Power Objectives /Numerical Apertures

2000pul/r 100:l 7.4m/rev 3.9 7.8 15o6 xS/0.1 x10/0.2 x20/0.4

0.037~m/pul 4.4x3.3~m 2.2xl.7~m l. lx0. g~m 3.36~m 1.68~m 0.84~m

4, Experiments The proposed experimental equipment is shown in Fig. 5. The system is composed of a microscope, an illumination unit, a CCD camera, a digital image processing unit, a measurement unit, a servo control unit and a personal computer.

Geometry ~

I PC 80486

~ ] . . ~

]

State O[tOOlwear (flank, crater,

5. Results and Discussions

In this study, investigated tool materials are P20 cemented carbide inserts without chip breaker and workpiece is a s45c steel. Crater wear tools have been obtained by machining at relatively high rates of metal removal. A series of results for contour detection is shown in the Fig. 6. Fig. 6 (a), (c) shows the comparison of an original image of crater with its reduced image, (b), (d) shows the contour detected in the reduced image and retunfing to its original size, and also shows the final contour detected by dilation operation when the bomadary limit is constrained by 70% consistency wifll file original contour. Even though ~he image has a lot of noise the worn region can be found easily using image consolidation and the final detected contour is well accord with the original one.

Lamp

~

~

. t

V~.

Tool Insert M,rror

X-Y table ] Probe Type Linear Scale

Fig. 7 shows the performance of convergency of optimal search algorithns. The Polynomial method converges within 7 steps, the Hybrid within 12 steps and the Fibonacci v.ithin 21 steps respectively. Table 2 shows the results of the accuracy test of them. For this purpose, 418 points on a grinding surface was examined. The Hybrid method has the standard deviation 1.8 and max difference 9.1grn, which is most accurate and robust among them.

Fig. 5. Experimental equipment Table 2 The results of the accuracy test of the search methods The microscope has objective lenses and a halogen lamp. The CCD camera has 512x480 pixel elements with a pixel size 17gm(H)xl3gm(V). The servo system has used PI controller and the probe type linear scale on the X-Y table has measured moving distance of the table. The tool insert is located on the XY table of the microscope driven up and down toward Z-axis by the D.C. servo motor. The camera axis is perpendicular to the X-Y table. The collimated light is projected onto the rake face of a tool. An image of the rake face of the tool is captured

Fibonacci Polynomial Hybrid "Convergency Accuracy

- s.d.

of 418 points - max. diff

21 steps

7 steps

12 steps

3. l

4.7

l .g

16.4pan

57,1~.m

9.1pro

Min.yang Yang, Oh-dal Kwon/ Journal of Materuds Processing Technology 58 (1996) 362-367

366

(c) Original image

(b) D[t{~iion of final ~oniou7 ..... Fig. 6, Results of test for crater wear

(d) Detection of final contour

350

___

-~* Fib~cci ~ -o--Polynomial - ¢ t - }l~otid

30O - - - - I / J ~

,oo _ J k

Jk

'°°,l ~0

fiX/ II

o 1

l

l

I

S

f

7

ei

fl

I0

il

ll

13 I I

15 i6

11 i l

lO i t

N u m b e r o f step

Fig. 7. The convergency performance of search methods

Automatic focusing for measurement of the crater wear depth has carried out first on the rake face and then on the maximum depth of ~rater wear where the light reflection from the crater is strongest. Then we can get the maximum depth as the differences of Z-coordinate values between rake face and crater wear. Table 3 describes the mean and the s.d. of crater wear in the case of Fig. 6. The mean value of the maximum depth could be found to be similar to the values measured by dial indicator(1/1000mm) that are 210pan and 49pro.

Table 3 Measm'ed values of tile crater max. depth (tim) No. oftest 1 2 3 4 5 6

7 8 9 10 I! 12 13 14 15 16 17 18 19 20 mean & deviation

wear 1 20910 208.2 209.7 216.9 209.2 208.8 207.7 210.7 210.9 216.4 212.9 216.9 211.6 208.2 207.4 215.3 209.6 213.8 216.0 208.8

wear 2 44.9 46.3 51.2 58.7 52.7 48.4 57.0 54.8 50.5 54.5 60.9 46.2 45.5 53.7 47.3 51.7 49.6 51.9 58.2 52.4

211.4:!:1.84

51.82+1.81

Mm-yang gang, Oh-dal Kwon / dournal of Materials Processing Technology 58 (~'996) 362-367

6. Condusion We presented a contour detection algorithm and an automatic focusing technique for measurement of crater wear and concluded as follows. A technique for detecting contours in noisy images has been developed with image consolidation and dilation. It can be applied to the crater wear and the result is in well accord with the real feature. To obtain the maximum depth of c~ater wear, we used automatic focusing algorithms and tested criterion function evaluation. The Laplacian operator with IIR filter was used as the criterion lhnction. It seemed to be unimodal and monotonous. To locate the X-Y table in best focus by the servo motor, we used Hybrid search method obtained from the quadratic approximation and the Fibonacci search as the one° dimensional search technique. It was reliable in finding the best focusing point with robustness, accuracy, and relatively fast processing time. A series of tests measuring some insert tip was proved to be accurate

Reference [1] Li Dan and J.Mathew, Tool wear and failure monitoring techniques for turning - A review, Int. J. Mach. Tools Manufact., 30(4) (1990) 579 - 598

[2] M. Shiraishi,Scope of in-processmeasurement, monitoring and controlteclmiquesin machining processesparll:inprocesstechniquesfor tools,PrecisionEngineering, 10(4) (9/1988) 179-189 [3] V.C. Venkatesh, V. Radhakrishnan and J. Chandramowli, Wear propagation in cutting tools, Amlals of the CIRP 17 (1969) 317-323 [4] R.N. Meyer, S. M. Wu, Optical contour mapping of cutting tool crater wear, Int. J. Mach. Tool Des., 6 (1966) 153-170

367

15] Kjeld Brmao Pedersen, Wear measurement of cutting tools by computer vision, Int. J. Mach Tools Manu~hct., 30( 1) (1990) 131-139 16] F. Giusfi, M. Santochi and G. Tantussi, On-tine sensing of flank and crater wear of cutting tools, ~mnals of CIRP, 36 (11987) 41--44 17] Y. Maeda, H. Uchida and A. Yamamoto, Measurement of the geometric features of a cutting tooi edge with the aid of a digital image processing technique, Precision engineering, 11(3)(1989) 165-171 [8] Hiroyuki Okarnoto and Yoh Yonezawa, Automatic measurement system for wear depth of a throwaway chip by the optical cut method, JSPE, 59 (10/1993) 61--66 [9] William K. Pratt, Digital image processing, John Wiley & Sons Inc., 2nd ed. (1991) 597---627 [10] Alberto Martelli, An application of heuristic search methods to edge and contour detection, Communications of the ACM, 19(2) (Feb. 1976) 73-83 [11] Dana H. Ballard, Christopher M. Brov,~, Computer Vision, Prentice Hall, Inc., (1982) 102-1113 [12l N. Otsu, Aflu'eshold selection method from gray level histograms, IEEE trans, System Man Cybernet., 9 (1979) 62--66 [13] Nobuyuki Akiyama, Hiroshi Makihira, Toslfihiko Nakata, Analysis for practical use of automatic focusing using stripe pattern projection technique, Int. J. of JSPE, 27(3) (1993) 229-234 [14] Eric Krotkov, Focusing, hat. J. of Computer Vision, 1 (1987) 223-237 [lsl Shree K. Nayar, Yasuo Nakagawa, Shape from focus : an effective approach for rough surfaces. Proc. IEEE Int. Conf. Robotics & Automation, 1 (1990) 218-225 I161 Jasbir S. Arora, Introduction to Optimum Design McGrawHill, Inc., (1989) 278-346