A detection method and system for precision grinding of a special-shaped workpiece surface

By combining multi-angle image acquisition with a deep learning model, the efficiency and accuracy issues of surface inspection of irregularly shaped workpieces have been solved, achieving efficient and accurate identification of surface defects in irregularly shaped workpieces.

CN121458629BActive Publication Date: 2026-06-23BEIJING PROSPER PRECISION MACHINE TOOL CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING PROSPER PRECISION MACHINE TOOL CO LTD
Filing Date
2025-10-15
Publication Date
2026-06-23

Smart Images

  • Figure CN121458629B_ABST
    Figure CN121458629B_ABST
Patent Text Reader

Abstract

The application provides a detection method and system for precision grinding of a special-shaped workpiece surface, and belongs to the technical field of special-shaped workpiece processing detection. The method comprises the following steps: acquiring multi-angle image data of a ground surface of a special-shaped workpiece, pre-processing the multi-angle image data to obtain first image data; inputting the first image data into a pre-trained deep learning detection model to obtain a first detection result containing a defect feature vector, wherein the detection model is obtained by training a multi-dimensional labeled training data set of typical defects of a special-shaped workpiece through a transfer learning framework; judging whether the surface of the special-shaped workpiece has defects according to a defect confidence of the first detection result and a defect confidence threshold value, and if there are defects, performing pattern matching according to the defect feature vector and defect types in a preset defect template library to obtain a defect type detection result. The detection method and system for precision grinding of a special-shaped workpiece surface provided by the application improve the accuracy and efficiency of detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of inspection technology for irregularly shaped workpieces, and in particular to an inspection method and system for precision grinding of the surface of irregularly shaped workpieces. Background Technology

[0002] In modern manufacturing, irregularly shaped workpieces are widely used in high-end fields such as aerospace and precision instruments due to their unique structure and complex curved surfaces. The grinding process of irregularly shaped workpieces is extremely complex. Due to their irregular shape, the grinding conditions vary significantly in different parts, making the ground surface prone to quality problems such as burns, cracks, and non-compliant surface roughness. Once defects exist on the ground surface of an irregularly shaped workpiece, in actual use, it will not only seriously affect the workpiece's wear resistance and corrosion resistance, but also lead to a decrease in fatigue strength and a significant shortening of the workpiece's service life.

[0003] Existing grinding surface inspection methods, such as pickling, colorimetry, and surface microhardness testing, have many drawbacks when dealing with irregularly shaped workpieces, including low inspection efficiency, poor accuracy, and destructive effects on the workpiece. These methods are insufficient to meet the urgent needs of modern manufacturing for high-precision and high-efficiency inspection of irregularly shaped workpieces.

[0004] Therefore, there is an urgent need for a precise and efficient detection method and system for precision grinding of irregularly shaped workpiece surfaces. Summary of the Invention

[0005] To address the aforementioned technical problems, this application provides a method and system for detecting precision grinding of irregularly shaped workpiece surfaces.

[0006] A first aspect of this application provides a method for detecting precision grinding of the surface of an irregularly shaped workpiece, comprising:

[0007] Acquire multi-angle image data of the grinding surface of the irregular workpiece, and preprocess the multi-angle image data to obtain the first image data;

[0008] The first image data is input into a pre-trained deep learning detection model to obtain a first detection result containing defect feature vectors. The detection model is obtained by training a multi-dimensional labeled training dataset of typical defects of irregular workpieces using a transfer learning framework.

[0009] Based on the defect confidence level and defect confidence level threshold of the first detection result, it is determined whether there is a defect on the surface of the irregular workpiece. If there is a defect, pattern matching is performed between the defect feature vector and the defect type in the preset defect template library to obtain the defect type detection result.

[0010] A second aspect of this application provides a detection system for precision grinding of irregularly shaped workpiece surfaces, comprising:

[0011] The image processing module is used to acquire multi-angle image data of the grinding surface of the irregular workpiece, and to preprocess the multi-angle image data to obtain the first image data;

[0012] The model detection module is used to input the first image data into a pre-trained deep learning detection model to obtain a first detection result containing defect feature vectors. The detection model is obtained by training a multi-dimensional labeled training dataset of typical defects of irregular workpieces through a transfer learning framework.

[0013] The result processing module is used to determine whether there are defects on the surface of the irregular workpiece based on the defect confidence threshold of the first detection result. If there are defects, the module performs pattern matching between the defect feature vector and the defect type in the preset defect template library to obtain the defect type detection result.

[0014] A third aspect of this application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor executes the computer program to implement the steps of the above-described detection method for precision grinding of the surface of an irregularly shaped workpiece.

[0015] In a fourth aspect of this application, a computer-readable storage medium is provided, the computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the above-described method for detecting precision grinding of the surface of an irregularly shaped workpiece.

[0016] The beneficial effects of the detection method and system for precision grinding of irregularly shaped workpiece surfaces provided in this application are as follows: Firstly, by acquiring and preprocessing multi-angle image data, this application can comprehensively and clearly present the detailed information of the ground surface of irregularly shaped workpieces, avoiding missed detections due to limited viewing angles and significantly improving the accuracy and completeness of detection. Secondly, by using a transfer learning framework to train a deep learning detection model, combined with a multi-dimensional labeled training dataset, the model can accurately identify various typical defects, reducing reliance on large amounts of sample data. Finally, based on defect confidence and a defect type judgment method using a pre-set defect template library, rapid and accurate defect classification is achieved, improving detection efficiency and reducing labor costs. Attached Figure Description

[0017] Figure 1 A schematic flowchart illustrating a method for detecting precision grinding of the surface of an irregularly shaped workpiece according to an embodiment of this application;

[0018] Figure 2 A structural block diagram of a detection system for precision grinding of irregularly shaped workpiece surfaces provided in an embodiment of this application;

[0019] Figure 3 This is a schematic block diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0020] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.

[0021] To make the purpose, technical solution, and advantages of this application clearer, the following will be described in conjunction with the appendix. Figure 1-3 The following is an explanation using specific examples.

[0022] Please refer to Figure 1 , Figure 1 This application provides a flowchart illustrating a method for detecting precision grinding of irregularly shaped workpiece surfaces according to an embodiment of the present application. The method includes:

[0023] S101: Acquire multi-angle image data of the grinding surface of the irregular workpiece, preprocess the multi-angle image data to obtain the first image data.

[0024] In this embodiment, the multi-angle image data is obtained by using an industrial camera array or a camera mounted on a robotic arm to capture images from multiple angles around the irregularly shaped workpiece. When specifically capturing images of the irregularly shaped workpiece, the shooting angle needs to be reasonably set according to the complexity of the workpiece's shape and the required detection accuracy to ensure complete information about the workpiece surface and avoid detection blind spots. Furthermore, during the acquisition process, to ensure consistent image quality, it is necessary to control the lighting conditions, using a uniform ring light source or backlight, and adjusting the light source brightness to an appropriate level to avoid overexposure or underexposure.

[0025] In this embodiment, the acquired multi-angle image data undergoes preprocessing, including image denoising, grayscale conversion, and normalization. In the image denoising stage, wavelet transform, median filtering, and Gaussian filtering algorithms can be used to effectively remove salt-and-pepper noise and Gaussian noise from the image, smooth image edges, and retain key feature information. Grayscale conversion transforms the color image into a grayscale image, simplifying data dimensions and improving subsequent processing efficiency. Commonly used grayscale conversion methods include weighted average and maximum value methods. Normalization maps image pixel values ​​to the range [0,1] or [0,255], eliminating brightness differences between different images and ensuring data consistency and comparability. Therefore, the first image data obtained after preprocessing can provide a high-quality data foundation for subsequent defect detection.

[0026] S102: Input the first image data into the pre-trained deep learning detection model to obtain the first detection result containing the defect feature vector. The detection model is obtained by training a multi-dimensional labeled training dataset of typical defects of irregular workpieces through a transfer learning framework.

[0027] In this embodiment, the detection model is trained based on a transfer learning framework. First, a deep learning model pre-trained on a large-scale image dataset is selected as the base model. Then, a multi-dimensional labeled training dataset is constructed for typical defects on irregularly shaped workpieces; this dataset contains feature information such as the shape, size, and texture of the defects. By fine-tuning some parameters of the base model, the model is trained using the constructed training dataset, enabling the model to learn the feature representation of surface defects on irregularly shaped workpieces. During training, the cross-entropy loss function and optimization algorithms (such as stochastic gradient descent and its variants) are used to continuously adjust the model parameters, improving the model's detection accuracy and generalization ability. After multiple rounds of iterative training, a high-performance pre-trained deep learning detection model is obtained.

[0028] In this embodiment, the preprocessed first image data is input into a pre-trained deep learning detection model. The model extracts and analyzes features from the image and outputs a first detection result containing defect feature vectors. The defect feature vectors contain key information such as the location, shape, and texture of the defect in the image, providing a basis for subsequent defect judgment and type identification.

[0029] S103: Determine whether there are defects on the surface of the irregular workpiece based on the defect confidence level and defect confidence level threshold of the first detection result. If there are defects, perform pattern matching between the defect feature vector and the defect type in the preset defect template library to obtain the defect type detection result.

[0030] In this embodiment, the presence of defects on the surface of the irregularly shaped workpiece is determined based on the defect confidence level in the first detection result and a pre-set defect confidence threshold. The defect confidence level is the model's assessment of the reliability of detected potential defects, ranging from 0 to 1. A higher value indicates a greater likelihood that the model believes a defect exists in that area. When the defect confidence level in the detection result is greater than the defect confidence threshold, the irregularly shaped workpiece surface is determined to have a defect; otherwise, the workpiece surface is considered defect-free. The defect confidence threshold can be adjusted based on actual detection needs and historical detection data.

[0031] In this embodiment, if a defect is determined to exist on the surface of an irregularly shaped workpiece, pattern matching is performed between the defect feature vector and the defect types in a preset defect template library. The preset defect template library stores feature templates for various typical defects, obtained by analyzing and extracting features from a large number of known defect samples. During the pattern matching process in this embodiment, algorithms such as Euclidean distance and cosine similarity can be used to calculate the similarity between the defect feature vector and each defect template. The defect type corresponding to the defect template with the highest similarity is selected as the defect type detection result. This embodiment, through this method, can accurately identify the defect types present on the ground surface of an irregularly shaped workpiece.

[0032] As can be seen from the above, this application has higher detection efficiency and accuracy. Through multi-angle image acquisition and the application of deep learning models, it can detect defects of various complex shapes and minute sizes, overcoming the limitations of traditional manual inspection and simple image processing methods. At the same time, the use of the transfer learning framework reduces the time and amount of data required for model training, improves the model's adaptability and generalization ability, and is suitable for the inspection of ground surfaces of irregularly shaped workpieces of different types and specifications, showing broad application prospects and promotional value.

[0033] In one embodiment of this application, the method for detecting precision grinding of the surface of an irregularly shaped workpiece further includes:

[0034] Based on the defect area location data output by the detection model, combined with the spatial coordinate mapping relationship of the preprocessed image, the geometric position coordinates of the defect on the workpiece surface are calculated by the three-dimensional point cloud reconstruction algorithm.

[0035] The defect type detection results and geometric location coordinates are fused to generate a comprehensive inspection report.

[0036] In this embodiment, based on the defect area location data output by the detection model and combined with the spatial coordinate mapping relationship of the preprocessed image, the geometric position coordinates of the defect on the workpiece surface are calculated using a 3D point cloud reconstruction algorithm. Specifically, the pixel coordinates of the defect are determined in the preprocessed image based on the defect area location data. Then, using the pre-established mapping relationship between the image and the actual spatial coordinates, the pixel coordinates are converted into coordinate points in the actual space. Then, using the coordinate points of multiple images from different angles, a 3D point cloud reconstruction algorithm (such as a feature matching algorithm or a stereo vision algorithm) is used to construct a 3D point cloud model of the defect area, and calculate the geometric position coordinates of the defect on the workpiece surface, including the 3D spatial location and size of the defect.

[0037] In this embodiment, defect type detection results and geometric location coordinates are fused to generate a comprehensive inspection report. Specifically, during the data fusion process, information such as defect type, severity, geometric location coordinates, and three-dimensional dimensions are integrated and presented in an intuitive and clear manner. The comprehensive inspection report can use a combination of charts and text, for example, displaying the defect's location on the workpiece using a three-dimensional model and listing the defect's various parameters in detail using a table. This report not only provides production personnel with specific information about defects, facilitating timely repairs, but also provides quality management personnel with data analysis support for evaluating the stability of production processes and product quality levels.

[0038] This embodiment further enriches the information dimensions of the detection results through the defect spatial localization and comprehensive report generation process.

[0039] In one embodiment of this application, multi-angle image data is preprocessed, and the first image data includes:

[0040] The first denoised image data is obtained by denoising multi-angle image data based on the wavelet transform algorithm.

[0041] The first denoised image data is registered to obtain the first registered image data;

[0042] The first image data is obtained by performing non-uniform illumination correction on the first registered image data based on the histogram.

[0043] In this embodiment, the wavelet transform algorithm, based on multiresolution analysis theory, can decompose an image into sub-bands of different frequencies. When denoising multi-angle image data, this algorithm can effectively separate noise and useful signals in the image.

[0044] Noise in multi-angle image data is typically distributed in the high-frequency sub-band, while key features such as image edges and textures are concentrated in the low-frequency and some mid-frequency sub-bands. By thresholding the coefficients of the high-frequency sub-band (such as soft thresholding or hard thresholding), suppressing the coefficients corresponding to noise, and then performing inverse wavelet transform, the first denoised image data can be obtained, which can remove noise while preserving image details to the greatest extent.

[0045] In this embodiment, since the images taken from multiple angles have differences in viewpoint and position, it is necessary to perform a registration operation on the first denoised image data. The image registration in this embodiment is based on finding the spatial transformation relationship between corresponding points in different images by feature points. By extracting feature points (edge ​​points) in the image, calculating the matching relationship between feature points, and then determining the transformation parameters such as rotation, translation, and scaling between images, the images from different viewpoints are unified into the same coordinate system to obtain the first registered image data.

[0046] In this embodiment, even with a uniform light source, non-uniform illumination can still occur during multi-angle shooting, affecting image quality and subsequent defect detection. This embodiment corrects the non-uniform illumination of the first registered image data based on histograms, adjusting the grayscale distribution to make the overall brightness of the image more uniform. Specifically, histogram equalization or adaptive histogram equalization can be used to correct the non-uniform illumination of the first registered image data. Histogram equalization increases image contrast by stretching the image's grayscale histogram; adaptive histogram equalization performs histogram equalization in local areas to better adapt to the illumination differences in different regions of the image, thus obtaining the first image data.

[0047] In one embodiment of this application, the first denoised image data is registered to obtain the first registered image data, including: multi-view image registration technology based on SIFT feature points, mapping images taken from different angles in the first denoised image data to a unified three-dimensional coordinate system, and using the geometric constraints provided by the workpiece CAD model to compensate for registration errors, thereby obtaining the first registered image data.

[0048] In this embodiment, since images captured from multiple angles have differences in viewpoint and position, registration of the first denoised image data is required. This embodiment employs multi-view image registration technology based on SIFT feature points, and the specific process is as follows:

[0049] The first step involves extracting feature points from each image captured at different angles in the first denoised image data using the SIFT (Scale Invariant Feature Transform) algorithm. These feature points contain stable and representative local information within the image. Specifically, the SIFT algorithm constructs a Gaussian difference pyramid to detect extreme points in different scale spaces and calculates their principal orientation and descriptive values, thereby extracting feature points that are scale-invariant, rotation-invariant, and illumination-invariant.

[0050] The second step involves calculating the Euclidean distance between feature point descriptors of different images and employing strategies such as nearest neighbor matching or bidirectional matching to find the correspondence between feature points in different images. Methods such as ratio testing can also be introduced to eliminate incorrect matching points and improve matching accuracy.

[0051] The third step involves calculating the transformation matrix between different images based on the matched feature point pairs using methods such as least squares. This transformation matrix includes rotation, translation, and scaling parameters. Using this transformation matrix, images taken from different angles are mapped to a unified three-dimensional coordinate system, thus completing the initial image registration.

[0052] The fourth step involves compensating for registration errors using the geometric constraints provided by the workpiece CAD model. The registered image features are compared with the geometric structure in the CAD model to calculate the registration errors caused by factors such as shooting angle and camera parameters. By adjusting the transformation matrix or fine-tuning the image, the workpiece features in the image are better aligned with the CAD model, further improving registration accuracy and ultimately obtaining the first registered image data.

[0053] In one embodiment of this application, pattern matching is performed between the defect feature vector and the defect types in a preset defect template library to obtain a defect type detection result, including:

[0054] The K-nearest neighbor algorithm is used to calculate the Euclidean distance between the defect feature vector and each template in the preset defect template library, and the k templates with the smallest distance are selected as candidate defect types.

[0055] Statistically analyze the frequency of occurrence of each defect type among k candidate defect types, and take the defect type with the highest frequency as the defect type detection result.

[0056] In this embodiment, the K-Nearest Neighbors (KNN) algorithm is used to calculate the Euclidean distance between the defect feature vector and each template in the preset defect template library. Euclidean distance measures the similarity between two vectors in space; the closer the distance, the more similar their features. The k templates with the smallest distances are selected as candidate defect types. The value of k needs to be adjusted according to the actual situation. Generally, a smaller k value makes the classification result more sensitive to nearest neighbors, while a larger k value makes the classification result smoother. The optimal k value is usually determined through cross-validation.

[0057] In this embodiment, the frequency of occurrence of each defect type among k candidate defect types is statistically analyzed, and the defect type with the highest frequency is taken as the final defect type detection result. This method avoids the influence of individual abnormal templates on the judgment result when multiple similar templates are obtained, enabling more accurate identification of defect types and providing a reliable basis for subsequent repair and quality improvement. This embodiment, through this method, can accurately identify the defect types present on the ground surface of irregularly shaped workpieces, providing guidance for subsequent repair and quality improvement.

[0058] In one embodiment of this application, pattern matching is performed between the defect feature vector and the defect type in a preset defect template library to obtain a defect type detection result, and the method further includes:

[0059] When multiple defect types have the same highest frequency of occurrence, calculate the mean Euclidean distance between the templates corresponding to each defect type with the same frequency, and select the defect type with the smallest mean Euclidean distance as the defect type detection result.

[0060] In this embodiment, the frequency of occurrence of each defect type among k candidate defect types is statistically analyzed, and the defect type with the highest frequency is taken as the preliminary defect type detection result. If multiple defect types have the same highest frequency, the mean Euclidean distance of the templates corresponding to each defect type with the same frequency is further calculated. Specifically, for each defect type with the same frequency, the Euclidean distances between all templates of that type and the defect feature vector are added together, and then divided by the number of templates to obtain the mean Euclidean distance of that defect type. Finally, the defect type with the smallest mean Euclidean distance is selected as the final defect type detection result. This processing method further refines the judgment logic and can still accurately identify defect types in complex situations. In this embodiment, this method can accurately identify the defect types present on the grinding surface of irregularly shaped workpieces.

[0061] In one embodiment of this application, the method for calculating the defect confidence threshold includes:

[0062] The defect confidence threshold is calculated by weighting the light intensity and the surface roughness of the ground surface of the irregular workpiece.

[0063] In this embodiment, the formula for calculating the defect confidence threshold based on the weighted average of light intensity and surface roughness of the irregularly shaped workpiece is as follows:

[0064]

[0065] in, The baseline confidence threshold is determined by the balance between recall and precision of the model under standard operating conditions. The measured surface roughness value of the irregularly shaped workpiece; This serves as a roughness reference value (set according to the workpiece process specifications); This represents the current light intensity. The maximum permissible light intensity (obtained by the imaging hardware); This is the roughness influence coefficient; This is the light attenuation coefficient. This embodiment uses... To achieve sublinear growth and avoid oversensitivity to the threshold under high roughness, exponential decay is employed. The threshold is significantly reduced under strong light.

[0066] In this embodiment, the roughness influence coefficient and light attenuation coefficient It can also be obtained using the following formula:

[0067]

[0068]

[0069] in, This is the basic roughness coefficient, determined by the materials and processes database; The texture sensitivity factor is extracted from the pre-trained model through transfer learning (the L2 norm normalized value of the feature vector of the last layer of ResNet). To calculate the standard deviation of surface texture, the LoG operator is applied to the preprocessed image to calculate the standard deviation of grayscale in non-defect areas. To reference texture intensity, ideal surface parameters are read from the CAD model based on the workpiece type; This is the basic coefficient for light attenuation; For effective contrast, the average gray level of the defective area / the average gray level of the non-defective area. The maximum theoretical contrast ratio of the system is calculated from the camera's dynamic range and the light source's brightness. .

[0070] In this embodiment, light intensity is a key factor affecting image quality, and it is acquired indirectly through a light sensor or the brightness information of the image itself.

[0071] The light sensors include silicon photovoltaic cells, photoresistors, and thermocoupled light intensity sensors, which can directly measure the light intensity of the environment or workpiece surface. The deployment method involves integrating the light sensor into the detection equipment and installing it near the light source or above the workpiece to monitor light intensity fluctuations in real time. In this example, the sensor signals can also be connected to an industrial control computer via a multi-channel data acquisition card to record data synchronously with the image acquisition system.

[0072] In this embodiment, the illumination intensity is estimated based on image brightness analysis by analyzing the grayscale distribution of image pixels. Specifically, an image of a standard white board (with known reflectivity) is acquired under the current illumination, and its average grayscale value is calculated. According to the formula: Illumination Intensity = K × Average Grayscale Value (K is a calibration coefficient determined experimentally), a mapping relationship between grayscale values ​​and actual illumination intensity is established. In this embodiment, surface roughness reflects the microscopic geometric features of the workpiece surface (such as undulations and textures). The acquisition methods are divided into contact measurement and non-contact measurement; industrial inspection tends to favor non-contact methods to improve efficiency.

[0073] In one embodiment of this application, the preset defect template library is constructed in the following manner:

[0074] Cluster analysis is performed on the defect feature vectors of the historical defect dataset to generate representative templates;

[0075] Priority weights are assigned to each template based on the probability of occurrence of defect types in actual detection scenarios.

[0076] In this embodiment, cluster analysis is performed on the defect feature vectors of the historical defect dataset to group defects with similar features into the same cluster. The centroid or typical sample of each cluster serves as a representative template for that type of defect. For example, the feature vectors of common defects on grinding surfaces, such as "scratches," "pits," and "cracks," are clustered to generate corresponding templates. Priority weights are assigned to each template based on the probability of each defect type occurring in the actual inspection scenario. Defect types with higher occurrence probabilities receive larger weights (weight range: 0.1-1.0). For example, if "scratches" account for 40% of the historical data, their weight can be set to 0.8; if "cracks" account for 10%, their weight can be set to 0.3. Weights can be determined through historical data statistical frequency or process risk level.

[0077] Corresponding to the detection method for precision grinding of irregularly shaped workpiece surfaces in the above embodiments, Figure 2 This is a structural block diagram of a detection system for precision grinding of irregularly shaped workpiece surfaces, provided in one embodiment of this application. For ease of explanation, only the parts relevant to the embodiment of this application are shown. References Figure 2 The detection system 20 for precision grinding of irregular workpiece surfaces includes: an image processing module 21, a model detection module 22, and a result processing module 23.

[0078] Among them, the image processing module 21 is used to acquire multi-angle image data of the grinding surface of the irregular workpiece, and preprocess the multi-angle image data to obtain the first image data;

[0079] The model detection module 22 is used to input the first image data into a pre-trained deep learning detection model to obtain a first detection result containing defect feature vectors. The detection model is obtained by training a multi-dimensional labeled training dataset of typical defects of irregular workpieces through a transfer learning framework.

[0080] The result processing module 23 is used to determine whether there are defects on the surface of the irregular workpiece based on the defect confidence threshold of the first detection result. If there are defects, the module performs pattern matching between the defect feature vector and the defect type in the preset defect template library to obtain the defect type detection result.

[0081] In one embodiment of this application, the result processing module 23 is further specifically used for:

[0082] Based on the defect area location data output by the detection model, combined with the spatial coordinate mapping relationship of the preprocessed image, the geometric position coordinates of the defect on the workpiece surface are calculated by the three-dimensional point cloud reconstruction algorithm.

[0083] The defect type detection results and geometric location coordinates are fused to generate a comprehensive inspection report.

[0084] In one embodiment of this application, the image processing module 21 is specifically used for:

[0085] The first denoised image data is obtained by denoising multi-angle image data based on the wavelet transform algorithm.

[0086] The first denoised image data is registered to obtain the first registered image data;

[0087] The first image data is obtained by performing non-uniform illumination correction on the first registered image data based on the histogram.

[0088] In one embodiment of this application, the image processing module 21 is specifically used for:

[0089] The multi-view image registration technology based on SIFT feature points maps images taken from different angles in the first denoised image data to a unified three-dimensional coordinate system, and uses the geometric constraints provided by the workpiece CAD model to compensate for registration errors, thus obtaining the first registered image data.

[0090] In one embodiment of this application, the result processing module 23 is specifically used for:

[0091] The K-nearest neighbor algorithm is used to calculate the Euclidean distance between the defect feature vector and each template in the preset defect template library, and the k templates with the smallest distance are selected as candidate defect types.

[0092] Statistically analyze the frequency of occurrence of each defect type among k candidate defect types, and take the defect type with the highest frequency as the defect type detection result.

[0093] In one embodiment of this application, the result processing module 23 is specifically used for:

[0094] When multiple defect types have the same highest frequency of occurrence, calculate the mean Euclidean distance between the templates corresponding to each defect type with the same frequency, and select the defect type with the smallest mean Euclidean distance as the defect type detection result.

[0095] In one embodiment of this application, the result processing module 23 is specifically used for:

[0096] The defect confidence threshold is calculated by weighting the light intensity and the surface roughness of the ground surface of the irregular workpiece.

[0097] See Figure 3 , Figure 3 This is a schematic block diagram of an electronic device provided according to an embodiment of this application. Figure 3The electronic device 300 in this embodiment may include one or more processors 301, one or more input devices 302, one or more output devices 303, and one or more memories 304. The processors 301, input devices 302, output devices 303, and memories 304 communicate with each other via a communication bus 305. The memories 304 store computer programs, including program instructions. The processors 301 execute the program instructions stored in the memories 304. Specifically, the processors 301 are configured to invoke the program instructions to perform the functions of the modules in the aforementioned device embodiments, for example... Figure 2 The functions of the image processing module 21, model detection module 22, and result processing module 23 are shown.

[0098] It should be understood that, in the embodiments of this application, the processor 301 may be a central processing unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.

[0099] Input device 302 may include a touchpad, a fingerprint sensor (for collecting the user's fingerprint information and fingerprint orientation information), a microphone, etc., and output device 303 may include a display (LCD, etc.), a speaker, etc.

[0100] The memory 304 may include read-only memory and random access memory, and provides instructions and data to the processor 301. A portion of the memory 304 may also include non-volatile random access memory. For example, the memory 304 may also store device type information.

[0101] In specific implementations, the processor 301, input device 302, and output device 303 described in the embodiments of this application can execute the implementation methods described in any embodiment of the detection method for precision grinding of irregular workpiece surfaces provided in the embodiments of this application, or they can execute the implementation methods of the electronic devices described in the embodiments of this application, which will not be repeated here.

[0102] In another embodiment of this application, a computer-readable storage medium is provided. This computer-readable storage medium stores a computer program, which includes program instructions. When executed by a processor, the program instructions implement all or part of the processes in the methods described above. Alternatively, the computer program can instruct related hardware to complete the process. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include any entity or device capable of carrying computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc.

[0103] The computer-readable storage medium can be an internal storage unit of the electronic device in any of the foregoing embodiments, such as a hard disk or memory of the electronic device. The computer-readable storage medium can also be an external storage device of the electronic device, such as a plug-in hard disk, smart media card (SMC), secure digital card (SD), flash card, etc., equipped on the electronic device. Furthermore, the computer-readable storage medium can include both internal and external storage units of the electronic device. The computer-readable storage medium is used to store computer programs and other programs and data required by the electronic device. The computer-readable storage medium can also be used to temporarily store data that has been output or will be output.

[0104] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this application.

[0105] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the electronic devices and units described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0106] In the several embodiments provided in this application, it should be understood that the disclosed electronic devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces or units, or it may be an electrical, mechanical, or other form of connection.

[0107] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of the embodiments of this application, depending on actual needs.

[0108] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0109] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for detecting precision grinding of irregularly shaped workpiece surfaces, characterized in that, include: Acquire multi-angle image data of the grinding surface of the irregular workpiece, and preprocess the multi-angle image data to obtain the first image data; The first image data is input into a pre-trained deep learning detection model to obtain a first detection result containing defect feature vectors. The detection model is obtained by training a multi-dimensional labeled training dataset of typical defects of irregular workpieces using a transfer learning framework. Based on the defect confidence level and defect confidence threshold of the first detection result, it is determined whether there is a defect on the surface of the irregular workpiece. If there is a defect, pattern matching is performed between the defect feature vector and the defect type in the preset defect template library to obtain the defect type detection result. The preprocessing of the multi-angle image data to obtain the first image data includes: The multi-angle image data is denoised based on the wavelet transform algorithm to obtain the first denoised image data. The multi-view image registration technology based on SIFT feature points maps images taken from different angles in the first denoised image data to a unified three-dimensional coordinate system, and uses the geometric constraints provided by the workpiece CAD model to compensate for registration errors, thereby obtaining the first registered image data. Based on the histogram, non-uniform illumination correction is performed on the first registered image data to obtain the first image data; The method for calculating the defect confidence threshold includes: The defect confidence threshold is calculated based on a weighted average of the light intensity and the roughness of the ground surface of the irregular workpiece. The formula for calculating the defect confidence threshold based on the weighted average of light intensity and surface roughness of the irregularly shaped workpiece is as follows: in, The baseline confidence threshold; The measured surface roughness value of the irregularly shaped workpiece; This serves as a roughness reference value. This represents the current light intensity. The maximum permissible light intensity; This is the roughness influence coefficient; This is the light attenuation coefficient.

2. The method for detecting precision grinding of irregularly shaped workpiece surfaces according to claim 1, characterized in that, Also includes: Based on the defect area location data output by the detection model, and combined with the spatial coordinate mapping relationship of the preprocessed image, the geometric position coordinates of the defect on the workpiece surface are calculated by a three-dimensional point cloud reconstruction algorithm. The detection results of the defect type and the geometric location coordinates are fused to generate a comprehensive detection report.

3. The method for detecting precision grinding of irregularly shaped workpiece surfaces according to claim 1, characterized in that, The step of performing pattern matching between the defect feature vector and the defect types in a preset defect template library to obtain defect type detection results includes: The K-nearest neighbor algorithm is used to calculate the Euclidean distance between the defect feature vector and each template in the preset defect template library, and the k templates with the smallest distance are selected as candidate defect types. Statistically analyze the frequency of occurrence of each defect type among k candidate defect types, and take the defect type with the highest frequency as the defect type detection result.

4. The method for detecting precision grinding of irregularly shaped workpiece surfaces according to claim 3, characterized in that, Also includes: When multiple defect types have the same highest frequency of occurrence, calculate the mean Euclidean distance between the templates corresponding to each defect type with the same frequency, and select the defect type with the smallest mean Euclidean distance as the defect type detection result.

5. A detection system for precision grinding of irregularly shaped workpiece surfaces, characterized in that, include: The image processing module is used to acquire multi-angle image data of the grinding surface of the irregular workpiece, and to preprocess the multi-angle image data to obtain the first image data; The model detection module is used to input the first image data into a pre-trained deep learning detection model to obtain a first detection result containing defect feature vectors. The detection model is obtained by training a multi-dimensional labeled training dataset of typical defects of irregular workpieces through a transfer learning framework. The result processing module is used to determine whether there are defects on the surface of the irregular workpiece based on the defect confidence and defect confidence threshold of the first detection result. If there are defects, the module performs pattern matching between the defect feature vector and the defect type in the preset defect template library to obtain the defect type detection result. The preprocessing of the multi-angle image data to obtain the first image data includes: The multi-angle image data is denoised based on the wavelet transform algorithm to obtain the first denoised image data. The multi-view image registration technology based on SIFT feature points maps images taken from different angles in the first denoised image data to a unified three-dimensional coordinate system, and uses the geometric constraints provided by the workpiece CAD model to compensate for registration errors, thereby obtaining the first registered image data. Based on the histogram, non-uniform illumination correction is performed on the first registered image data to obtain the first image data; The method for calculating the defect confidence threshold includes: The defect confidence threshold is calculated based on a weighted average of the light intensity and the roughness of the ground surface of the irregular workpiece. The formula for calculating the defect confidence threshold based on the weighted average of light intensity and surface roughness of the irregularly shaped workpiece is as follows: in, The baseline confidence threshold; The measured surface roughness value of the irregularly shaped workpiece; This serves as a roughness reference value. This represents the current light intensity. The maximum permissible light intensity; This is the roughness influence coefficient; This is the light attenuation coefficient.

6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method as described in any one of claims 1 to 4.

7. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 4.