A magnetic force polishing state detection method and device based on machine vision and a medium

By aligning the dynamic images of the contact area between the magnetic brush and the workpiece in time and space, extracting the boundary perturbation rate and generating a trajectory coverage heatmap, and combining it with a random forest model, the problems of response lag and undercoverage identification in magnetic polishing inspection are solved, enabling real-time monitoring and accurate compensation, and improving the stability and quality of the polishing process.

CN121083403BActive Publication Date: 2026-03-31DONGGUAN ZHONGJIN NEW ENERGY TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-20
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

Existing magnetic polishing detection methods struggle to quantitatively track the dynamic process of brush boundary disturbances over time, resulting in delayed responses to polishing anomalies. Furthermore, the determination of area coverage relies on image grayscale or simple statistical features, failing to accurately identify and compensate for under-covered areas.

Method used

By acquiring dynamic images of the contact area between the magnetic brush and the workpiece, aligning them in time and space, extracting the upper boundary of the magnetic brush and calculating the disturbance rate, generating a trajectory coverage heatmap, and combining it with a random forest model to generate real-time magnetic polishing risk level labels, adjusting the magnetic field strength and generating polishing supplementary trajectories.

Benefits of technology

It enables real-time monitoring and dynamic response of the magnetic polishing process, accurately identifies the polishing status and implements regional compensation, forming a closed-loop feedback control mechanism, which improves the stability and quality of the polishing process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121083403B_ABST
    Figure CN121083403B_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on machine vision's magnetic force polishing state detection method, equipment and medium, it is related to surface processing quality control technical field, including the dynamic image of the contact area of magnetic brush and workpiece is collected, obtains the image sequence of the contact area of magnetic brush and workpiece, extracts and smooths the upper boundary of magnetic brush, constructs the time series of upper boundary disturbance rate of magnetic brush;Magnetic brush trajectory coverage heat map is constructed, under-coverage, over-coverage and normal coverage area are divided, and area coverage index is calculated;Fusion upper boundary disturbance rate time series of magnetic brush and area coverage index, construct magnetic force polishing state feature vector, train random forest model, generate real-time magnetic force polishing risk grade label, adjust magnetic field intensity, obtain magnetic brush polishing supplement point set, generate magnetic brush polishing supplement trajectory.Magnetic force polishing process is quantified tracking in real time to the disturbance state, accurately identify magnetic force polishing state and implement regional compensation, improve polishing quality and process stability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of surface processing quality control technology, and in particular to a method, equipment and medium for detecting the state of magnetic polishing based on machine vision. Background Technology

[0002] In the field of precision parts surface quality control, magnetic polishing is widely used in the processing of complex curved surfaces and micro-structures. However, magnetic polishing is prone to uneven coverage or local over-polishing. To improve the process stability of magnetic polishing and ensure the surface quality of the workpiece, magnetic polishing usually adopts an image perception mechanism. This involves using an industrial camera to capture images of the magnetic brush movement and combining them with image processing technologies such as edge extraction and region recognition to evaluate the operating status of the magnetic brush and assist in optimizing the processing path and setting process parameters.

[0003] Conventional magnetic polishing detection methods based on image perception mechanisms still have room for improvement. On the one hand, conventional methods focus on static frames or single feature points in the image, making it difficult to quantitatively track the dynamic process of magnetic brush boundary disturbances changing over time, resulting in a lag in response when polishing anomalies or sudden disturbances occur. On the other hand, regional coverage judgments are mostly based on image grayscale or simple statistical features, failing to integrate time-series behavior and spatial trajectory features, which limits the accurate identification of under-covered areas and the implementation of compensation strategies. Summary of the Invention

[0004] In view of the aforementioned existing problems, the present invention is proposed.

[0005] Therefore, this invention provides a machine vision-based magnetic polishing state detection method to solve the problems of inaccurate state recognition and untimely compensation for under-covered areas in the magnetic polishing process.

[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution:

[0007] In a first aspect, the present invention provides a magnetic polishing state detection method based on machine vision, which includes: acquiring dynamic images of the contact area between the magnetic brush and the workpiece, aligning them in spatial and temporal dimensions, preprocessing the temporally and spatially aligned images, and obtaining an image sequence of the contact area between the magnetic brush and the workpiece.

[0008] The upper boundary of the magnetic brush is extracted frame by frame from the image sequence of the contact area between the magnetic brush and the workpiece and smoothed. The perturbation rate of the upper boundary of the magnetic brush is calculated to obtain the time series of the perturbation rate of the upper boundary of the magnetic brush.

[0009] The image sequence of the contact area between the magnetic brush and the workpiece is registered. The grayscale change of each pixel in the registered image sequence of the contact area between the magnetic brush and the workpiece is calculated and integrated to generate a magnetic brush trajectory coverage heat map. Based on the magnetic brush trajectory coverage heat map, the workpiece surface is divided into under-covered area, over-covered area and normal coverage area, and the area coverage index is calculated.

[0010] Based on the time series of the upper boundary disturbance rate of the magnetic brush and the regional coverage index, a magnetic polishing state feature vector is constructed, a random forest model is trained, and a real-time magnetic polishing risk level label is generated.

[0011] The magnetic field strength is adjusted according to the real-time magnetic polishing risk level label. A set of magnetic brush polishing supplementary points is generated by combining the magnetic brush trajectory coverage heat map. The set of magnetic brush polishing supplementary points is clustered, sorted and path interpolated to generate the magnetic brush polishing supplementary trajectory.

[0012] As a preferred embodiment of the machine vision-based magnetic polishing state detection method of the present invention, the steps include: acquiring dynamic images of the contact area between the magnetic brush and the workpiece, aligning them in both spatial and temporal dimensions, preprocessing the temporally and spatially aligned images to obtain an image sequence of the contact area between the magnetic brush and the workpiece; and specifically, the following steps.

[0013] By setting up a high frame rate industrial camera to vertically capture the contact area between the magnetic brush and the workpiece, dynamic images of the contact area between the magnetic brush and the workpiece are collected.

[0014] Spatial alignment is achieved through camera calibration, and temporal synchronization is achieved through hardware trigger signals, thus acquiring temporally and spatially aligned images.

[0015] The temporally and spatially aligned images are subjected to grayscale conversion, noise filtering, and edge enhancement to obtain an image sequence of the contact area between the magnetic brush and the workpiece.

[0016] As a preferred embodiment of the machine vision-based magnetic polishing state detection method of the present invention, the steps of extracting the upper boundary of the magnetic brush frame by frame from the image sequence of the contact area between the magnetic brush and the workpiece and performing smoothing processing, calculating the upper boundary perturbation rate of the magnetic brush, and obtaining the time series of the upper boundary perturbation rate of the magnetic brush are as follows:

[0017] Edge detection is performed on each frame of the image sequence of the contact area between the magnetic brush and the workpiece. The upper boundary pixel coordinates of the magnetic brush are obtained by scanning column by column, and the upper boundary height vector of the magnetic brush is generated for each frame of the image.

[0018] A sliding window mean filter is used to smooth the brush upper boundary height vector of each frame image to obtain the smoothed brush upper boundary height vector of each frame image.

[0019] Calculate the difference in the corresponding column of the smoothed brush upper boundary height vector of two adjacent frames to generate the brush upper boundary perturbation rate;

[0020] Traverse the image sequence of the contact area between the magnetic brush and the workpiece, calculate the upper boundary perturbation rate of the magnetic brush frame by frame, and generate a time series of the upper boundary perturbation rate of the magnetic brush.

[0021] As a preferred embodiment of the machine vision-based magnetic polishing state detection method of the present invention, the steps of registering the image sequence of the contact area between the magnetic brush and the workpiece, calculating and integrating the grayscale change of each pixel in the registered image sequence of the contact area between the magnetic brush and the workpiece to generate a magnetic brush trajectory coverage heatmap are as follows:

[0022] Select a reference image and align the image sequence of the contact area between the magnetic brush and the workpiece to the coordinate system of the reference image by feature point matching to obtain the registered image sequence of the contact area between the magnetic brush and the workpiece.

[0023] In the image sequence of the contact area between the registered magnetic brush and the workpiece, for each pixel coordinate, the gray value in the time dimension is extracted and the gray value difference is calculated frame by frame. The gray value difference is accumulated and integrated to generate the gray value change integral value.

[0024] Arrange the grayscale variation integral values ​​according to two-dimensional coordinates to obtain the grayscale variation integral value matrix. Normalize the grayscale variation integral value matrix and map it to the pseudo-color space to obtain the magnetic brush trajectory coverage heat map.

[0025] As a preferred embodiment of the machine vision-based magnetic polishing state detection method of the present invention, the steps of dividing the workpiece surface into under-covered areas, over-covered areas, and normally covered areas based on the magnetic brush trajectory coverage heatmap, and calculating the area coverage index, are as follows:

[0026] Set upper and lower thresholds for coverage, and divide the workpiece surface into under-covered areas, over-covered areas, and normal-covered areas based on the coverage heat map of the magnetic brush trajectory.

[0027] The ratio of the number of pixels in under-covered areas, over-covered areas, and normally covered areas to the total number of pixels is used to obtain the area coverage index.

[0028] As a preferred embodiment of the machine vision-based magnetic polishing state detection method of the present invention, the steps of constructing a magnetic polishing state feature vector based on the time series of the magnetic brush upper boundary perturbation rate and the region coverage index, training a random forest model, and generating real-time magnetic polishing risk level labels are as follows:

[0029] The mean, standard deviation, and maximum value of the upper boundary perturbation rate of the magnetic brush are extracted from the time series of the upper boundary perturbation rate of the magnetic brush, and a magnetic polishing state feature vector is constructed by combining it with the regional coverage index.

[0030] The magnetic polishing state feature vectors are divided into training set, validation set and test set. The training set is used to train the random forest model to obtain the trained random forest model.

[0031] The real-time magnetic polishing state feature vector is generated from the image sequence of the contact area between the magnetic brush and the workpiece, and then input into the trained random forest model to obtain the real-time magnetic polishing risk level label.

[0032] As a preferred embodiment of the machine vision-based magnetic polishing state detection method of the present invention, the specific steps of adjusting the magnetic field strength according to the real-time magnetic polishing risk level label and generating a set of magnetic brush polishing supplementary points by combining the magnetic brush trajectory coverage heatmap are as follows:

[0033] Read the real-time magnetic polishing risk level label and generate the corresponding magnetic field strength according to the magnetic field strength adjustment function;

[0034] In the magnetic brush trajectory coverage heatmap, the pixel positions with grayscale change integral values ​​lower than the preset magnetic brush trajectory coverage heatmap grayscale threshold are extracted to construct a set of magnetic brush polishing supplementary points.

[0035] As a preferred embodiment of the machine vision-based magnetic polishing state detection method of the present invention, the specific steps for clustering, sorting, and interpolating the set of magnetic brush polishing supplementary points to generate a magnetic brush polishing supplementary trajectory are as follows:

[0036] The magnetic brush polishing supplementary point set is grouped by density clustering algorithm to obtain a magnetic brush polishing supplementary point subset. The magnetic brush polishing supplementary point subset is then sorted by the shortest path to generate an ordered point column.

[0037] Spline interpolation is used to interpolate the trajectory of an ordered set of points to generate a set of spatial path curves.

[0038] The paths in the spatial path curve set are spliced ​​together in spatial nearest neighbor order to obtain the spliced ​​path. Velocity planning and acceleration smoothing are performed on the spliced ​​path to generate a magnetic brush polishing supplementary trajectory.

[0039] In a second aspect, the present invention provides a computer device including a memory and a processor, wherein the memory stores a computer program, wherein: when the computer program is executed by the processor, it implements any step of the machine vision-based magnetic polishing state detection method as described in the first aspect of the present invention.

[0040] Thirdly, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein: when the computer program is executed by a processor, it implements any step of the machine vision-based magnetic polishing state detection method as described in the first aspect of the present invention.

[0041] The beneficial effects of this invention are as follows: by calculating the disturbance rate of the upper boundary of the magnetic brush and obtaining the time series of the disturbance rate of the upper boundary of the magnetic brush, a quantitative expression of the dynamic changes of the upper boundary of the magnetic brush in the contact area of ​​the workpiece is realized, enabling real-time tracking of the disturbance state in the magnetic polishing process and improving the real-time monitoring and dynamic response capabilities of the magnetic polishing process; by generating a magnetic brush trajectory coverage heatmap, constructing a magnetic polishing state feature vector, training a random forest model, generating a real-time magnetic polishing risk level label, and obtaining the magnetic brush polishing supplementary trajectory, accurate identification of the magnetic polishing state and implementation of regional compensation are achieved, forming a complete closed-loop feedback control mechanism. Attached Figure Description

[0042] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0043] Figure 1 This is a flowchart of a machine vision-based magnetic polishing state detection method.

[0044] Figure 2 This is a flowchart of the acquisition and preprocessing process for images of the contact area between the magnetic brush and the workpiece.

[0045] Figure 3 This is a flowchart for obtaining the time series of the upper boundary perturbation rate of the magnetic brush.

[0046] Figure 4 A flowchart for calculating regional coverage indicators. Detailed Implementation

[0047] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0048] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.

[0049] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.

[0050] Reference Figures 1-4As one embodiment of the present invention, this embodiment provides a machine vision-based magnetic polishing state detection method, comprising the following steps:

[0051] S1. Acquire dynamic images of the contact area between the magnetic brush and the workpiece, align them in spatial and temporal dimensions, preprocess the temporally and spatially aligned images, and obtain an image sequence of the contact area between the magnetic brush and the workpiece.

[0052] By setting up a high frame rate industrial camera to vertically capture the contact area between the magnetic brush and the workpiece, dynamic images of the contact area between the magnetic brush and the workpiece are obtained.

[0053] Furthermore, a high frame rate industrial camera is vertically mounted above the magnetic polishing device to capture dynamic images of the contact area between the magnetic brush and the workpiece in a vertical overhead view.

[0054] It should be noted that the frame rate of a high frame rate industrial camera is no less than 120 frames per second. The high frame rate industrial camera is connected to the host computer through the GigE vision interface and receives the synchronization pulse signal output by the industrial control motherboard.

[0055] The frame rate of the industrial camera is set to be no less than 120 frames per second to accurately capture the subtle disturbances during the high-speed movement of the magnetic brush. The contact frequency between the magnetic brush and the workpiece is high and the response is fast. If the frame rate of the industrial camera is less than 120 frames per second, key dynamic information may be lost, affecting the accurate calculation of the disturbance rate at the upper boundary of the magnetic brush. 120 frames per second can observe the magnetic brush trajectory and boundary changes with high temporal resolution, taking into account the real-time processing capability of the processor and the data bandwidth load.

[0056] The image acquisition of the contact area between the magnetic brush and the workpiece is strictly synchronized with the servo motion of the magnetic brush to obtain dynamic images of the contact area between the magnetic brush and the workpiece.

[0057] Spatial alignment is achieved through camera calibration, and temporal synchronization is achieved through hardware trigger signals, thus acquiring temporally and spatially aligned images.

[0058] Furthermore, spatial dimension alignment involves acquiring 15 to 25 images of the magnetic brush and workpiece contact area at different angles and orientations using a standard checkerboard calibration board, calculating the camera's intrinsic parameter matrix and distortion coefficients using Zhang Zhengyou's camera calibration algorithm, performing geometric correction on the images of the magnetic brush and workpiece contact area using an image distortion correction function, and uniformly mapping the image coordinates of the magnetic brush and workpiece contact area to physical coordinates.

[0059] It should be noted that the 15 to 25 images of the contact area between the magnetic brush and the workpiece were determined by calibrating the accuracy of the number of images of different contact areas between the magnetic brush and the workpiece. The selection of 15 to 25 images of the contact area between the magnetic brush and the workpiece balances distortion correction accuracy and image processing efficiency.

[0060] Furthermore, time-dimensional alignment includes using hardware-level trigger lines to connect the high frame rate industrial camera and the motion controller, embedding timestamps, and calibrating and synchronizing the frame time of the high frame rate industrial camera and the signal timing of the motion controller using the IEEE 1588 Precision Time Protocol.

[0061] It should be noted that, through temporal and spatial alignment, the image of the contact area between the magnetic brush and the workpiece in each frame strictly corresponds to the position of the magnetic brush.

[0062] The temporally and spatially aligned images are subjected to grayscale conversion, noise filtering, and edge enhancement to obtain an image sequence of the contact area between the magnetic brush and the workpiece.

[0063] Furthermore, the temporally and spatially aligned images are preprocessed. Specifically, the images of the contact area between the magnetic brush and the workpiece are converted into grayscale image matrices. By applying a medium-level filtering algorithm, environmental reflections and speckle image noise are removed. The Sobel edge enhancement operator is used to extract the strong gradient region of the magnetic brush edge in the image of the contact area between the magnetic brush and the workpiece, thereby enhancing the magnetic brush boundary. The brightness histogram of the image of the contact area between the magnetic brush and the workpiece is unified, thereby enhancing the contrast between the magnetic brush edge and the background.

[0064] It should be noted that the preprocessing uses a fixed window size and adjustable filtering parameters, which can be adjusted according to different workpieces and magnetic brush materials.

[0065] Furthermore, the images of the contact area between the preprocessed magnetic brush and the workpiece are numbered and stored. Each frame of the magnetic brush and workpiece contact area image is appended with a timestamp, magnetic brush pose information, and a grayscale image matrix to obtain the image sequence of the magnetic brush and workpiece contact area.

[0066] It should be noted that the brush pose information is obtained through the brush servo motion controller, including the brush's lateral displacement, longitudinal displacement, height displacement, and the brush's angular deflection value around the vertical axis.

[0067] S2. Extract the upper boundary of the magnetic brush frame by frame from the image sequence of the contact area between the magnetic brush and the workpiece, and perform smoothing processing. Calculate the disturbance rate of the upper boundary of the magnetic brush and obtain the time series of the disturbance rate of the upper boundary of the magnetic brush.

[0068] Furthermore, edge detection is performed on each frame of the image sequence of the contact area between the magnetic brush and the workpiece, and the pixel coordinates of the upper boundary of the magnetic brush are obtained by scanning column by column to generate the upper boundary height vector of the magnetic brush for each frame of the image.

[0069] Edge detection is performed on each frame of the image sequence of the magnetic brush and workpiece contact area. Specifically, Canny edge detection is used to extract the gray-scale transition edges of the magnetic brush and workpiece contact area image. The image of the magnetic brush and workpiece contact area is scanned horizontally column by column, and the vertical coordinates of the first edge pixel are recorded from top to bottom to construct the pixel set of the upper boundary of the magnetic brush. The vector of the height of the upper boundary of the magnetic brush in each frame image is obtained.

[0070] A sliding window mean filter is used to smooth the brush upper boundary height vector of each frame image to obtain the smoothed brush upper boundary height vector of each frame image.

[0071] Furthermore, a smoothing process is performed using a sliding window mean filter. Specifically, the vertical coordinates of the pixels at the upper boundary of each brush are weighted and averaged with the vertical coordinates of their adjacent positions.

[0072] Specifically, smoothing is represented as:

[0073] ;

[0074] in, Indicates the first The first frame of the magnetic brush and workpiece contact area image The vertical coordinates of the pixels at the upper boundary of the brush after smoothing are displayed. Indicates the first The first frame of the magnetic brush and workpiece contact area image List the vertical coordinates of the original brush's upper boundary pixels. Indicates the position of the sliding window relative to the center column. The column offset, with a value range of 100. , Indicates the radius of the sliding window. The frame number indicates the image of the contact area between the magnetic brush and the workpiece. This indicates the column number of the center column currently undergoing smoothing.

[0075] Furthermore, the difference between the smoothed brush upper boundary height vectors in corresponding columns of two adjacent frames is calculated to generate the brush upper boundary perturbation rate, expressed as:

[0076] ;

[0077] in, Indicates the first The upper boundary perturbation rate of the magnetic brush in the image of the contact area between the magnetic brush and the workpiece. Indicates the first The first frame of the magnetic brush and workpiece contact area image The vertical coordinates of the pixels at the upper boundary of the brush after smoothing are displayed. This indicates the width of the image representing the contact area between the magnetic brush and the workpiece.

[0078] It should be noted that a large value of the disturbance rate at the upper boundary of the magnetic brush indicates that there is deformation at the boundary of the magnetic brush, which may be due to sudden changes in magnetic polishing pressure, vibration of the magnetic brush polishing trajectory, or abnormal uneven magnetic force distribution.

[0079] Traverse the image sequence of the contact area between the magnetic brush and the workpiece, calculate the upper boundary perturbation rate of the magnetic brush frame by frame, and generate a time series of the upper boundary perturbation rate of the magnetic brush.

[0080] Furthermore, all magnetic brush and workpiece contact area images in the image sequence are traversed, the upper boundary perturbation rate of the magnetic brush is calculated, and the upper boundary perturbation rate of the magnetic brush and workpiece contact area image of each frame is matched one-to-one with the timestamp of the magnetic brush and workpiece contact area image frame, and arranged in chronological order to generate a time series of the upper boundary perturbation rate of the magnetic brush.

[0081] S3. Register the image sequence of the contact area between the magnetic brush and the workpiece, calculate the grayscale change of each pixel in the registered image sequence of the contact area between the magnetic brush and the workpiece and integrate it to generate a magnetic brush trajectory coverage heat map. Based on the magnetic brush trajectory coverage heat map, divide the workpiece surface into under-covered areas, over-covered areas and normally covered areas, and calculate the area coverage index.

[0082] Select a reference image, and align the image sequence of the contact area between the magnetic brush and the workpiece to the coordinate system of the reference image through feature point matching to obtain the registered image sequence of the contact area between the magnetic brush and the workpiece.

[0083] Furthermore, spatial registration is performed on each frame of the image sequence of the magnetic brush and workpiece contact area. Specifically, the first frame of the image sequence is used as a reference image. Key feature points in each frame of the magnetic brush and workpiece contact area image are extracted using the ORB feature extraction algorithm. Descriptors of the key feature points are calculated. The key feature points are matched using the Hamming distance to determine the corresponding key feature points between the reference image and the current magnetic brush and workpiece contact area image, thus generating a matching key feature point pair.

[0084] The RANSAC algorithm is used to estimate the homography transformation matrix from the current magnetic brush and workpiece contact area image to the reference image. Perspective transformation is then used to transform all magnetic brush and workpiece contact area images to a unified spatial coordinate system, thereby obtaining a sequence of registered magnetic brush and workpiece contact area images.

[0085] Specifically, the image of the current contact area between the magnetic brush and the workpiece is registered, as shown below:

[0086] ;

[0087] in, The pixel coordinates in the image representing the contact area between the registered magnetic brush and the workpiece are: grayscale value, The pixel coordinates in the image of the original magnetic brush and workpiece contact area are: grayscale value, Indicates the first The homography transformation matrix for registering the image of the contact area between the magnetic brush and the workpiece to the coordinate system of the reference image. Represents the x and y coordinates of a pixel.

[0088] In the image sequence of the contact area between the registered magnetic brush and the workpiece, the gray value in the time dimension is extracted for each pixel coordinate, and the gray value difference is calculated frame by frame. The gray value difference is accumulated and integrated to generate the gray value change integral value.

[0089] Specifically, for each pixel position in the registered magnetic brush and workpiece contact area image sequence, a time series grayscale value vector is constructed, the absolute value of the grayscale difference between each frame of the magnetic brush and workpiece contact area image and the previous frame of the magnetic brush and workpiece contact area image at the same pixel position is calculated, the absolute values ​​of the grayscale difference are accumulated, and the grayscale change integral value of each pixel position is obtained.

[0090] Specifically, the integral value of grayscale change is expressed as:

[0091] ;

[0092] in, This indicates that the pixel coordinates are during the entire magnetic brush polishing process. The integral value of grayscale change, Indicates the first The pixel coordinates in the image of the contact area between the magnetic brush and the workpiece after frame registration are: grayscale value, This indicates the total number of frames in the image sequence representing the contact area between the magnetic brush and the workpiece.

[0093] Arrange the grayscale variation integral values ​​according to two-dimensional coordinates to obtain the grayscale variation integral value matrix. Normalize the grayscale variation integral value matrix and map it to the pseudo-color space to obtain the magnetic brush trajectory coverage heat map.

[0094] The grayscale variation integral values ​​corresponding to all pixel positions are arranged according to the two-dimensional coordinates in the registered magnetic brush and workpiece contact area image to construct a grayscale variation integral value matrix. The grayscale variation integral value matrix is ​​then mapped to the two-dimensional image space to generate a magnetic brush trajectory coverage heatmap. Specifically, the grayscale variation integral value matrix is ​​subjected to minimum and maximum value normalization processing, and different grayscale variation integral values ​​are mapped to different color levels through pseudo-color mapping to generate a magnetic brush trajectory coverage heatmap.

[0095] It should be noted that in this embodiment, the pseudo-color mapping method uses Jet color mapping.

[0096] The magnetic brush trajectory coverage heat map reflects the frequency and intensity of magnetic brush coverage in different areas of the workpiece surface.

[0097] Set upper and lower thresholds for coverage, and divide the workpiece surface into under-covered areas, over-covered areas, and normally covered areas based on the coverage heat map of the magnetic brush trajectory.

[0098] Based on the integral value of the grayscale change of pixels in the thermal map covered by the brush trajectory, set the lower limit threshold and the upper limit threshold of the coverage.

[0099] It should be noted that the coverage thresholds include the lower coverage threshold and the upper coverage threshold.

[0100] The lower limit of coverage is set to 20% of the maximum value of the grayscale change integral value, and the upper limit of coverage is set to 80% of the maximum value of the grayscale change integral value.

[0101] The upper and lower thresholds for coverage are determined based on three core technical criteria: the uniformity distribution of magnetic brush trajectory coverage during magnetic brush polishing, verification data of actual workpiece surface treatment effects, and statistical characteristics of grayscale distribution in the magnetic brush trajectory coverage heatmap. If the integral value of grayscale change of pixels in the magnetic brush trajectory coverage heatmap is less than 20%, polishing is insufficient and surface roughness is high; if the integral value of grayscale change of pixels in the magnetic brush trajectory coverage heatmap is greater than 80%, polishing is excessive and damage to the workpiece surface is caused.

[0102] Furthermore, regions where the integral value of the grayscale change of pixels in the magnetic brush trajectory coverage heatmap is less than the lower limit threshold of coverage are classified as under-covered regions, regions where the integral value of the grayscale change of pixels in the magnetic brush trajectory coverage heatmap is greater than the upper limit threshold of coverage are classified as over-covered regions, and regions where the integral value of the grayscale change of pixels in the magnetic brush trajectory coverage heatmap is between the lower limit threshold of coverage and the upper limit threshold of coverage are classified as normal coverage regions.

[0103] The ratio of the number of pixels in under-covered areas, over-covered areas, and normally covered areas to the total number of pixels is used to obtain the area coverage index.

[0104] Count the number of pixels in under-covered areas, over-covered areas, and normally covered areas. Calculate the proportion of pixels in under-covered areas, normally covered areas, and over-covered areas to the total number of pixels, and obtain the coverage indexes for under-covered areas, over-covered areas, and normally covered areas.

[0105] It should be noted that the regional coverage index includes coverage indexes for under-covered areas, coverage indexes for over-covered areas, and coverage indexes for normally covered areas. The regional coverage index is represented in the form of triplets and is used to quantitatively evaluate the spatial uniformity of the brush trajectory.

[0106] S4. Based on the time series of the upper boundary disturbance rate of the magnetic brush and the regional coverage index, construct the magnetic polishing state feature vector, train the random forest model, and generate real-time magnetic polishing risk level labels.

[0107] The mean, standard deviation, and maximum value of the upper boundary perturbation rate of the magnetic brush are extracted from the time series of the upper boundary perturbation rate of the magnetic brush, and a magnetic polishing state feature vector is constructed by combining it with the regional coverage index.

[0108] Furthermore, a fixed-length sliding window is used to process the time series of brush upper boundary perturbation rate frame by frame. The sliding window length is set to 100 frames. The brush upper boundary perturbation rate values ​​of the brush and workpiece contact area images within the sliding window are statistically calculated, and the mean, standard deviation and maximum value of the brush upper boundary perturbation rate within the time window are obtained.

[0109] It should be noted that the length of the sliding window was determined through a sensitivity comparison experiment of the sliding window parameter of the magnetic brush perturbation rate. Under different sliding window lengths, the statistical features of the perturbation rate of the upper boundary of the magnetic brush were extracted. The discrimination accuracy of the magnetic polishing risk level label was evaluated by training a random forest model. 100 frames were used to balance discrimination accuracy and anomaly detection response speed.

[0110] Furthermore, the images of the magnetic brush and workpiece contact area within the sliding window in the image sequence of the magnetic brush and workpiece contact area are registered and pixel grayscale changes are integrated to generate a magnetic brush trajectory coverage heatmap. In the magnetic brush trajectory coverage heatmap, the workpiece surface is divided into under-covered areas, normally covered areas, and over-covered areas according to the upper and lower thresholds of the coverage degree. The coverage index of under-covered areas, over-covered areas, and normally covered areas are statistically calculated.

[0111] Furthermore, the mean of the upper boundary disturbance rate of the magnetic brush, the standard deviation of the upper boundary disturbance rate of the magnetic brush, the maximum value of the upper boundary disturbance rate of the magnetic brush, the coverage index of the under-covered area, the coverage index of the over-covered area, and the coverage index of the normal coverage area are combined to generate a magnetic polishing state feature vector, which is then normalized using the min-max normalization method.

[0112] The magnetic polishing state feature vectors are divided into training set, validation set and test set. The random forest model is trained using the training set to obtain the trained random forest model.

[0113] Furthermore, magnetic polishing risk level labels are assigned to the images of the contact area between the magnetic brush and the workpiece. The magnetic polishing risk level labels include low risk, medium risk, and high risk. Each set of images of the contact area between the magnetic brush and the workpiece corresponds to a magnetic polishing state feature vector and a magnetic polishing risk level label. The magnetic polishing state feature vector and the magnetic polishing risk level label are matched one-to-one to generate training sample pairs and construct a training dataset.

[0114] It should be noted that the risk level label for magnetic polishing has a value of 0, indicating low risk; a value of 1, indicating medium risk; and a value of 2, indicating high risk.

[0115] A random forest model was trained using the risk level labels of magnetic polishing as the true labels.

[0116] The training dataset is divided into training, validation, and test sets in a ratio of 70%:15%:15% for training, parameter selection, and evaluation of the random forest model.

[0117] Specifically, the random forest model is trained using a training set. Samples are drawn from the training set using a random sampling method with replacement to generate a sub-sample set, which is then used to train the decision tree.

[0118] Furthermore, an independent decision tree is constructed on each subsample set. For each non-leaf node in the decision tree, several features are randomly selected from all feature dimensions, and the information gain ratio is calculated to evaluate the classification effect. The optimal splitting feature is selected according to the information gain ratio to split the node and construct a complete random forest classifier.

[0119] The validation set is input into the random forest model obtained through training. The prediction results of the magnetic polishing state feature vectors for each input set and the manually labeled magnetic polishing risk level are recorded. The overall accuracy, precision, recall and F1 score performance indicators are calculated. The voting consistency of each decision tree on the training samples is analyzed. Weak decision trees that are unstable in performance on the validation set are identified and removed. The performance of the random forest model on the validation set under different combinations of random forest model parameters is compared. The set of parameter configurations with the best performance on the validation set is selected to determine the structure of the random forest model.

[0120] The random forest model was evaluated using a test set. The accuracy, precision, recall, and F1 score of the random forest model on the test set were calculated to ensure that the random forest model has good generalization ability and can be deployed in actual magnetic polishing state detection scenarios.

[0121] The real-time magnetic polishing state feature vector is generated from the image sequence of the contact area between the magnetic brush and the workpiece, and then input into the trained random forest model to obtain the real-time magnetic polishing risk level label.

[0122] Specifically, the upper boundary of the magnetic brush is extracted from the real-time acquired image sequence of the contact area between the magnetic brush and the workpiece and then smoothed. The upper boundary perturbation rate of the magnetic brush is calculated, and the time series of the real-time upper boundary perturbation rate of the magnetic brush is obtained. The mean, standard deviation, and maximum value of the upper boundary perturbation rate of the magnetic brush are calculated. The real-time acquired image sequence of the contact area between the magnetic brush and the workpiece is registered and pixel grayscale change is integrated to generate a magnetic brush trajectory coverage heatmap. The coverage index of under-covered area, over-covered area, and normal coverage area are statistically calculated to construct a real-time magnetic polishing state feature vector.

[0123] The real-time magnetic polishing state feature vector is input into the trained random forest model, and the corresponding real-time magnetic polishing risk level label is output.

[0124] S5. Adjust the magnetic field strength according to the real-time magnetic polishing risk level label, generate a set of magnetic brush polishing supplementary points by combining the magnetic brush trajectory coverage heat map, perform clustering sorting and path interpolation on the set of magnetic brush polishing supplementary points, and generate magnetic brush polishing supplementary trajectory.

[0125] Furthermore, the real-time magnetic polishing risk level label is read, and the corresponding magnetic field strength is generated according to the magnetic field strength adjustment function.

[0126] Send a new excitation current setting value to the magnetic field generator to change the current in the magnet coil and adjust the magnetic field strength.

[0127] Specifically, the magnetic field strength adjustment function is expressed as:

[0128] ;

[0129] in, This indicates the adjusted magnetic field strength. Indicates the basic magnetic field strength. This represents the reduction factor for adjusting the magnetic field strength, with a value range of [0.1, 0.3]. This indicates the risk level label for magnetic polishing.

[0130] It should be noted that the basic magnetic field strength is the standard magnetic field strength setting value under low-risk level, which is set by the equipment manufacturer.

[0131] The reduction coefficient for adjusting the magnetic field strength is determined through a combination of experimental calibration and empirical parameter adjustment. Specifically, during the commissioning phase of the magnetic polishing equipment, polishing tests are conducted on multiple typical workpieces, and different initial values ​​of the reduction coefficient for adjusting the magnetic field strength are set. The changes in the surface quality of the workpieces under different initial values ​​of the reduction coefficient for adjusting the magnetic field strength are compared, including the average surface roughness, coverage uniformity index, and whether defects such as under-polishing or burning occur. The initial value of the reduction coefficient for adjusting the magnetic field strength corresponding to the best magnetic polishing effect is selected as the reduction coefficient for adjusting the magnetic field strength.

[0132] If the reduction coefficient of the magnetic field strength adjustment is less than 0.1, the adjustment range of the magnetic field strength is too small, and it is difficult to effectively reduce the contact rigidity of the magnetic brush under high-risk levels, making risk intervention difficult. If the reduction coefficient of the magnetic field strength adjustment is greater than 0.3, the contact rigidity of the magnetic brush drops sharply, which can easily lead to problems such as obvious magnetic brush floating, insufficient coverage, and reduced cutting force. The range of the reduction coefficient of the magnetic field strength adjustment is [0.1, 0.3], which can finely adjust the risk level of magnetic polishing while taking into account the stability of the response of the magnetic polishing equipment. The appropriate value of the reduction coefficient of the magnetic field strength adjustment can be selected according to different workpiece materials, target magnetic polishing depth, and characteristics of magnetic polishing path.

[0133] In the magnetic brush trajectory coverage heatmap, the pixel positions with grayscale change integral values ​​lower than the preset magnetic brush trajectory coverage heatmap grayscale threshold are extracted to construct a set of magnetic brush polishing supplementary points.

[0134] Furthermore, a grayscale threshold for the magnetic brush trajectory coverage heatmap is set, under-covered areas on the workpiece surface are identified, all pixels in the magnetic brush trajectory coverage heatmap are traversed, and pixels with normalized grayscale change integral values ​​lower than the grayscale threshold of the magnetic brush trajectory coverage heatmap are selected. The coordinates of each selected pixel are converted into physical coordinates through a calibration matrix to obtain a set of magnetic brush polishing supplementary points.

[0135] It should be noted that the grayscale threshold of the magnetic brush trajectory coverage heatmap is in the range of (0.2, 0.3), which is determined by the statistical correspondence between manually labeled samples and the normalized grayscale change integral values ​​in the magnetic brush trajectory coverage heatmap. Specifically, manually labeled under-covered areas in multiple typical polishing samples are selected, and the normalized grayscale change integral values ​​of the manually labeled under-covered areas in the magnetic brush trajectory coverage heatmap are extracted. The distribution range of the normalized grayscale change integral values ​​is statistically analyzed, and the 90th percentile of the distribution range of the normalized grayscale change integral values ​​is taken as the grayscale threshold of the magnetic brush trajectory coverage heatmap.

[0136] The magnetic brush polishing supplementary point set is grouped by density clustering algorithm to obtain a magnetic brush polishing supplementary point subset. The magnetic brush polishing supplementary point subset is then sorted by shortest path to generate an ordered point column.

[0137] Specifically, density clustering algorithm refers to DBSCAN clustering algorithm.

[0138] Furthermore, the DBSCAN clustering algorithm is used to divide the spatial structure of the magnetic brush polishing supplementary point set. The neighborhood radius parameter of the DBSCAN clustering algorithm is set to 2 mm, and the minimum number of neighborhood points is 5, generating several magnetic brush polishing supplementary point subsets.

[0139] It should be noted that the neighborhood radius parameter in the DBSCAN clustering algorithm was determined through experiments analyzing the spatial distribution of brush supplement points. In typical under-covered areas, the actual physical distance between adjacent under-covered pixels on the brush trajectory coverage heatmap is mostly within 2 mm. Setting the neighborhood radius parameter to 2 mm can effectively cover local continuous areas, grouping spatially close brush polishing supplement points into the same cluster, and avoiding misjudging pixels with low grayscale variation integral values ​​as noise or isolated points.

[0140] The minimum number of neighborhood points is determined based on the diameter of the magnetic brush head, the controllable accuracy of the actual magnetic brush polishing supplementary trajectory, and the requirement for noise point elimination. Setting it to 5 can effectively filter out occasional discrete under-covered pixels, ensuring that each clustered region has actual spatial extension and physical compensation significance.

[0141] The DBSCAN clustering algorithm can effectively identify densely distributed spatial regions and eliminate noise points, making it suitable for the automatic identification and grouping of under-covered areas on the workpiece surface.

[0142] Furthermore, for each set of magnetic brush polishing supplementary points, the optimal access path of the magnetic brush is planned. Specifically, the cluster center point is used as the starting point of the path, and the point with the smallest Euclidean distance among the unvisited magnetic brush polishing supplementary points is selected iteratively as the next processing point. The path is expanded through the local optimal selection method, and the selection process is repeated until all magnetic brush polishing supplementary points are visited, thus constructing an ordered point sequence.

[0143] The spline interpolation method is used to interpolate the trajectory of an ordered set of points to generate a set of spatial path curves.

[0144] Among them, spline interpolation refers to cubic B-spline interpolation function.

[0145] Furthermore, based on curvature changes and fitting error control, key points that can represent the path shape are selected in the ordered point sequence to form a control point set. The control point set is then input into a cubic B-spline interpolation function to generate a set of continuous, differentiable, and curvature-continuous spatial path curves.

[0146] Specifically, the cubic B-spline interpolation function is expressed as:

[0147] ;

[0148] in, Indicates the first A continuous trajectory function of an ordered sequence of points. Represents an ordered point column index. This represents the normalized path parameter, with a value range of [0, 1]. Indicates the first The cubic B-spline basis functions corresponding to each control point Indicates the first Spatial coordinates of control points Indicates the index of the control point. This indicates the total number of control points.

[0149] It should be noted that the normalized path parameters represent the parameters of the relative positions of each trajectory point on the entire path during the trajectory interpolation process. For each discrete point in the ordered point sequence, the cumulative distance from the starting point of the ordered point sequence along the path to the discrete point is calculated, and normalization is performed with the total length of the entire path as the denominator to obtain the normalized path parameters.

[0150] It should be noted that the spatial path curve represents the shape of the magnetic brush polishing trajectory corresponding to the ordered point sequence.

[0151] The paths in the spatial path curve set are spliced ​​together in spatial nearest neighbor order to obtain the spliced ​​path. Velocity planning and acceleration smoothing are performed on the spliced ​​path to generate a magnetic brush polishing supplementary trajectory.

[0152] The paths in the spatial path curve set are sorted according to spatial proximity. The starting path is selected, and the remaining paths are spliced ​​in sequence to generate the spliced ​​path.

[0153] Furthermore, to ensure the smooth operation of the magnetic brush, the speed and acceleration of all trajectory points on the splicing path are planned using a trapezoidal speed plan. An acceleration segment is set at the beginning of the splicing path, a constant speed segment is set in the middle segment, and a deceleration segment is set at the end. At the same time, the acceleration boundary is adjusted according to the magnetic brush servo characteristics.

[0154] The splicing path planned by trapezoidal velocity is resampled at equal time intervals to generate a discrete sequence of magnetic brush polishing trajectory points at equal time intervals. Each magnetic brush polishing trajectory point includes the two-dimensional position coordinates and motion speed information on the corresponding workpiece plane.

[0155] The magnetic brush polishing trajectory point sequence is encoded into an instruction format that the magnetic brush controller can recognize, stored in the magnetic brush polishing trajectory instruction buffer, and a magnetic brush polishing supplementary trajectory is generated to perform precise compensation magnetic polishing on the under-covered areas.

[0156] It should be noted that the instruction formats that the brush controller can recognize include timestamps, two-dimensional spatial positions, and speed information.

[0157] This embodiment also provides a computer device applicable to the magnetic polishing state detection method based on machine vision, including: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the magnetic polishing state detection method based on machine vision as proposed in the above embodiment.

[0158] The computer device can be a terminal, comprising a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, carrier networks, NFC (Near Field Communication), or other technologies. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad on the computer device's casing, or an external keyboard, touchpad, or mouse.

[0159] This embodiment also provides a storage medium storing a computer program that, when executed by a processor, implements the machine vision-based magnetic polishing state detection method as proposed in the above embodiments. The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Red-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0160] In summary, this invention calculates the disturbance rate at the upper boundary of the magnetic brush and obtains its time series, thereby quantifying the dynamic changes of the magnetic brush at the upper boundary of the workpiece contact area. This enables real-time tracking of the disturbance state during the magnetic polishing process, improving the real-time monitoring and dynamic response capabilities of the magnetic polishing process. Furthermore, by generating a magnetic brush trajectory coverage heatmap, constructing a magnetic polishing state feature vector, training a random forest model, generating real-time magnetic polishing risk level labels, and obtaining supplementary magnetic brush polishing trajectories, this invention achieves accurate identification of the magnetic polishing state and implements regional compensation, forming a complete closed-loop feedback control mechanism.

[0161] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A method for detecting a magnetic force polishing state based on machine vision, characterized in that: The application relates to a magnetic force polishing state monitoring method and device. Dynamic images of a magnetic brush and a workpiece contact area are collected, spatial and time dimensions are aligned, pre-processing is conducted on the time-space aligned images, and a magnetic brush and workpiece contact area image sequence is obtained; An upper boundary of the magnetic brush is extracted from the magnetic brush and workpiece contact area image sequence frame by frame, smoothing processing is conducted, a magnetic brush upper boundary disturbance rate is calculated, and a magnetic brush upper boundary disturbance rate time sequence is obtained; The magnetic brush and workpiece contact area image sequence is registered, the gray value change of each pixel in the registered magnetic brush and workpiece contact area image sequence is calculated and integrated, a magnetic brush track coverage heat map is generated, the workpiece surface is divided into an under-coverage area, an over-coverage area and a normal coverage area according to the magnetic brush track coverage heat map, and an area coverage index is calculated; According to the magnetic brush upper boundary disturbance rate time sequence and the area coverage index, a magnetic force polishing state feature vector is constructed, a random forest model is trained, and a real-time magnetic force polishing risk level label is generated; According to the real-time magnetic force polishing risk level label, the magnetic field strength is adjusted, the magnetic brush track coverage heat map is combined to generate a magnetic brush polishing supplementary point set, the magnetic brush polishing supplementary point set is clustered, sorted and path interpolated, and a magnetic brush polishing supplementary track is generated.

2. The machine vision-based magnetic force polishing state detection method of claim 1, wherein: The dynamic images of the magnetic brush and the workpiece contact area are collected, the spatial and time dimensions are aligned, the time-space aligned images are pre-processed, and the magnetic brush and workpiece contact area image sequence is obtained, and the specific steps are as follows, A high-frame-rate industrial camera is arranged to vertically shoot the magnetic brush and the workpiece contact area, and the dynamic images of the magnetic brush and the workpiece contact area are collected; The spatial dimension alignment is realized through camera calibration, the time dimension synchronization is realized through a hardware trigger signal, and the time-space aligned images are obtained; The time-space aligned images are subjected to gray value processing, noise filtering and edge enhancement processing, and the magnetic brush and workpiece contact area image sequence is obtained.

3. The machine vision-based magnetic polishing state detection method of claim 2, wherein: The upper boundary of the magnetic brush is extracted from the magnetic brush and workpiece contact area image sequence frame by frame, smoothing processing is conducted, a magnetic brush upper boundary disturbance rate is calculated, and a magnetic brush upper boundary disturbance rate time sequence is obtained, and the specific steps are as follows, Edge detection is conducted on each frame of the magnetic brush and workpiece contact area image sequence, the upper boundary pixel coordinates of the magnetic brush are obtained through column-by-column scanning, and the upper boundary height vector of each frame of the image is generated; Sliding window mean filtering is adopted to smooth the upper boundary height vector of each frame of the image, and the smoothed upper boundary height vector of each frame of the image is obtained; The difference value of the smoothed upper boundary height vectors of adjacent two frames of the image in the corresponding column is calculated, and the magnetic brush upper boundary disturbance rate is generated; The magnetic brush and workpiece contact area image sequence is traversed, the magnetic brush upper boundary disturbance rate is calculated frame by frame, and the magnetic brush upper boundary disturbance rate time sequence is generated.

4. The machine vision-based magnetic polishing state detection method of claim 3, wherein: The magnetic brush and workpiece contact area image sequence is registered, the gray value change of each pixel in the registered magnetic brush and workpiece contact area image sequence is calculated and integrated, a magnetic brush track coverage heat map is generated, and the specific steps are as follows, A reference image is selected, the magnetic brush and workpiece contact area image sequence is aligned to the reference image coordinate system through feature point matching, and the registered magnetic brush and workpiece contact area image sequence is obtained; In the registered magnetic brush and workpiece contact area image sequence, for each pixel coordinate, the gray value in the time dimension is extracted and the gray difference is calculated frame by frame, the gray difference is accumulated and integrated to generate a gray change integral value; The gray change integral value is arranged according to two-dimensional coordinates to obtain a gray change integral value matrix, the gray change integral value matrix is normalized and mapped to a pseudo-color space to obtain a magnetic brush trajectory coverage heat map.

5. The machine vision-based magnetic polishing state detection method of claim 4, wherein: The workpiece surface is divided into under-coverage areas, over-coverage areas and normal coverage areas according to the magnetic brush trajectory coverage heat map, and a region coverage index is calculated, specifically, Set coverage degree upper and lower threshold values, and divide the workpiece surface into under-coverage areas, over-coverage areas and normal coverage areas according to the magnetic brush trajectory coverage heat map; The ratio of the number of pixels in the under-coverage areas, over-coverage areas and normal coverage areas to the total number of pixels is calculated to obtain a region coverage index.

6. The machine vision-based magnetic polishing state detection method of claim 5, wherein: According to the magnetic brush upper boundary disturbance rate time sequence and the region coverage index, a magnetic force polishing state feature vector is constructed, a random forest model is trained, and a real-time magnetic force polishing risk level label is generated, specifically, The mean, standard deviation and maximum of the magnetic brush upper boundary disturbance rate time sequence are extracted, and the region coverage index is combined to construct a magnetic force polishing state feature vector; The magnetic force polishing state feature vector is divided into a training set, a validation set and a test set, and the training set is used to train the random forest model to obtain a trained random forest model; Real-time magnetic force polishing state feature vectors are generated from real-time magnetic brush and workpiece contact area image sequences and input into the trained random forest model to obtain real-time magnetic force polishing risk level labels.

7. The machine vision-based magnetic polishing state detection method of claim 6, wherein: According to the real-time magnetic force polishing risk level label, the magnetic field strength is adjusted, and a magnetic brush polishing supplement point set is generated based on the magnetic brush trajectory coverage heat map, specifically, Read the real-time magnetic force polishing risk level label, and generate the corresponding magnetic field strength according to the magnetic field strength adjustment function; In the magnetic brush trajectory coverage heat map, the pixel positions with a gray change integral value lower than a preset magnetic brush trajectory coverage heat map gray threshold value are extracted to construct a magnetic brush polishing supplement point set.

8. The machine vision-based magnetic polishing state detection method of claim 7, wherein: The magnetic brush polishing supplement point set is clustered and sorted and path interpolation is performed to generate a magnetic brush polishing supplement trajectory, specifically, The magnetic brush polishing supplement point set is grouped by a density clustering algorithm to obtain a magnetic brush polishing supplement point sub-set, and the magnetic brush polishing supplement point sub-set is sorted by the shortest path to generate an ordered point list; A spline interpolation method is used to perform trajectory interpolation on the ordered point list to generate a spatial path curve set; The paths in the spatial path curve set are spliced in the order of spatial proximity to obtain a spliced path, and the spliced path is speed planned and acceleration smoothed to generate a magnetic brush polishing supplement trajectory. 9.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is characterized in that: The processor executes the computer program to implement the steps of the machine vision-based magnetic force polishing state detection method of any one of claims 1-8.

10. A computer readable storage medium having stored thereon a computer program, characterized in that: The computer program is executed by the processor to implement the steps of the machine vision-based magnetic force polishing state detection method of any one of claims 1-8.

Citation Information

Patent Citations

  • Grinding track discretization method and system, terminal and readable storage medium

    CN117900917A

  • Magnetic polishing method and wafer polishing device

    JP2007296598A