1 Introduction and background

Tool wear and tool life are essential parameters in any machining operation. The metal cutting industry thrives on optimizing tool life through the selection of various process parameters of cutting. Tool fails due to fracture, adhesion, thermal stresses, or abrasion [1]. Failure of the tool due to fracture is sudden brittle failure because of excessive forces, material imperfection, interrupted cutting, or excessive vibrations of the tool and workpiece. The high temperature at the tool-workpiece interface induces thermal stresses, which causes the material to soften and leads to plastic deformation of the tool. An adhesive wear occurs due to the sticking of tool pieces to chips forming a buildup edge. An abrasive wear is caused due to friction between the cutting edge of the tool and workpiece. The thermal, adhesive, and fracture failures can be avoided by selecting appropriate tool material and cutting conditions. An abrasive wear cannot be avoided, and it determines the life of the cutting edge as the edge becomes blunt due to the continuous usage. Hence, the flank wear occurring on the tool cutting edge is gradual wear and is the most preferred tool failure because it ensures the most extended tool life [1]. So, the study of tool wear and tool life involves the analysis of different types of tool failures. Whether gradual or sudden, a tool’s failure occurs due to fracture, wear, or plastic deformations [2]. Tool wear is classified based on the physical phenomenon by which wear occurs, and the location on the tool where the wear takes place on the surfaces.

In today’s competitive world and customer-driven market, demand for high-quality products at a reduced cost is increasing day by day. Thus, the industry is striving to produce goods with high quality and lower price. Automation improves the quality of the product manufactured since it manufactures parts with high accuracy and consistent quality by automatically monitoring the parameters affecting part quality. So automation is the need of today’s manufacturing sector. With the development in hardware, computing techniques, and image processing methods, the importance of automatic monitoring of tool condition increases [3]. The industry is aiming for automation in production processes, and the need for unsupervised machining is increasing. The condition of the cutting tool directly affects the quality of the part being manufactured. These have driven researchers to propose automation of cutting tool condition monitoring. Traditionally, the tool wear is measured using a toolmaker’s microscope. However, this method is not practical as it consumes a lot of time in measurement. The industry generally follows one of the two approaches. In the first approach, the tool is used till the end of the tool life. After the tool life is over and the part quality deteriorates, the tool is discarded. This approach is used when the cost of the part is less. In another approach, the tool is prematurely discarded before tool life is over. This approach is applicable where the workpiece is costly. In either of the above said two approaches, the tool is not used optimally. One of the promising technologies for online monitoring of cutting tools is computer vision systems developed with the advances in digital image processing techniques.

One of the essential criteria in machining is tool life, as it affects the cost of machining. Using cutting tools up to their useful life saves tool cost in machining [4]. Presently, monitoring cutting tools for wear is done arbitrarily, and the tool is discarded before the tool life is reached. There are various methods proposed in the literature about monitoring tool wear and its tool life [5]. Computer vision techniques for automatic tracking of tool condition is gaining importance due to the advancement in hardware and computing techniques [6]. The damaged tools or dull tools can seriously affect the part quality and productivity of the machine. By appropriate tool condition monitoring techniques, tools can be used to their maximum level without affecting the parts’ quality. Predicting the rate of tool wear is possible based on past data or experimentation, but it is difficult to correlate it to tool life because tool life is dependent on the part requirements. The tools are discarded when they no longer produce parts with acceptable quality like dimensional accuracy and surface finish.

Dutta et al. [6] reviewed the status of image processing techniques used for monitoring tool wear. Tool wear measurement techniques were divided into two categories as direct and indirect methods. Indirect techniques use physical parameters as force developed, the power consumed, and vibrations generated to correlate with the state of tool wear. The direct method uses a tool maker’s microscope, which is an offline method, but time-consuming. The indirect online method uses images of the part’s surface having tool feed marks and analyzing it to correlate with tool wear. An online direct tool wear monitoring techniques analyses the image captured by the camera and lens system and find the amount of wear (the size of maximum flank wear in microns). The tool wear monitoring by analysis of surface texture of machined products is carried out using texture analysis of machined surfaces’ images. The following sections elaborate on the work carried out by researchers in monitoring tool wear directly using image processing techniques and indirect methods.

Byrne et al. [7] and Liang et al. [8] reported their research work on the tool condition monitoring during machining using different sensors such as accelerometer, vibrations, dynamometer, acoustics emission, temperature, etc. to improve the stability of the process, tool breakage detection, reduction of non-productive time, optimized tool usage, etc. It was also emphasized the need for improvement in knowledge acquisition (feature extraction from ambiguous or noisy data, incorporation of previously learned capabilities, etc.) and interfacing of machines and subsystems with open architecture controllers at both the hardware and software levels.

A comprehensive survey of sensor technologies, signal processing, and decision-making strategies for process monitoring was presented by Teti et al. [9]. It was discussed that an effective tool condition monitoring (TCM) system must be capable of performing sensor signal data acquisition, signal processing, features extraction and selection, and pattern recognition for decision making. The collected raw signals need to be processed by filtering, amplification, analog to digital conversion, and segmentation procedures containing a lot of useless and misleading information, including noise. Signal features can be extracted in the time domain, like statistical analysis, singular spectrum analysis, principal component analysis, etc. Feature extraction from signal using frequency domain includes fast fourier transforms, power spectrum density, time–frequency domain, etc. D’Addona et al. [10] discussed that the rapid tool wear during machining is a critical factor as it affects the quality of the machined part, tool life, energy consumption, and thus the cost of tooling. The cognitive modeling of tool wear growth based on supervised artificial neural network data processing to estimate the tool wear progression during machining of Inconel 718 was proposed. Low prediction errors were obtained for the lower cutting speeds, whereas large forecast errors were verified for the highest cutting speed value.

The monitoring of tool condition during machining of Inconel 718 using multiple sensors comprising cutting force, acoustic emission, and vibration sensing units were employed by Segreto et al. [11]. Linear Predictive Analysis (LPA) was utilized for feature extraction and to construct 4-elements feature vectors from each sensor signal specimen. The fusion of sensory data was performed by integrating either couple of sensorial data specimens. The results showed the effectiveness of a comprehensive sensor fusion approach. Segreto et al. [12] used an online sensor monitoring procedure based on the acquisition of vibration signals during machining of Ni–Ti alloys. The obtained vibration data were processed through a signal processing method in the time–frequency domain based on the wavelet packet transform (WPT). The extracted features were used to construct WPT pattern feature vectors to feed to suitably configured supervised neural networks (NN) to identify machinability conditions.

In recent work, the tool wear estimation using wavelet packet transform (WPT) signal analysis and machine learning paradigms during machining of Inconel 718 was proposed by Segreto et al. [13]. Cutting force, acoustic emission, and vibration acceleration signals were obtained using multiple sensor monitoring systems. The signals thus received were subjected to WPT decomposition to extract various signal features. The selected WPT signal features were utilized to construct different feature pattern vectors (FPV) for artificial neural networks (ANNs) for decision making on tool wear condition. It was found that the best ANNs performance were obtained with the 7-element sensor fusion WPT FPV.

The rationale of considering flank wear as a critical parameter is that the wear is gradual, and in research [6], it is generally taken as a criteria to correlate tool life. Measurement of flank wear requires two-dimensional image processing techniques. It is proposed to measure flank wear using image processing techniques and compare the same with flank wear as measured using an optical microscope. Image processing techniques are the set of mathematical operations performed to enhance or obtain useful information in an image [14]. Image is treated as a two-dimensional array of elements wherein each element represents a corresponding pixel’s intensity in an image. Image processing methods are applied in application areas like medical imaging, satellite images, automatic number plate identification, industrial process monitoring, and quality monitoring system. One of the application areas is to monitor the tool wear using image processing methods.

Lins et al. [3] studied the in-process tool wear monitoring system. The cyber-physical method was proposed in four phases of design with optimized hardware and various signals and networks implemented on the CNC machine to monitor tool wear. Castejón et al. [15] proposed an image processing framework to find the tool wear in cutting tools. Their exploration concentrated on flank wear measurement of turning inserts utilizing image processing techniques and classifying the degree of tool wear based on nine geometric parameters. Three levels of wear were discovered using a model-driven cluster investigation. The wear growth was observed for each insert during machining and given by the discriminant-analysis. The worn-out state of the tool was represented by the probability of fitting to a particular cluster. This classification of tool wear provided information about replacing the cutting insert at the right time to maintain consistency in the part quality. Tool life was improved using this methodology.

The monitoring system of wear in the drilling tool used in mining was developed by Saeidi et al. [16] using image analysis. A CCD camera was employed to take images. Fourteen images of tools were utilized to create a wear monitoring system, and the pre-processing task of removing noise from the image was carried out. Results of wear measurement were validated using a micrometer and weighing the tool. Zhang and Zhang [17] studied the tool wear measurement system using the image segmentation method. A CCD camera was used to capture images. The region of interest was determined in the image by scanning for the tool tip. Results obtained for tool wear measurement were in good agreement with manual wear measurement. D’Addona and Teti [18] examined a method to find the tool’s remaining useful life using wear measurement by applying image processing techniques. Crater wear was measured by image analysis. Various image analysis tools were applied to the tool image, converting the image to grayscale and histogram equalization for stretching contrast. The neural network model was developed using a backpropagation algorithm and was implemented on images to estimate the tool wear growth.

Many researchers [19,20,21,22,23,24,25] applied the thresholding technique to segregate the wear region from other image regions after pre-processing the image histogram. But, it is challenging to select threshold value due to a multifaceted pattern of tool wear zone. Xiong et al. [25] proposed choosing a threshold by implementing active contour for segmenting an image. The results obtained by image analysis were very close to manual measurement using a micrometer. Wang et al. [26] proposed an edge detection technique, which is not built on the threshold method, but tool wear is measured with sub-pixel accuracy. Experiments were performed with three different cutting parameters. Various techniques were applied to the tool image, which included median filtering, for removing noise in the image; histogram equalization, for contrast stretching to categorize foreground and background pixels; and Sobel operator, for edge detection. Broken edges in the image were joined using morphological operations. The wear measured by the algorithm, and manual measurement had a fair agreement. Still, the proposed algorithm’s precision is reliant on finding a reference line accurately, which in itself may not be precise. Su et al. [27] discussed measuring tool wear in micromachining by applying computer vision techniques. The wear region was separated from the background region. The edge detection and the flank wear measurement were carried out by aligning the reference line with the bottom edge of the wear zone. The precision was dependent on finding the reference bottom edge of the wear zone. An online method of successive analysis of images was developed by Wang et al. [28] to measure wear in milling cutter. High-speed cameras and low rpm of the cutter were selected to reduce the blurring of the images. The limitation of the method is that capturing the images during the actual cutting condition and preventing blurring of images is a challenging task. Liang et al. [23] suggested a method of image registration to derive tool wear. The two images of the tool wear were matched, and the wear was derived.

Sortino [21] proposed a technique that combines high and low pass filtering and statistical filtering. Since the wear zone in the image is inhomogeneous, it is difficult to apply any one algorithm, Sobel or Pivett, to detect the edge. The proposed technique was in close agreement with manual measurement. In their paper, Kim et al. [20] studied a measuring tool wear system employing a CCD camera, and the machining parameters were optimized by applying the Taguchi method. The tool wear was detected by manually aligning the wear edge with the reference line. Kurada and Bradley [29] established that radiant operators and textural operators could be applied to find out tool wear in the image. The textural method was applied in contrast to the thresholding method, and a median filter was used before performing a segmentation operation to preserve edge information. The wear region was identified by segregating a group of pixels with a particular intensity level. Nevertheless, the presence of noise in the image made segregation of pixels to identify wear zone a problematic task.

Indirect techniques correlate some physical parameters of a machine like vibration, current drawn, acoustic emissions, and images of work-piece surface textures to predict the amount of tool wear. Research is also going on correlating physical parameters change with an increase of tool wear [30]. Dutta et al. [31] observed that tool wear could be monitored by processing the image of the machined surface of the part. Image transforms and Voronoi tessellation techniques were used to extract information from the image. Due to the change in roughness and feed marks, tool wear can be correlated. In their paper, Hou et al. [32] proposed the tool wear measurement algorithm based on image matching techniques. The edges at the bottom of the wear area were segregated and then arranged by rotating within a threshold value of part of the angle to fit it and compute the wear value. The system had high accuracy, good response speed, and low effect of noise.

The tool life of the selected cutting tool is crucial, and should be estimated as accurately as possible. An artificial neural network (ANN) for automatic tool wear recognition: a set of images were standardized in grayscale and then processed to extract features for the NN training phase. And with the use of a DNA Based Computing method (DBC), the influence of user-settings on elaborating a set of images was investigated. It was concluded that the proposed DBC is robust enough to tolerate different user-defined settings without affecting its performance D’Addona et al. [33].

The precision of the tool wear measurement obtained while using indirect methods is not as good as the wear measurement precision obtained using direct techniques. Due to the noise signal observed in it, a massive data set is required to establish a correlation between tool wear and the physical parameters under observation. Image processing techniques have the edge over indirect methods as these techniques are fast and effortless for automatically detecting tool wear. Although research is carried out on the wear measurement of cutting tools built on image processing, some issues need to be investigated related to robustness, adaptability, and convenience for online tool wear monitoring. Thresholding techniques are applied after histogram processing to find the wear region in the image. But due to roughness in the tool wear region, pixel intensity varies greatly, and selecting threshold value becomes difficult. This paper presents a novel approach to measure tool wear by acquiring the wear zone image and processing it using image processing. A combined edge detection and region segmentation technique to measure flank wear is proposed, enhancing the measurement system’s precision. The methodology adopted for the work is presented graphically in Fig. 1.

Fig. 1
figure 1

The methodology adopted for the work

2 Development of tool wear measurement system

2.1 Tool wear mechanism in turning

The two main types of wearsS, namely flank wear and crater wear, can be quantified on the cutting tool. The tool wear is defined on the single-point cutting tool’s flank and rake faces. The crater wear is defined as the wear of the tool’s rake face, and it is due to the flow of chips along the rake face resulting in severe friction between the flowing chip and the rake face and leaves a scar on the rake face. The crater wear reduces the strength of the cutting edge. The crater wear is analyzed by measuring crater depth KT, as shown in Fig. 2 [34].

Fig. 2
figure 2

The pattern of tool wear [34]

The flank wear results in the formation of wear land on the cutting tool, which is not uniform along the tool’s cutting edges. Hence, to measure the flank wear, the primary cutting edge is divided into three different zones, as illustrated in Fig. 2. Generally, the average width (VBb) and maximum width (VBmax) of the flank wear land is considered for the measurement of flank wear [35]. The tool’s useful life can be defined when the value of flank wear reaches a specified dimension. The flank wear is a significant form of tool wear in metal cutting, which further affects the product’s surface integrity and dimensional accuracy. Hence, the investigation related to the study and measurement of tool wear is of much importance.

2.2 Approach of online tool wear measurement

In the proposed work, a flank wear measurement system of cutting tools used in the CNC lathe machine is developed by applying image processing techniques and automating wear measurement. Automation is one of the vital ingredients in the current manufacturing sector. High-quality products with low cost can be produced using automation, which has led to unsupervised manufacturing requirements, and has motivated researchers to automate the tool condition monitoring system. Computer vision techniques are the most promising technologies for online measurement and monitoring of cutting tool condition. After going through a literature review, it is observed that there is much opportunity for developing a commercially practical system for efficiently automating the task of tool condition monitoring.

A novel method of measuring flank wear based on computer vision techniques on the CNC lathe machine is designed. In this method, wear measurement occurs intermittently, wherein after machining, the tool arrives at a fixed designated place, and the image of the tool is captured, and wear is calculated. The proposed method is accurate but has a drawback in that it measures the wear intermittently. But since there is no interference of the machining processes during image capturing and its processing, it is more precise. During image capturing, materials like chips, coolant, etc., and machine parameters like temperature, acoustic, and vibration signals arising from machining processes do not affect the image capturing. Whereas, using the indirect technique of tool wear estimation by capturing physical parameters like vibration, the temperature is influenced by the machining processes. The flow chart showing the methodology adopted for measuring tool wear is shown in Fig. 3. It mainly includes image capturing, finding the region of interest, noise removal, edge detection, segmentation, calibration, and wear amount calculation.

Fig. 3
figure 3

Flow chart of tool wear monitoring system

2.3 Image capturing

The flank wear measurement system uses an 18MP, APS-C CMOS sensor camera to capture the wear zone images with sensor size 35.9 × 24.0 mm, 0.8 × magnification with USB interfacing. The lens with a focusing distance of 0.25 m, angle of view 45°×64° with aperture range f/3.5–22 is used. The camera with the lens is mounted on the machine for image capturing. The camera is fixed on the stand on the CNC machine, as shown in Fig. 4. For obtaining more constant conditions of the sharp contrast between the wear zone and other regions in the image, sufficient illumination of the tool area is obtained using a LED ring light and machining is carried out without using coolant. The line diagram of the experimental setup is shown in Fig. 5.

Fig. 4
figure 4

Experimental setup mounted on a CNC lathe machine

Fig. 5
figure 5

Line diagram of the experimental setup

Images of tool flank wear zone are captured after the tool turret is moved away from the machining operation and is positioned against the camera at a predefined place in the CNC lathe machine. The positional accuracy in terms of microns is achieved for capturing the images, which makes the task of the image capturing and analysis simple. The tool is positioned in such a way that a clear focus of the wear region is achieved. The light intensity is fine-tuned to get bright contrast between the background of the tool and the wear region. There is a high amount of environmental noise in the image taken because the tool wear region itself is rough, making it challenging to obtain a noise-free image of the wear zone. There are other environmental noises like dirt and dust. The tool’s wear region is cleaned with pressurized air each time before the image is captured to decrease its noise.

2.4 Image processing techniques applied for tool wear measurement

The flank wear is measured in microns (µm) by converting the distance measured in terms of the number of pixels to microns. The calibration process is carried out by considering two opposite parallel edges identified on the tool itself, and the distance between them is measured using an optical microscope. This known distance is used to calibrate the pixel distance. The fixture is developed for accurate positioning of the camera and lens. The position and orientation of the cutting tool are kept the same every time the image is captured. The positional accuracy of the cutting tool is a built-in program of a CNC lathe machine. Since the tool’s position accuracy while capturing the images is maintained, a constant magnification is achieved. The cutting tool’s thickness represented by the distance between two opposite edges of the tool is constant and known priory. So, the two cutting edges distance is used to convert distance measured in pixels to units of length. The standard grid method can be applied, but it increases computational steps. By exploiting the tool and camera’s position and orientation accuracy while capturing images, distortions can be safely neglected.

The wear region is measured by analyzing the tool images taken with a width ranging from 50 to 2000 microns. The gray scan values of this area’s image are very different from the grayscale values of other parts of the tool surface and background. This sharp change in greyscale values in the tool wear region is essential for identifying the wear region. For achieving the task of extracting wear, initially, the area of interest is located, followed by identifying edges in the wear region. The wear region is then optimized, and finally, region properties are found, which provides the amount of wear on the tool. The following paragraphs describe the tool wear identification process for coated carbide inserts mounted on the CNC lathe machine’s tool holder.

2.4.1 Determination of region of interest

The image consists of various entities and backgrounds, and this step is performed to recognize the region of interest. The image is separated into the background and foreground pixels to identify the correct area containing the wear zone. The process of identifying a region of interest begins by converting the image into a binary image to determine the tool’s tip and then extract the region of interest surrounding the tool tip. The cutting tool’s background is deliberately made light so that the histogram of the image becomes bimodal, as shown in Fig. 6.

Fig. 6
figure 6

Histogram of a grayscale image

The global thresholding techniques are generally applied to divide the image into background and foreground areas having a bimodal histogram. Looking at the image of the tool, it has the bimodal nature of the histogram. Any general thresholding algorithm converts an image into a binary image as per the following Eq. 1.

$$P\left(i,j\right)=0 \; if \; P\left(i,j\right)>T$$
$$=255 \; otherwise$$
(1)

Here T is the thresholding value selected to segment the image. The global thresholding algorithm based on the Otsu technique [36] is applied to convert a greyscale image into a binary image based on the pixel’s intensity threshold value. The algorithm selects the threshold intensity value in the image to reduce the intraclass variation of the image’s intensity values. Within class, variance is given by Eq. 2.

$${\sigma }^{2}\left(T\right)={\omega }_{b}^{2}\left(T\right){\sigma }_{b}^{2}+ {\omega }_{f}^{2}\left(T\right){\sigma }_{f}^{2}$$
(2)

where,

\({\omega }_{b} and {\omega }_{f}\)= weights of pixel values of background and foreground pixels, and

\({\sigma }_{b}^{2} and {\sigma }_{f}^{2}\)= the variance of pixel intensity values below and above the threshold.

The variance for each intensity value of a pixel is calculated as per Eq. 2 given above. The pixel’s intensity value, which offers the lowest sum of weighted amount, is chosen for thresholding the image. Then the cutting tool image is transformed into a binary image, as shown in Fig. 7.

Fig. 7
figure 7

a Original greyscale image. b Conversion of an image into a binary image

Once the image is converted to binary form, it has only two values of a pixel that is either 0 for the black portion identified as objects in the image or 255 for the white part identified as the image’s background. The next task is finding the region of interest by locating the tool’s tip in the image. The image is captured while the tool is on the turret placed in an inclined position against the camera. The tool position and orientation in the CNC lathe machine will remain the same each time the image is taken, as shown in Fig. 8. The tool tip is located by scanning the image in a downward and leftward direction starting from the top right corner in the image, sequentially scanning each row. The top right corner of the image is assumed to be a white background. The tool tip is identified when a pixel value of 0 is located during scanning.

Fig. 8
figure 8

Finding the tip of the tool in the binary image

A window surrounding the tool tip is identified, and the original image is cropped to the window size, as shown in Fig. 9.

Fig. 9
figure 9

Cropped image

Once the region of interest is found and cropped to the region of interest area, the image is transformed to a grayscale image using 8-bit intensity levels. Thus the range of intensity levels of each pixel varies from 0 to 255.

2.4.2 Finding edges in the image

The next action is finding edges of the wear region. There is a considerable variation in the intensity level in the image where the wear region is encountered. This wear region is filled with the edges where there are abrupt changes in intensity values. There are numerous edge detection algorithms proposed in the literature [21]. The Sobel edge detection algorithm is selected due to its simplicity in computational complexity and ability to detect the orientation of edges. This method calculates a pixel gradient by convoluting the image pixels with two filters, each of size 3 × 3. Each operator applied to find slope in x-direction and y-direction, respectively shown in Fig. 10.

Fig. 10
figure 10

Two filters Gx and Gy

The amount of gradient at each pixel is derived using Eq. 3.

$$G=\sqrt{{G}_{x}^{2}+ {G}_{y}^{2}}$$
(3)

2.4.3 Reducing effects of noise in the image

It is expected to obtain a precise result of tool wear measurement by reducing the image’s noise before further processing it (Fig. 11). The type of noise in the tool image is salt and paper noise, as shown in Fig. 12. The noise can be removed by blurring the region of the image where noise is present. When applying any techniques to reduce noise in the image, noise must be removed, but at the same time, image details like edges are preserved. Accordingly, the median filtering is applied to remove noise in the image, which satisfies the above conditions. These image pre-processing tasks aids in accurately identifying tool wear measurement tasks.

Fig. 11
figure 11

Edge detection using a Sobel operator

Fig. 12
figure 12

Salt and pepper noise

The filter, shown in Fig. 13, utilizes neighborhood pixel values to carry out filtering. By selecting the median value, pixel value information is not lost, unlike the averaging method, and the noise is reduced.

Fig. 13
figure 13

Finding the median value of pixel using the filter size of 3 × 3

2.4.4 Morphological operation

Morphological operations using dilation are applied to the image to complete the wear region profile. Once the wear region in the image is filled, the wear region’s geometric descriptors can be derived to measure the flank wear. Morphological operations are of various types like dilation, erosion, opening, and closing. The dilation operation is performed to complete the image’s wear region by inflating the object’s area. In turn, it fills the holes and connects the wear zone. A structuring element has a binary mask of 54 × 54 pixels, and its center pixel is selected as origin. Then it is is convoluted to the tool wear image. The structuring element convolutes with each pixel in the image and compares the structuring element’s pixel intensity value at the origin and the corresponding pixel value in the image. Whenever the neighborhood pixels of the structuring element’s origin overlaps with the corresponding image pixels, then the structuring element’s origin concerning the tool image is turned on. This process is carried out for all elements, and the resultant image is obtained, as shown in Fig. 14.

Fig. 14
figure 14

Result of dilation wear region in the image of the tool

Before applying wear measurement techniques, post-processing of the image is carried out to fill the holes in the image to complete the wear profile, and then properties of connected components can be found. Filling the gap is achieved by applying a flood filling algorithm [37], as shown in Fig. 15a, b.

Fig. 15
figure 15

a Image with holes to be filled. b Image with filled holes

2.4.5 Segmentation and wear measurement

A group of pixels continuously connects the wear zone of the tool. The wear region is separated from the background region to find the amount of wear using the connected area labeling process. It is applied to binary images, and the progressive scanning does labeling. The grouping of pixels in an image is done based on the connectivity of the pixel. The connected component in an image shares the same value of pixel intensity. The labeling of disjoint parts in an image is done to extract the wear area in it. The connectivity variable represents neighborhood pixels locations using n-connectivity to center pixel, where n is 4 or 8 for a two-dimensional image. Since the wear region has an irregular shape, eight connectivity is suitable and is selected for connected component operations.

Connected area labeling is dual-pass labeling process. The connected region of wear zone is found by labeling in the form of numbers is given to pixel location belonging to different objects in the image. Each pixel location visited is scanned iteratively. If the pixel does not have a neighbor, a new number is assigned to the pixel. In this approach, the operator of connected components labeling carries out scanning of each pixel row until it finds a pixel intensity for which B = (1). It then scans the neighbors of the said pixel. Now the labeling of the said pixel is done if the neighbors are 0; a new label is assigned. If only one neighbor has B = (1), then this neighbor’s label is attached to the current pixel being scanned. If two or more neighbors have B = (1), then one of the labels is assigned to the current pixel, and the note of the equivalences is made. Once the scanning is completed, matching label pairs are arranged into equivalence classes, and an exclusive label is assigned to each class. The second scanning of image pixel each label encountered is substituted by the label attached to its corresponding classes.

After finding the tool wear region in the image using connected components, the MATLAB® image processing toolbox is applied to find the size of a wear zone, as shown in Fig. 16. The maximum flank wear measurement in terms of the number of pixels is obtained, which is then transformed into microns’ length using calibrated value.

Fig. 16
figure 16

Flank wear region in the image

3 Experimental verification

The algorithm developed can measure the maximum flank wear (VBmax), as shown in Fig. 16. The tool wear monitoring system is developed using imaging hardware and MATLAB® software to calculate the maximum flank wear on the CNC lathe machine. The image of the wear zone of the tool is taken.

3.1 Experimental details

Experiments have been conducted on a CNC lathe machine (HMT Starturn) to verify the proposed approach’s applicability. Commercially available Inconel 718 (ASTM SB 637) is utilized as workpiece material with a dimension of 60 mm diameter and 300 mm length. This material is a nickel-based alloy with excellent thermo-mechanical properties with broad applications in various industrial sectors such as aerospace, nuclear, etc. In turning tests, PVD-TiAlN/TiN coated carbide tool (ISO designation: CNMG 120408) is utilized with a tool holder with ISO designation PCLNR2020M12. An optical microscope (Make: Radical Instrument, India) equipped with a camera and an image analysis software with the magnification of 20X–50X has been utilized to monitor the tool wear after each experimental test. The maximum flank wear (VBmax) is considered for comparison.

It is understood that a well-designed experimental design can reduce the efforts and time. Hence, in this work, the experiments have been designed using Taguchi L9 orthogonal array. Three cutting parameters, namely cutting speed, feed, and depth of cut, with three levels each as shown in Table 1. The levels of parameters are selected based on the literature review and trial machining experiments.

Table 1 Process parameters with their levels

The design matrix with three parameters with three-level is as shown in Table 2.

Table 2 Experimental design with L9 orthogonal array

Each time the tool’s image is captured, the tool position and orientation are kept the same because of the high positional accuracy in the CNC lathe machine. Thus, the process of determining the region of interest is simple. The global thresholding algorithm is applied to the histogram’s bimodal nature, and the image is converted into black and white. The image scanning is carried out to determine the tool tip, and the region of interest is derived. The process of edge detection and image segmentation is performed. The pixels are dilated using morphological operations, and holes in the wear zone are filled in the image. The connected region of the image wear zone is determined. The wear measurement is found by deriving the properties of connected components. With the aid of calibration of the image, the maximum flank wear in microns is attained.

For each value of flank wear measurement by the algorithm, three readings are taken, and the average of the three readings is recorded, as shown in Table 3. Manual measurement of the flank wear using a toolmakers microscope is compared with the image processing algorithm’s results. The results of the measurements are given in Table 3 and Fig. 17.

Table 3 Comparison of manual measurement and measurement by the proposed method
Fig. 17
figure 17

Comparison of wear size measured manually and by the newly developed algorithm

The comparison presented in Fig. 17 and Table 3 shows that the measurement value obtained manually through the optical microscope and the proposed algorithm’s value is almost the same. The variation in the measurement of wear done manually and by the algorithm is 4.79%. The developed system of computing the flank wear can help find the maximum flank wear in CNC turning machine. The system can easily be integrated with the CNC turning center and aids in optimum use of the cutting tool. The task of monitoring the tool wear is simplified by using the newly developed system. This system is useful for fully automating tool monitoring in machining and optimizing the tool’s use without affecting part quality. The combined approach of edge detection and area segmentation effectively calculated the amount of flank wear.

Figure 18 represents the main effect plot for flank wear. It can be seen from the plots that the tool wear is varied with the machining parameters, and it is significantly affected by cutting speed and depth of cut. Minimum flank wear has resulted in a lower value of cutting speed (80 m/min) and depth of cut (0.5 mm). However, higher cutting speed and depth of cut have resulted in increased tool wear and reduced tool life. In actuality, higher cutting speed surges higher cutting temperature in the machining zone and results in rapid tool wear. A similar trend in the form of an increase in tool wear with a change in depth of cut is observed. The trend is observed because, during dry machining, a higher amount of heat is generated between tool-work and chip-tool interface, which results in rapid tool wear with the increase in cutting speed and depth of cut. However, a change in feed value doesn’t significantly affect the tool wear due to shorter contact time between tool and workpiece with higher feed during machining.

Fig. 18
figure 18

Main effect plots for tool wear

3.2 Future scope of work

The developed tool wear measurement system can be modified to measure the flank wear for other CNC machines. Further combination of wear measurement and wear prediction techniques can be proposed to provide the user with calculating the tool’s remaining useful life. The proposed system measures two-dimensional flank wear. This work can be extended to measure three-dimensional wear like crater wear or crater area.

4 Conclusions

Efforts have been made to develop a direct tool wear measurement system by applying image processing techniques. Following important conclusions are drawn from the study:

  1. 1.

    A tool wear measurement system is proposed, which integrated both hardware and software systems to identify flank wear on the carbide inserts mounted on the CNC lathe machine. The system consisted of a CMOS camera and other devices for effectively capturing the images of the tool wear zone. A tool wear measurement algorithm is developed to identify the amount of wear from the images captured automatically.

  2. 2.

    The tool wear monitoring system investigated the process of determining maximum flank wear measurement of the cutting tool on the CNC lathe machine. Since the CNC lathe machine has good positional and orientation accuracy, the image capturing task and finding the region of interest is simplified.

  3. 3.

    Noise reduction in the tool image is performed, and image segmentation is done to identify the wear region. Morphological operation is done to find out connected components. The properties of connected components are derived to find out maximum flank wear.

  4. 4.

    The variation in the derived value of tool wear and manual measurement is in reasonable agreement with a maximum error of around 4.79%. The average absolute values of difference in manual measurement and measurement by the software are less than 0.016 mm.

  5. 5.

    The advantage of using the proposed method for wear measurement is to automate wear monitoring and to achieve optimum use of the tool, which can save the machining cost with the consistent quality of surface finish is obtained. A robust lighting system is required to accurately and precisely process the images of tool wear using an image processing algorithm because the tool surface itself has a noise like rough surface, dirt, or dust. Hence, the proper illumination of the wear region is vital in developing a robust algorithm. The LED ring light illuminated the tool wear region, which provided precise and accurate results through the algorithm.