A tool wear region timing positioning and motion compensation tracking method and system
By improving image quality screening and feature fusion techniques, combined with a circular motion model, the problems of image blurring and tracking drift under spindle rotation conditions in tool wear monitoring by machine vision were solved, achieving high-precision temporal positioning and stable tracking of wear areas.
Patent Information
- Application Number
- CN202611655040.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-26
- Publication Date
- 2026-11-24
AI Technical Summary
Existing machine vision technology is difficult to adapt to the spindle rotation condition in tool wear monitoring, resulting in blurred images, noise interference, misjudgment of wear area identification, and tracking drift, making it impossible to achieve accurate temporal positioning and stable tracking.
High-quality images are selected by improving gradient variance clarity and illumination uniformity. Oriented gradient histograms and temporal gradient curves are constructed. Combined with logistic regression models and circular motion models, adaptive search and stable tracking of wear areas are achieved.
It effectively reduces noise interference, improves the accuracy of temporal positioning and dynamic tracking stability of the wear area, and enhances the accuracy of wear feature extraction and tracking efficiency.
Smart Images

Figure CN123160621A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of machine tool condition monitoring and machine vision technology, and particularly relates to a method and system for timing positioning and motion compensation tracking of tool wear areas. Background Technology
[0002] The statements in this section are merely background information related to the present invention and do not necessarily constitute prior art.
[0003] In metal cutting processes, tool wear directly affects workpiece machining accuracy, surface quality, and production efficiency. Achieving accurate online monitoring of tool wear is a key aspect of intelligent manufacturing. Non-contact wear detection based on machine vision offers advantages such as high detection speed, rich information dimensions, and no downtime, attracting widespread attention in the industry. However, in actual machining scenarios, the machine tool spindle rotates continuously, and the tool moves in a circular motion with the spindle. The image sequences acquired by the vision system are prone to problems such as motion blur, viewpoint shift, sudden changes in illumination, and obstruction by chips and cutting fluid, posing a significant challenge to the temporal recognition and stable tracking of wear areas.
[0004] Most existing visual monitoring solutions focus on acquiring images when the tool is stationary and the machine is stopped, making it difficult to directly adapt to online conditions with rotating spindles. First, the original acquired images contain a large number of blurry, overexposed, and invalid frames. Current technologies lack dedicated image filtering mechanisms for rotating scenarios; directly inputting these frames into the algorithm not only wastes computational resources but also significantly reduces the accuracy of subsequent positioning and tracking due to the noise. Second, the start and end frames of the wear evolution sequence are generally determined manually or through simple inter-frame differencing. Manual calibration is highly subjective and cannot meet the needs of automated online monitoring; inter-frame differencing algorithms are easily affected by global image motion caused by spindle rotation, leading to frequent misjudgments and making it difficult to accurately capture the time points when wear begins to occur and stabilizes.
[0005] Furthermore, current tool wear tracking methods often directly reuse general target tracking algorithms without considering the rigid body motion characteristics of the tool spindle. These general algorithms lack motion compensation constraints, making them prone to tracking drift and target loss under positional shifts caused by continuous rotation and local deformation disturbances, thus failing to maintain continuous contour-level tracking performance. Summary of the Invention
[0006] To overcome the shortcomings of the prior art, this invention provides a method and system for timing positioning and motion compensation tracking of tool wear areas. Based on continuous images acquired by the machine tool's built-in vision perception system, a complete process technology system is constructed to achieve accurate timing positioning and stable dynamic tracking of the wear area.
[0007] To achieve the above objectives, one or more embodiments of the present invention provide the following technical solutions: The first aspect of this invention provides a method for timing positioning and motion compensation tracking of tool wear areas; A method for time-series localization and motion compensation tracking of tool wear areas includes: The original image sequence of the tool edge during the spindle rotation process is acquired and the region of interest is extracted. High-quality image sequences are selected by weighting based on sharpness and illumination uniformity. A directional gradient histogram is constructed frame by frame for a high-quality image sequence. The gradient feature difference between adjacent frames is calculated and smoothed by sliding Gaussian weighted smoothing to obtain the temporal gradient curve. With the wear-free baseline value as a reference, the initial wear frame is located by peak decision. Construct a multidimensional wear feature vector, input the logistic regression model to output the probability of the termination frame, combine the likelihood ratio of multiple consecutive frames to determine the termination frame, and extract the effective wear evolution image sequence. Within an effective wear evolution image sequence, the location of the wear area is predicted based on a circular motion model. An adaptive search window is constructed, and stable tracking of the wear area is achieved through normalized cross-correlation matching and energy minimization boundary correction.
[0008] As a further technical solution, the original image sequence of the tool edge during spindle rotation is acquired and the region of interest is extracted. High-quality image sequences are then selected by weighting clarity and illumination uniformity, including: The machine tool's built-in vision perception system continuously acquires images of the tool cutting edge during spindle rotation. The Region of Interest (ROI) where the tool cutting edge is located is extracted through calibration to obtain the original image sequence. An improved gradient variance operator is used to calculate the sharpness evaluation value of each frame of the image, and the illumination uniformity evaluation value of each frame of the image is calculated based on the dispersion of gray-level distribution in the ROI region. The sharpness evaluation value and the illumination uniformity evaluation value are weighted and fused into a comprehensive quality score. High-quality frames are obtained by setting a quality threshold, resulting in a high-quality image sequence.
[0009] As a further technical solution, the improved gradient variance operator is used to calculate the sharpness evaluation value of each frame of image, specifically as follows:
[0010] In the formula, For the first Frame image sharpness evaluation value; This represents the total number of pixels in the tool's ROI region. , These represent the width and height of the ROI region, respectively. , The image at pixel coordinates The horizontal and vertical gradients at the location; The calculation of the illumination uniformity evaluation value for each frame of the image based on the dispersion of the gray-level distribution in the ROI region is specifically as follows:
[0011] In the formula, For the first Illumination uniformity of frame image; This represents the average grayscale value of all pixels within the ROI region. represents the standard deviation of grayscale values for all pixels within the ROI region.
[0012] As a further technical solution, the gradient feature difference between adjacent frames is calculated and smoothed using a sliding Gaussian weighted method to obtain the temporal gradient curve, including: The difference between histograms of adjacent frames is calculated using Manhattan distance, as follows:
[0013] In the formula, For the first Frame relative to the first Gradient feature difference of frames; The number of directional bins in the oriented gradient histogram; A smooth temporal gradient curve is constructed by applying a moving Gaussian weighted average to the dissimilarity series:
[0014] In the formula, For the time-series gradient curve at the 1st The value of the frame; Half the width of the sliding window; These are the Gaussian weighting coefficients.
[0015] As a further technical solution, a multi-dimensional wear feature vector is constructed. The probability of the termination frame is output through an input logistic regression model. The termination frame is determined by combining the likelihood ratio of multiple consecutive frames, and an effective wear evolution image sequence is extracted, including: By integrating directional gradient features, grayscale statistical features, and texture features, a wear feature vector is constructed. The wear feature vector is input into a pre-trained logistic regression binary classification model, which outputs the predicted probability of the termination frame:
[0016] In the formula, For the first The predicted probability that the frame is the terminating frame; For the first The wear feature vector of the frame; This is the feature weight vector, with the same dimensions as the feature vector; For model bias terms; Calculate the likelihood ratio of consecutive frames ending with the current frame. When the likelihood ratio exceeds the set threshold for the first time and the frame number is later than the initial frame, the frame is determined to be the termination frame, and the effective wear evolution image sequence from the initial frame to the termination frame is extracted.
[0017] As a further technical solution, the location of the wear area is predicted based on a circular motion model, and an adaptive search window is constructed. After normalized cross-correlation matching and energy minimization boundary correction, the following steps are taken: Based on the coordinates of the center of the wear area in the initial frame, the coordinates of the tool rotation center, and the tool rotation angle in the current frame relative to the initial frame, the center position of the wear area in the current frame is predicted using a rigid body circular motion model. Using the predicted position as the center of the window, the size of the search window is dynamically adjusted according to the tracking confidence of the previous frame to construct an adaptive local search window; Within the search window, a normalized cross-correlation algorithm is used to match the current frame window region with the initial frame wear template. The coordinates corresponding to the maximum correlation coefficient are taken as the actual center of the wear region, and this maximum value is used as the tracking confidence of the current frame. An energy minimization model containing shape and edge constraints is constructed, and the corrected wear region boundary is obtained by solving the model.
[0018] A second aspect of the present invention provides a timing positioning and motion compensation tracking system for tool wear areas.
[0019] A tool wear area timing positioning and motion compensation tracking system includes: The tool status image sequence construction module is configured to: acquire the original image sequence of the tool cutting edge during spindle rotation and extract the region of interest, and filter high-quality image sequences by weighted selection of sharpness and illumination uniformity; The temporal gradient initial frame localization module is configured to: construct a directional gradient histogram frame by frame for a high-quality image sequence, calculate the gradient feature difference between adjacent frames and obtain a temporal gradient curve by sliding Gaussian weighted smoothing, and locate the initial wear frame by peak decision with the wear-free baseline value as a reference. The logistic regression termination frame determination module is configured to: construct a multi-dimensional wear feature vector, output the termination frame probability by inputting the logistic regression model, determine the termination frame by combining the likelihood ratio of multiple consecutive frames, and extract the effective wear evolution image sequence. The wear region dynamic tracking module is configured to: predict the location of the wear region based on a circular motion model within an effective wear evolution image sequence, construct an adaptive search window, and achieve stable tracking of the wear region through normalized cross-correlation matching and energy minimization boundary correction.
[0020] A third aspect of the present invention provides a computer-readable storage medium having a program stored thereon, which, when executed by a processor, implements the steps of a tool wear area timing location and motion compensation tracking method as described in the first aspect of the present invention.
[0021] A fourth aspect of the present invention provides an electronic device, including a memory, a processor, and a program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of a tool wear area timing positioning and motion compensation tracking method as described in the first aspect of the present invention.
[0022] The fifth aspect of the present invention provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps in the tool wear area timing positioning and motion compensation tracking method described in the first aspect of the present invention.
[0023] The above one or more technical solutions have the following beneficial effects: (1) This invention constructs a two-dimensional quality evaluation system by using an improved gradient variance sharpness operator and an illumination uniformity index, and then weights and fuses them into a comprehensive quality score for threshold screening. This can adaptively eliminate low-quality frames caused by motion blur, local reflection, and uneven illumination under the spindle rotation condition. This technique effectively reduces the computational redundancy of subsequent positioning and tracking, while avoiding the impact of noise interference on wear feature extraction, providing a high-quality and highly reliable input data foundation for temporal positioning and dynamic tracking.
[0024] (2) This invention highlights the edge contribution of the main direction of the cutting edge and suppresses background random noise by using a directional gradient histogram. It constructs a temporal gradient curve by combining Manhattan distance and sliding Gaussian smoothing, and uses the no-wear baseline value as a reference for peak determination, thereby achieving automatic and accurate positioning of the initial frame and avoiding subjective errors from manual calibration. At the same time, a multi-dimensional feature vector integrating gradient, grayscale and texture features is input into the logistic regression model. The termination frame is determined by combining the likelihood ratio of multiple consecutive frames. It can adapt to different wear rate conditions without the need for preset observation time, and the stability and accuracy of the determination are significantly improved.
[0025] (3) The present invention predicts the center position of the wear area based on the rigid body circular motion model, which reduces the search range from global to local, greatly improves the tracking efficiency and reduces background interference; the size of the search window is dynamically adjusted by tracking confidence, taking into account both tracking speed and robustness; sub-pixel level position tracking is achieved by normalized cross-correlation matching, and the shape consistency and edge fit are constrained by the energy minimization model, which effectively overcomes the deformation and viewpoint shift caused by the main axis rotation, and achieves continuous, stable and high-precision tracking of the wear area.
[0026] Advantages of additional aspects of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description
[0027] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.
[0028] Figure 1 This is a flowchart of the method in the first embodiment.
[0029] Figure 2 This is a schematic diagram showing the experimental results comparing the method of the present invention in the first embodiment with other methods.
[0030] Figure 3 This is a system structure diagram of the second embodiment. Detailed Implementation
[0031] It should be noted that the following detailed descriptions are exemplary and intended to provide further illustration of the invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.
[0032] It should be noted that the terminology used herein is for the purpose of describing particular implementations only and is not intended to limit the exemplary implementations of the present invention.
[0033] Where there is no conflict, the embodiments and features in the embodiments of the present invention can be combined with each other.
[0034] Example 1 This embodiment discloses a method for timing positioning and motion compensation tracking of tool wear areas; like Figure 1 As shown, a method for time-series localization and motion compensation tracking of tool wear areas includes: Step S1: Acquire the original image sequence of the tool edge during the spindle rotation process and extract the region of interest. Filter the high-quality image sequence by weighting the sharpness and illumination uniformity.
[0035] S11 continuously acquires tool edge images during spindle rotation using the machine tool's built-in vision perception system, forming a raw image sequence. To eliminate interference from irrelevant areas such as the machine tool background and chips, and to improve computational efficiency, the region of interest (ROI) where the tool edge is located is pre-extracted through calibration. All subsequent quality evaluation and feature calculations are performed within the ROI region.
[0036] Suppose the original continuous image sequence obtained from the acquisition is:
[0037] in, This represents the total number of frames in the original sequence. For the first ROI region of the frame image .
[0038] S12, under rotating conditions, motion blur is the most significant form of image quality degradation. The core feature of tool wear is the fine edge of the cutting edge. Blur will directly lead to the loss of edge features. Therefore, sharpness is the primary indicator for quality evaluation.
[0039] Traditional gradient sharpness operators simply calculate gradient magnitudes, lacking sensitivity to subtle wear edges. This embodiment employs an improved gradient variance operator, amplifying the contribution of edge pixels through the square of the gradient sum, making the impact of minute wear edges on sharpness scores more significant and better suited for quality assessment in tool wear scenarios. Specifically:
[0040] In the formula, For the first Frame image sharpness evaluation value; This represents the total number of pixels in the tool's ROI region. , These represent the width and height of the ROI region, respectively. , The image at pixel coordinates The horizontal and vertical gradients at the location.
[0041] This step calculates the sharpness quantification value for each frame of the image, which will then be used in the quality fusion calculation along with the illumination uniformity.
[0042] S13. In the machine tool environment, factors such as the angle shift of the ring light source, local reflection on the tool surface, and cutting fluid splashing can all cause uneven image illumination, which can also interfere with the extraction of wear features. Therefore, it is necessary to supplement the evaluation of the illumination uniformity dimension.
[0043] Furthermore, the uniformity of illumination can be measured by the dispersion of grayscale distribution in the ROI region: the smaller the standard deviation of grayscale, the more concentrated the grayscale distribution and the more uniform the illumination; conversely, the greater the fluctuation of illumination.
[0044]
[0045] In the formula, For the first The illumination uniformity of the frame image has a value range of [0,1]. The closer the value is to 1, the more uniform the illumination. This represents the average grayscale value of all pixels within the ROI region. represents the standard deviation of grayscale values for all pixels within the ROI region.
[0046] This step calculates the illumination quality quantification value for each frame of the image, forming a complementary two-dimensional quality evaluation system with sharpness.
[0047] S14. After obtaining the two independent indicators, sharpness and illumination uniformity, they need to be merged into a single comprehensive quality score so that frame selection can be completed through a unified threshold. Considering that sharpness has a greater impact on wear feature extraction, it is given a higher weight; at the same time, the sharpness indicator is normalized to eliminate the difference in units, so that the two indicators are in the same numerical range.
[0048]
[0049] In the formula, For the first The overall quality score of a frame image; the higher the score, the better the overall image quality. The maximum sharpness score across all frames in the original image sequence is used to normalize the sharpness index to... interval; , Let be the weighting coefficient, satisfying In this invention, , This highlights the dominant role of clarity in quality assessment.
[0050] After calculating the overall quality score for all frames, a quality threshold is set. It can be adjusted according to the working conditions. If a frame is selected as high-quality, it is considered high-quality and retained; otherwise, it is discarded. The final filtered high-quality image sequence is obtained as follows:
[0051] in, The number of frames after filtering satisfies This high-quality sequence will serve as input data for the initial frame localization of the next stage of temporal gradient.
[0052] Step S2: Construct directional gradient histograms frame by frame for the high-quality image sequence, calculate the gradient feature difference between adjacent frames and obtain the temporal gradient curve by sliding Gaussian weighted smoothing, and locate the initial frame of wear by peak decision with the wear-free baseline value as a reference.
[0053] The initial frame is the starting point of the wear evolution process and also the reference frame for subsequent dynamic tracking. Its positioning accuracy directly affects the accuracy of the entire evolution analysis. Traditional inter-frame difference methods are easily affected by background changes, and manual calibration is inefficient and highly subjective. This step highlights the wear edge through directional gradient features, suppresses noise through time-series curve smoothing, and finally accurately locates the initial wear frame using peak value decision.
[0054] S21, the essence of wear is the shedding of cutting edge material, which forms a new edge at the cutting edge. Therefore, gradient features are the core basis for identifying wear. To subsequently filter edges by direction, we first calculate the gradient magnitude and direction of each pixel within the ROI region, providing basic data for directional feature construction:
[0055] In the formula, For pixels The gradient magnitude at a given location reflects the strength of the edge at that position. , Pixels The horizontal and vertical gradient components at the location; The gradient direction angle has a range of values. It reflects the direction of the edge.
[0056] This step outputs the gradient magnitude and direction for each pixel, which forms the basis for constructing the oriented gradient histogram later.
[0057] S22, the main edge of the cutting edge has a clear directional characteristic, and the new edges generated by wear are also distributed along the cutting edge direction, while the gradient direction of background noise and tool surface scratches is randomly dispersed. If the omnidirectional gradient is used directly, the background noise will overwhelm the wear characteristics.
[0058] By uniformly dividing the gradient direction into multiple directional intervals (bins) and calculating the sum of gradient magnitudes within each interval, a directional gradient histogram is formed. This feature can highlight the edge contribution of the main cutting edge direction, suppress background noise from random directions, and significantly improve the discriminative power of wear features.
[0059]
[0060] In the formula, For the first Frame Image Statistical values for each direction of the container; The ROI area is the cutting edge of the tool. For the first One gradient direction interval; This is an indicator function that takes the value 1 when the condition inside the parentheses is true, and 0 otherwise.
[0061] This step outputs each frame of the image. A directional gradient histogram vector, representing the directional distribution characteristics of the wear edges in this frame in a compact vector form.
[0062] S23. After obtaining the directional gradient features of each frame, the change in wear over time can be quantified by calculating the degree of difference in features between adjacent frames. Before wear occurs, the edge structure is stable, and the difference in features between frames is small; when wear first occurs, the edge structure of the edge undergoes abrupt changes, and the difference in features between frames increases significantly.
[0063] Manhattan distance is used to calculate the difference between histograms of adjacent frames. Compared with Euclidean distance, Manhattan distance is more sensitive to changes in dimensionality and can better capture subtle changes in edge features.
[0064]
[0065] In the formula, For the first Frame relative to the first The gradient feature difference between frames; the larger the value, the more significant the change in wear edge features between two frames. The number of directional bins in the oriented gradient histogram.
[0066] This step outputs an inter-frame difference sequence, the peak position of which corresponds to the moment of abrupt change in wear characteristics.
[0067] S24, the inter-frame difference sequence obtained by direct calculation is affected by image noise, slight vibration of the main axis, and illumination fluctuations, which will generate a large number of random small fluctuations and easily cause false peaks, interfering with the initial frame positioning.
[0068] A smooth temporal gradient curve is constructed by applying a moving Gaussian weighted average to the dissimilarity sequence. The Gaussian weight is characterized by high weight at the center of the window and low weight on both sides, which can suppress random noise while preserving the true feature abrupt change points to the greatest extent.
[0069]
[0070] In the formula, For the time-series gradient curve at the 1st The value of the frame; The width of the sliding window. The Gaussian weighting coefficients satisfy... The center position of the window has the highest weight.
[0071] This step outputs a smooth temporal gradient curve, eliminating random fluctuations and providing clean temporal data for subsequent peak detection.
[0072] After obtaining the smooth temporal gradient curve in step S25, the initial wear frame corresponds to the first significant abrupt peak in the curve. To adapt to the characteristic baseline differences under different tool types and machining conditions, this step first calculates the baseline value when there is no wear at the beginning of the sequence, then finds the peak point with the largest difference from the baseline, and sets a peak threshold to eliminate interference from small fluctuations.
[0073]
[0074] In the formula, The initial wear frame number obtained from the location; The sequence number is the starting search frame number, usually set to 3, to avoid noise interference at the beginning of the sequence. The baseline value of the time-series gradient during the wear-free stage is given by the previous... frame The mean was calculated. The peak value threshold is usually set at 1.5 times the baseline value to filter out small random fluctuations.
[0075] The frame that meets the peak threshold condition and has the largest difference from the baseline is the initial wear frame. The initial frame output in this step is the starting point of the wear evolution sequence and also the reference frame for subsequent dynamic tracking.
[0076] Step S3: Construct a multidimensional wear feature vector, input the logistic regression model to output the probability of the termination frame, combine the likelihood ratio of multiple consecutive frames to determine the termination frame, and extract the effective wear evolution image sequence.
[0077] The wear process is divided into three stages: initial wear, stable wear, and rapid wear. Effective wear analysis typically focuses on the transition range from initial to stable wear. Traditional methods often extract sequences at fixed durations, which cannot adapt to different wear rates. In this step, a logistic regression model is used to output the termination probability, combined with a multi-frame likelihood ratio mechanism to improve the stability of the judgment. Specifically: S31. Gradient features alone are insufficient to fully distinguish between the wear development stage and the stable stage, as changes in wear degree are accompanied by changes in grayscale, texture, and other dimensions. Therefore, this step integrates directional gradient features, grayscale statistical features, and texture features to construct a multidimensional wear feature vector, which characterizes the wear state from multiple dimensions, providing rich and robust feature basis for subsequent classification and judgment.
[0078] The constructed multidimensional wear feature vector is as follows:
[0079] In the formula, For the first The wear feature vector of the frame, with dimension . ; The directional gradient histogram feature represents the distribution of edge directions; The average gray value of the cutting edge area. The grayscale standard deviation of the cutting edge area represents the overall brightness and contrast. The gray-level entropy of the cutting edge region characterizes the complexity of the texture; The contrast between the worn area and the background characterizes the salience of the worn area.
[0080] The multidimensional feature vector output in this step will be used as input to the logistic regression model.
[0081] S32. After obtaining the feature vector of each frame, a logistic regression binary classification model is used to learn the mapping relationship between wear features and termination state.
[0082] Logistic regression models are simple in structure, fast in computation, and output probability values with clear physical meaning, making them very suitable for online real-time monitoring scenarios. The model obtains its weight parameters through training on pre-labeled wear sequence samples; during inference, inputting the features of the current frame outputs the probability that the frame is the final frame.
[0083] In the formula, For the first The predicted probability of a frame being the terminating frame, with a value range of [value range missing]. The closer the value is to 1, the more likely the frame is to be in a stable wear phase; This is the feature weight vector, with the same dimensions as the feature vector; For model bias terms; and It was obtained through training with labeled wear sequence samples.
[0084] This step outputs the termination probability for each frame, providing basic data for subsequent multi-frame determination.
[0085] S33. The probability prediction of a single frame is easily affected by random factors (such as chip occlusion and light spots), causing fluctuations. Directly using a single-frame threshold for judgment will result in misjudgment. Therefore, this step introduces a continuous multi-frame likelihood ratio mechanism to comprehensively analyze the continuous likelihood ratio. The frame probability results are only considered as a termination frame when multiple consecutive frames show a high termination probability, significantly improving the stability and reliability of the determination, as shown in the following formula:
[0086] In the formula, For the first Frame-ending continuum The higher the likelihood ratio of a frame, the higher the confidence that multiple consecutive frames are terminating frames. The length of the continuous frame window is taken as [value]. The balance determination sensitivity and stability.
[0087] Set likelihood ratio threshold When continuous When the likelihood ratio of a frame first exceeds the threshold and the frame number is later than the initial frame, the frame is determined to be a terminated frame, i.e.:
[0088] in, The terminating frame number. This is used to extract the sequence number from... arrive The effective wear evolution image sequence will serve as the processing range for the next stage of dynamic tracking.
[0089] Step S4: Within the effective wear evolution image sequence, the location of the wear area is predicted based on the circular motion model, an adaptive search window is constructed, and stable tracking of the wear area is achieved through normalized cross-correlation matching and energy minimization boundary correction.
[0090] The core objective of this stage is to overcome the positional offset and viewpoint deformation caused by the spindle rotation within the effective wear evolution sequence, achieving continuous, stable, and high-precision tracking of the wear area. General target tracking algorithms do not consider the circular motion characteristics of spindle rotation, making them prone to drift during tracking and resulting in low global search efficiency. In this step, a circular motion model is first used to significantly narrow the search range; then, an adaptive window is used to balance efficiency and robustness; finally, an energy minimization model is used to correct boundary deformation, achieving contour-level accurate tracking.
[0091] S41, the spindle drives the tool in a rigid circular motion, and the position of the wear area in the image will shift regularly with the rotation angle. If the search is performed directly in the entire image or the entire ROI, the computational cost is high and it is easily affected by background interference.
[0092] Therefore, this step utilizes the rigid body circular motion formula to predict the approximate center position of the wear area in the current frame based on the coordinates of the wear area center located in the initial frame, combined with the tool rotation center and rotation angle. This narrows the search range from a global scope to a small local area, significantly improving tracking efficiency while reducing background interference, as shown below:
[0093] In the formula, For the first Predicted coordinates of the center of the frame wear area; The coordinates of the tool rotation center in the image coordinate system can be obtained through prior calibration. The center coordinates of the worn area in the initial frame are obtained from the initial frame positioning results; For the first The tool rotation angle of the frame relative to the initial frame. ; The spindle rotational angular velocity can be read by the machine tool CNC system or estimated through image sequences; For the first Frame acquisition time, This is the acquisition time for the initial frame.
[0094] This step outputs the predicted location of the center of the wear area, which will serve as the center of the subsequent local search window.
[0095] S42. Due to factors such as mechanical vibration, speed fluctuation, and installation error, the actual position of the wear area will deviate slightly from the predicted position. Therefore, a search window needs to be set around the predicted position.
[0096] A fixed-size window cannot balance efficiency and robustness: a window that is too small is prone to losing the target, while a window that is too large results in low computational efficiency. Therefore, this step designs an adaptive window mechanism that dynamically adjusts the window size based on the tracking confidence of the previous frame: when the tracking confidence is high, it indicates that the positional deviation is small, so the window is reduced to improve speed; when the tracking confidence is low, it indicates that the deviation may be large, so the window is expanded to avoid losing the target.
[0097]
[0098] In the formula, , The first Width and height of the frame search window; , Set the width and height of the initial search window based on the typical size of the wear area; The window adjustment coefficient is taken in this embodiment. The magnitude of the change in the control window with confidence level; For the first The confidence level of the frame tracking results, with a value range of [value missing]. The output is generated by matching the template from the previous step.
[0099] This step outputs the search window size for the current frame, with the center of the window being the predicted coordinates obtained in step 4.1. Subsequent matching calculations will only be performed within this window.
[0100] S4.3: Template Matching Position Calculation Within the search window, a normalized cross-correlation algorithm is used to match the current frame window region with the wear template of the initial frame, finding the position with the highest matching degree as the actual center of the wear region. Normalized cross-correlation is highly robust to changes in illumination and can adapt to minor fluctuations in illumination during rotation.
[0101] The maximum cross-correlation value obtained from the matching is used as the tracking confidence of the current frame and fed back to the next adaptive adjustment of the window size, forming a closed-loop window adjustment mechanism.
[0102]
[0103] In the formula: Coordinates within the search window The normalized cross-correlation coefficient at point has a range of values of . A higher value indicates a higher degree of matching. This is a template image of the worn area extracted from the initial frame; The average gray level of the template image; This is the grayscale value at the corresponding position within the search window of the current frame; This represents the average grayscale value within the current search window.
[0104] The coordinates corresponding to the maximum correlation coefficient are taken as the final tracking center of the wear area. The maximum correlation coefficient value is the tracking confidence of the current frame. This step enables position-level tracking of the wear area and outputs the center coordinates and confidence level.
[0105] S4.4, template matching can only obtain the center position of the area, while the rotation of the main axis will cause perspective deformation and angle changes in the wear area. Simply translating the template boundary cannot match the actual wear contour.
[0106] Therefore, this step constructs an energy minimization model, while introducing shape and edge constraints: the shape constraint ensures the overall consistency between the boundary and the predicted shape, avoiding significant boundary distortion; the edge constraint drives the boundary to conform to the true grayscale edge in the image, improving boundary accuracy. By solving the energy minimization problem, the corrected and accurate wear boundary is obtained, specifically:
[0107] In the formula, This is the corrected boundary of the wear area; The wear region boundary predicted by the motion model is obtained by rotation transformation from the initial frame boundary; , The weighting coefficients are used to balance shape constraints and edge constraints, respectively. In this embodiment, we take... , Prioritize ensuring edge fit.
[0108] The first term is the shape constraint, which measures the difference between the current boundary and the predicted boundary and constrains the overall shape of the boundary. The second term is the edge constraint term, which measures the sum of gradient magnitudes on the boundary and drives the boundary to move closer to the true edge with a higher gradient.
[0109] This step outputs precise wear area boundaries, achieving contour-level tracking and providing accurate regional basis for subsequent wear measurement.
[0110] S45. To quantify the tracking performance of the entire effective sequence and provide a reliable reference for subsequent wear level calculations, this step calculates the average tracking confidence of all frames within the effective sequence as an evaluation metric for overall tracking stability, as shown below:
[0111] In the formula: The average confidence level of tracking within the effective wear sequence is represented by a value. A higher value indicates a more stable tracking process and more reliable results.
[0112] This step outputs a quantitative evaluation of the overall tracking effect, which can be used to determine whether the tracking results are effective, and can also serve as a confidence weight for subsequent wear measurement results.
[0113] To verify the effectiveness of this invention, an online visual monitoring experimental platform for machine tools was built to conduct cutting comparison experiments. The experimental machine tool was a CNC turning machine, using a carbide external turning tool, and the workpiece was 45# steel. An industrial camera was built into the machine tool as the visual sensing unit, and a ring light source was configured to illuminate the cutting edge area. Continuous tool cutting edge image sequences were acquired during spindle rotation, with the spindle speed set to 800 r / min. Multiple sets of image samples were collected, representing the tool from brand-new cutting edges, initial wear to stable wear stages. The samples covered real-world working conditions such as motion blur, lighting fluctuations, localized cutting fluid obstruction, and chip interference.
[0114] The following algorithms were selected for comparison: traditional inter-frame difference method combined with kernel correlation filter tracking algorithm, inter-frame difference method combined with channel and spatial reliability tracking algorithm, and background difference method combined with minimum output square error tracking algorithm. Kernel correlation filter tracking algorithm is a classic and universal target tracking algorithm that uses directional gradient histogram features and frequency domain correlation filtering to achieve target tracking. However, this algorithm only assumes that the target undergoes planar translational motion and does not incorporate prior knowledge of the rigid body motion of the tool spindle. Under conditions of continuous tool rotation leading to viewpoint shift and cutting edge deformation, it is prone to tracking drift and can only output the target's circumscribed rectangle, failing to achieve accurate contour-level tracking of the wear area. Channel and spatial reliability tracking algorithm is better adapted to local target deformation than kernel correlation filter tracking algorithm. However, it also only models based on the assumption of planar translation and lacks prior constraints of tool circular motion, still exhibiting significant positioning deviation and tracking drift problems during spindle rotation. The minimum output square error tracking algorithm has low computational overhead and fast inference speed, but it has the weakest resistance to sudden changes in illumination and interference from cutting fluid and chips, resulting in larger temporal positioning errors and the worst contour extraction accuracy.
[0115] This experiment tested two dimensions: temporal frame positioning accuracy and wear area tracking performance. The main evaluation indicators included initial frame positioning error, termination frame positioning error, average tracking confidence, and the Dice coefficient of the wear contour. The initial / termination frame positioning error is the frame difference between the algorithm's output frame number and the manually labeled ground truth frame number; the average tracking confidence represents the reliability of the entire sequence tracking; the Dice coefficient of the wear contour represents the degree of overlap between the wear contour extracted by the algorithm and the manually labeled ground truth contour, with a value ranging from 0 to 1, and the closer the value is to 1, the higher the contour extraction accuracy.
[0116] like Figure 2 It can be seen that the traditional inter-frame difference combined with kernel correlation filtering tracking scheme is severely affected by the global motion of the spindle rotation and illumination fluctuations. The average positioning error of the initial frame is 14.2 frames, the average positioning error of the final frame is 18.7 frames, the average tracking confidence of the sequence is 0.61, and the average Dice coefficient of the wear contour is only 0.72. The inter-frame difference combined with channel and spatial reliability tracking scheme is better than the kernel correlation filtering tracking scheme in terms of adaptability to local deformation, but it does not introduce the prior of circular motion, and there are still obvious positioning deviations and tracking drifts under continuous spindle rotation. The background difference combined with minimum output square error and tracking scheme has a fast calculation speed, but it has the weakest resistance to sudden changes in illumination and cutting fluid occlusion, the largest positioning error, and the lowest contour extraction accuracy. This invention eliminates low-quality images through dual-dimensional image quality evaluation, accurately captures the moment of wear initiation based on temporal gradient curves, suppresses single-frame misjudgments by leveraging logistic regression and multi-frame likelihood ratio mechanisms, and introduces circular motion model position prediction, adaptive search window, and energy-minimizing contour constraints during the tracking phase. The average positioning error in the initial frame is reduced to 2.6 frames, the average positioning error in the final frame is reduced to 3.4 frames, the average tracking confidence is improved to 0.92, and the average Dice coefficient of the wear contour reaches 0.94. Comparative results confirm that this invention can effectively suppress noise interference, reduce temporal positioning errors, avoid tracking drift, and stably achieve temporal positioning and contour-level high-precision tracking of the tool wear area under real machining conditions with continuous spindle rotation and interference from cutting fluid and chips.
[0117] The method of this invention eliminates low-quality images through dual-dimensional image quality evaluation, accurately captures the moment of wear initiation based on temporal gradient curves, and suppresses single-frame misjudgment by using logistic regression and multi-frame likelihood ratio mechanisms. In the tracking stage, a circular motion model is introduced for position prediction, combined with an adaptive search window and energy-minimizing contour constraints. The average positioning error of the initial frame is reduced to 2.6 frames, the average positioning error of the termination frame is reduced to 3.4 frames, the average tracking confidence is improved to 0.92, and the average Dice coefficient of the wear contour reaches 0.94.
[0118] Comparative results confirm that the present invention can effectively suppress noise interference, reduce timing positioning errors, avoid tracking drift, and stably achieve timing positioning and contour-level high-precision tracking of the tool wear area under real machining conditions where the spindle is continuously rotating and there is interference from cutting fluid and chips.
[0119] Example 2 This embodiment discloses a timing positioning and motion compensation tracking system for tool wear areas; like Figure 3 As shown, a tool wear area timing positioning and motion compensation tracking system includes: The tool status image sequence construction module is configured to: acquire the original image sequence of the tool cutting edge during spindle rotation and extract the region of interest, and filter high-quality image sequences by weighted selection of sharpness and illumination uniformity; The temporal gradient initial frame localization module is configured to: construct a directional gradient histogram frame by frame for a high-quality image sequence, calculate the gradient feature difference between adjacent frames and obtain a temporal gradient curve by sliding Gaussian weighted smoothing, and locate the initial wear frame by peak decision with the wear-free baseline value as a reference. The logistic regression termination frame determination module is configured to: construct a multi-dimensional wear feature vector, output the termination frame probability by inputting the logistic regression model, determine the termination frame by combining the likelihood ratio of multiple consecutive frames, and extract the effective wear evolution image sequence. The wear region dynamic tracking module is configured to: predict the location of the wear region based on a circular motion model within an effective wear evolution image sequence, construct an adaptive search window, and achieve stable tracking of the wear region through normalized cross-correlation matching and energy minimization boundary correction.
[0120] Example 3 The purpose of this embodiment is to provide a computer-readable storage medium.
[0121] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in a tool wear area timing location and motion compensation tracking method as described in Embodiment 1.
[0122] Example 4 The purpose of this embodiment is to provide an electronic device.
[0123] An electronic device includes a memory, a processor, and a program stored in the memory and executable on the processor. When the processor executes the program, it implements the steps in the tool wear area timing positioning and motion compensation tracking method as described in Embodiment 1.
[0124] Example 5 Embodiment 5 of the present invention provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps in the tool wear area timing positioning and motion compensation tracking method as described in Embodiment 1.
[0125] The steps and methods involved in the apparatuses of Embodiments 2, 3, 4, and 5 above correspond to those in Embodiment 1. For specific implementation details, please refer to the relevant description section of Embodiment 1. The term "computer-readable storage medium" should be understood as a single medium or multiple media including one or more instruction sets; it should also be understood as including any medium capable of storing, encoding, or carrying an instruction set for execution by a processor and enabling the processor to perform any of the methods in this invention.
[0126] Those skilled in the art will understand that the modules or steps of the present invention described above can be implemented using general-purpose computer devices. Optionally, they can be implemented using computer-executable program code, thereby allowing them to be stored in a storage device for execution by a computer device, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. The present invention is not limited to any particular combination of hardware and software.
[0127] While the specific embodiments of the present invention have been described above in conjunction with the accompanying drawings, this is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art without creative effort based on the technical solutions of the present invention are still within the scope of protection of the present invention.
Claims
1. A tool wear region timing positioning and motion compensation tracking method, characterized in that, include: The original image sequence of the tool edge during the spindle rotation process is acquired and the region of interest is extracted. High-quality image sequences are selected by weighting based on sharpness and illumination uniformity. A directional gradient histogram is constructed frame by frame for a high-quality image sequence. The gradient feature difference between adjacent frames is calculated and smoothed by sliding Gaussian weighted smoothing to obtain the temporal gradient curve. With the wear-free baseline value as a reference, the initial wear frame is located by peak decision. Construct a multidimensional wear feature vector, input the logistic regression model to output the probability of the termination frame, combine the likelihood ratio of multiple consecutive frames to determine the termination frame, and extract the effective wear evolution image sequence. Within an effective wear evolution image sequence, the location of the wear area is predicted based on a circular motion model. An adaptive search window is constructed, and stable tracking of the wear area is achieved through normalized cross-correlation matching and energy minimization boundary correction.
2. A tool wear zone timing positioning and motion compensation tracking method according to claim 1, characterized in that, Acquire raw image sequences of the tool edge during spindle rotation and extract regions of interest. High-quality image sequences are selected by weighting based on sharpness and illumination uniformity, including: The machine tool's built-in vision perception system continuously acquires images of the tool cutting edge during spindle rotation. The Region of Interest (ROI) where the tool cutting edge is located is extracted through calibration to obtain the original image sequence. An improved gradient variance operator is used to calculate the sharpness evaluation value of each frame of the image, and the illumination uniformity evaluation value of each frame of the image is calculated based on the dispersion of gray-level distribution in the ROI region. The sharpness evaluation value and the illumination uniformity evaluation value are weighted and fused into a comprehensive quality score. High-quality frames are obtained by setting a quality threshold, resulting in a high-quality image sequence.
3. A tool wear zone timing positioning and motion compensation tracking method according to claim 2, wherein, The improved gradient variance operator is used to calculate the sharpness evaluation value of each frame of image, specifically as follows: In the formula, is the first sharpness evaluation value of the frame image; is the total number of pixels of the tool ROI region; , are the width and height of the ROI region, respectively; , are the horizontal gradient and the vertical gradient of the image at the pixel coordinates , respectively. The calculation of the illumination uniformity evaluation value for each frame of the image based on the dispersion of the gray-level distribution in the ROI region is specifically as follows: In the formula, is the first illumination uniformity of the frame image; is the average gray value of all pixels in the ROI region; is the standard deviation of the gray value of all pixels in the ROI region.
4. A tool wear zone timing positioning and motion compensation tracking method according to claim 1, wherein, The temporal gradient curve is obtained by calculating the gradient feature difference between adjacent frames and smoothing it using a sliding Gaussian weighted average, including: The difference between histograms of adjacent frames is calculated using Manhattan distance, as follows: In the formula, For the first Frame relative to the first Gradient feature difference of frames; The number of directional bins in the oriented gradient histogram; A smooth temporal gradient curve is constructed by applying a moving Gaussian weighted average to the dissimilarity series: In the formula, For the time-series gradient curve at the 1st The value of the frame; Half the width of the sliding window; These are the Gaussian weighting coefficients.
5. The method for timing positioning and motion compensation tracking of tool wear areas as described in claim 1, characterized in that, A multidimensional wear feature vector is constructed, and the probability of the termination frame is output through the input logistic regression model. The termination frame is determined by combining the likelihood ratio of multiple consecutive frames, and the effective wear evolution image sequence is extracted, including: By integrating directional gradient features, grayscale statistical features, and texture features, a wear feature vector is constructed. The wear feature vector is input into a pre-trained logistic regression binary classification model, which outputs the predicted probability of the termination frame: In the formula, For the first The predicted probability that the frame is the terminating frame; For the first The wear feature vector of the frame; This is the feature weight vector, with the same dimensions as the feature vector; For model bias terms; Calculate the likelihood ratio of consecutive frames ending with the current frame. When the likelihood ratio exceeds the set threshold for the first time and the frame number is later than the initial frame, the frame is determined to be the termination frame, and the effective wear evolution image sequence from the initial frame to the termination frame is extracted.
6. The method for timing positioning and motion compensation tracking of tool wear areas as described in claim 1, characterized in that, Based on the circular motion model, the location of the wear area is predicted. An adaptive search window is constructed, and after normalized cross-correlation matching and energy minimization boundary correction, the following steps are taken: Based on the coordinates of the center of the wear area in the initial frame, the coordinates of the tool rotation center, and the tool rotation angle in the current frame relative to the initial frame, the center position of the wear area in the current frame is predicted using a rigid body circular motion model. Using the predicted position as the center of the window, the size of the search window is dynamically adjusted according to the tracking confidence of the previous frame to construct an adaptive local search window; Within the search window, a normalized cross-correlation algorithm is used to match the current frame window region with the initial frame wear template. The coordinates corresponding to the maximum correlation coefficient are taken as the actual center of the wear region, and this maximum value is used as the tracking confidence of the current frame. An energy minimization model containing shape and edge constraints is constructed, and the corrected wear region boundary is obtained by solving the model.
7. A timing-based positioning and motion compensation tracking system for tool wear areas, characterized in that, include: The tool status image sequence construction module is configured to: acquire the original image sequence of the tool cutting edge during spindle rotation and extract the region of interest, and filter high-quality image sequences by weighted selection of sharpness and illumination uniformity; The temporal gradient initial frame localization module is configured to: construct a directional gradient histogram frame by frame for a high-quality image sequence, calculate the gradient feature difference between adjacent frames and obtain a temporal gradient curve by sliding Gaussian weighted smoothing, and locate the initial wear frame by peak decision with the wear-free baseline value as a reference. The logistic regression termination frame determination module is configured to: construct a multi-dimensional wear feature vector, output the termination frame probability by inputting the logistic regression model, determine the termination frame by combining the likelihood ratio of multiple consecutive frames, and extract the effective wear evolution image sequence. The wear region dynamic tracking module is configured to: predict the location of the wear region based on a circular motion model within an effective wear evolution image sequence, construct an adaptive search window, and achieve stable tracking of the wear region through normalized cross-correlation matching and energy minimization boundary correction.
8. A computer-readable storage medium having a program stored thereon, characterized in that, When the program is executed by the processor, it implements the steps in the tool wear area timing location and motion compensation tracking method as described in any one of claims 1-6.
9. An electronic device comprising a memory, a processor, and a program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps in the tool wear area timing positioning and motion compensation tracking method as described in any one of claims 1-6.
10. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instruction is executed by the processor, it implements the steps in the tool wear area timing location and motion compensation tracking method as described in any one of claims 1-6.
