Part geometric parameter detection method and system based on sub-pixel edge search

Through the detection method based on subpixel edge search, the area of ​​interest and edge pixel-level coarse positioning points of the part image are extracted, the subpixel coordinates are calculated using Zernike moments to perform part posture perception and key point search, and the detection parameters are optimized in combination with the improved particle swarm algorithm, which solves the problem of low detection efficiency and manual dependence in the existing technology, and realizes efficient and accurate detection of part geometric parameters.

CN119693657APending Publication Date: 2025-03-25SUZHOU XINGXIBO INFORMATION TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411747488.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-02
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

The existing geometric dimension detection methods for parts are inefficient, their accuracy depends on manual operation and are prone to human errors. The traditional methods have high requirements for professional equipment and technology, making it difficult to achieve fast and accurate inspection.

Method used

The detection method based on subpixel edge search is adopted, and the area of ​​interest and edge pixel-level coarse positioning points of the part image are extracted through image acquisition and preprocessing. The subpixel coordinates are calculated using Zernike moments to perform part posture perception and key point search. The detection parameters are optimized in combination with the improved particle swarm algorithm to improve detection accuracy.

Benefits of technology

It improves the efficiency and accuracy of part geometric parameter detection, reduces noise interference, achieves fast and accurate detection, and reduces the occurrence of human errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119693657A_ABST
    Figure CN119693657A_ABST
Patent Text Reader

Abstract

The invention discloses a part geometric parameter detection method and system based on sub-pixel edge search, and relates to the technical field of digital measurement, and the method comprises the steps: collecting a part image, extracting a region of interest of the part image, and obtaining a part edge pixel-level coarse positioning point; calculating sub-pixel coordinates of the edge of the part based on a Zernike moment to perform part attitude sensing, and searching key points of the part by utilizing part attitude information; geometric parameters of the part are calculated through the obtained coordinates of the key points of the part, integration is carried out based on the geometric parameters of the part, and detection errors of different geometric parameter categories are obtained through analysis; detection parameters related to errors are determined, the related detection parameters are optimized by using an improved particle swarm algorithm, and the detection precision is fed back by configuring a detection system. According to the method, the sub-pixel edge of the part image is accurately extracted, the optimal detection parameters of the part are determined through error evaluation, and the efficiency and precision of part geometric parameter detection are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of digital measurement technology, and more specifically, to a method and system for detecting part geometric parameters based on sub-pixel edge search. Background Art

[0002] Parts geometry inspection methods mainly include traditional inspection and machine vision inspection. Traditional inspection methods mainly include manual inspection, optical projection inspection and three-coordinate inspection. Manual inspection generally uses traditional inspection tools such as vernier calipers, micrometers and micrometers, which are highly dependent on operators, have low efficiency, and may cause human errors, making it impossible to effectively guarantee product quality; although optical projectors and three-coordinate inspections have high accuracy, the reading process is cumbersome, the measurement time is long, and the requirements for professional equipment and professional technology are extremely high.

[0003] The non-contact, real-time, efficient and flexible nature of machine vision measurement technology, as well as its wide range of applicable scenarios, are unmatched by traditional measurement methods, and its automation level is getting higher and higher. As a non-contact intelligent detection technology, machine vision has great potential in the field of measurement, and in the long run, it can also effectively reduce costs. With the development of industrial detection technology, machine vision methods have been widely used in part geometry detection. Through image acquisition and image processing technology, high-speed and accurate detection is achieved, with a low human error rate and a high degree of automation, and it has significant advantages in the field of part geometry detection. Therefore, how to use machine vision methods to accurately measure parts and control errors in multiple dimensions and geometric shapes to ensure the quality and performance of parts is an urgent problem to be solved. Summary of the invention

[0004] In order to solve the above technical problems, the present invention proposes a part geometric parameter detection method and system based on sub-pixel edge search, which aims to improve the efficiency and accuracy of part geometric parameter detection by accurately extracting the sub-pixel edges of the part image and determining the optimal detection parameters of the part by error evaluation.

[0005] A first aspect of the present invention provides a method for detecting geometric parameters of a part based on sub-pixel edge search, comprising the following steps:

[0006] Read the part image through image acquisition, pre-process the part image, extract the region of interest of the part image, and extract the pixel-level coarse positioning points of the part edge in the region of interest;

[0007] Calculate the sub-pixel coordinates of the edge of the part based on the Zernike moment according to the pixel-level coarse positioning points of the edge of the part, perceive the posture of the part through the sub-pixel coordinates, and search for the key points of the part using the posture information of the part;

[0008] The geometric parameters of the parts are calculated by obtaining the coordinates of the key points of the parts, and the geometric parameters of the parts are integrated to analyze and obtain the detection errors of different geometric parameter categories;

[0009] Relevant detection parameters are determined according to the detection error, and the improved particle swarm algorithm is used to optimize the relevant detection parameters. The entire process of part geometric parameter detection is configured through the optimal solution of the relevant detection parameters, and feedback is given on the detection accuracy.

[0010] In this solution, the part image is preprocessed to extract the region of interest of the part image, and the pixel-level coarse positioning points of the part edge are extracted in the region of interest, specifically:

[0011] Acquire a part image, perform image enhancement and image denoising on the part image, use the preprocessed part image as training data, use the training data to pre-train a VGG-16 network and a variational autoencoder, and build a pre-training model;

[0012] Importing the image of the part to be detected into the pre-trained model, removing the fully connected layer and the output layer of the VGG-16 network in the pre-trained model, performing a reconstruction operation on the input image of the part to be detected, and using the improved network result to perform feature extraction on the image data to extract the region of interest;

[0013] Performing feature fusion on multi-scale image features in the region of interest, constructing a single feature map through a splicing operation, inputting the single feature map into a variational autoencoder for feature reconstruction, encoding the feature map, mapping it to a low-dimensional latent space, and obtaining a reconstructed feature map through decoding;

[0014] The edge score is calculated according to the difference between the reconstructed feature map and the single feature map, the edge score is used to construct an edge score map, binarization is performed based on the edge score map according to a preset score threshold, and the pixel-level coarse positioning points of the part edge are extracted according to the part binarized image.

[0015] In this solution, the sub-pixel coordinates of the edge of the part are calculated based on the Zernike moment according to the pixel-level coarse positioning points of the edge of the part, specifically:

[0016] Obtain the parameter values ​​of the 7*7 Zernike moment parameter template, perform convolution operations on the pixel-level coarse positioning points on the edge of the part and the 7 Zernike moment parameter templates to generate 7 Zernike moments;

[0017] The Zernike moment is multiplied according to the horizontal offset angle of the part edge, the part image is corrected, the distance parameter and the grayscale difference parameter of the Zernike moment are calculated, and compared with the preset constraint conditions to determine whether it is an edge point;

[0018] Traverse all edge pixel-level coarse positioning points, and output the sub-pixel coordinates of the part edge after all pixel points are detected.

[0019] In this solution, the part posture perception is performed through the sub-pixel coordinates, and the part posture information is used to search for the key points of the part, specifically:

[0020] Acquire a part edge template according to historical inspection data of the part, select key points of the part according to preset key geometric parameter categories based on the part edge template, and mark the key points of the part in the part edge template;

[0021] Encode the sub-pixel coordinates of the part edge in the part to be detected and the part edge template, segment the part edge, use a multi-layer perceptron to perform single-point feature learning on the sub-pixel coordinates in each part edge sub-segment, and obtain the spatial distribution features of the sub-pixel coordinates in the local area through an average pooling operation to generate local features of the part to be detected and the part edge template;

[0022] The single point features and local features are concatenated on the feature dimension channel, and the local final features of the edge sub-segments in the part to be detected and the part edge template are obtained through maximum pooling and batch normalization operations. The attention mechanism is introduced to obtain weight information, and the local final features of the edge sub-segments are weighted;

[0023] The local final features of the parts to be detected and the part edge template after attention weighting are aggregated through multiple fully connected layers. The pose of the parts is predicted based on the horizontal offset angle of the part edge of the parts to be detected through different network depths in the fully connected layers.

[0024] The posture information of the part to be inspected is used to search and locate the key points of the part, and the sub-pixel coordinates of the key points of the part are read.

[0025] In this solution, the geometric parameters of the parts are calculated by obtaining the coordinates of the key points of the parts, and the geometric parameters of the parts are integrated to analyze and obtain the detection errors of different geometric parameter categories, specifically:

[0026] Fit the coordinates of the key points of the parts according to the preset key geometric parameter categories, obtain the geometric parameter detection results through the fitting results, and generate the geometric parameter set corresponding to the key geometric parameter category;

[0027] The detection accuracy is evaluated by using the mean square error between the detection value and the standard value in different categories of geometric parameter sets to obtain the detection error of different geometric parameter categories.

[0028] In this solution, the relevant detection parameters are determined according to the detection error, and the improved particle swarm algorithm is used to optimize the relevant detection parameters, specifically:

[0029] According to the full process data of part geometric parameter detection, the full process data is divided according to key geometric parameter categories to generate detection parameter sets corresponding to different categories of geometric parameter sets;

[0030] Using the mRMR algorithm and the cross-measurement method to select features in each detection parameter set, obtaining the importance ranking based on the principle that the correlation between the detection parameter and the detection error is maximum and the redundancy between the detection features is minimum through the mRMR algorithm, and selecting a preset number of detection parameters based on the importance ranking;

[0031] According to the selected detection parameters, the SVM is continuously connected to generate a prediction model, the mean square error of the prediction model in the cross-test training process is obtained, and the first n detection parameters with the smallest mean square error are obtained to be determined as detection error related detection parameters;

[0032] Initialize the particle swarm algorithm parameters and particle position and velocity information based on the determined relevant detection parameters, set the fitness function through the detection error, use the fitness function to calculate the individual fitness of the particles, select the individual optimum and the global optimum, introduce the simulated annealing algorithm for iterative optimization, and use the simulated annealing neighborhood search to update the particle position and velocity;

[0033] When the termination condition is met, the iteration is stopped, and the optimal solution of the relevant detection parameters is determined according to the optimal position.

[0034] In this solution, the entire process of part geometric parameter detection is configured through the optimal solution of relevant detection parameters, and the detection accuracy is fed back, specifically:

[0035] Decode the optimal solutions of related detection parameters corresponding to different categories of geometric parameter sets to determine the optimal parameter values, obtain the common detection parameters of different categories, and average the optimal parameter values ​​corresponding to the overlapping detection parameters;

[0036] Use the optimal parameter values ​​corresponding to the relevant detection parameters unique to different categories and the average optimal parameter values ​​of the common relevant detection parameters to configure the entire process of part geometric parameter detection;

[0037] The detection accuracy of different categories of geometric parameter sets is obtained. When the detection accuracy is less than a preset accuracy threshold, the historical geometric parameter detection data is used to re-optimize the relevant detection parameters unique to the category.

[0038] The second aspect of the present invention provides a part geometric parameter detection system based on sub-pixel edge search, the system comprising: an image acquisition and preprocessing module, a sub-pixel edge extraction module, a part key point search module, a geometric parameter calculation module, a detection error evaluation module and a detection accuracy feedback module;

[0039] The image acquisition and preprocessing module is responsible for acquiring part images, preprocessing the part images, extracting regions of interest of the part images, and extracting pixel-level coarse positioning points of the part edges in the regions of interest;

[0040] The sub-pixel edge extraction module is responsible for calculating the sub-pixel coordinates of the part edge based on the Zernike moment according to the pixel-level coarse positioning points of the part edge, so as to achieve fine positioning of the part edge;

[0041] The part key point search module is responsible for sensing the part posture through sub-pixel coordinates and searching for the part key points using the part posture information;

[0042] The geometric parameter calculation module is responsible for calculating the geometric parameters of the part using the acquired coordinates of the key points of the part;

[0043] The detection error evaluation module is integrated based on the geometric parameters of the parts, and analyzes and obtains detection errors of different geometric parameter categories;

[0044] The detection accuracy feedback module is responsible for determining relevant detection parameters according to the detection error, optimizing the relevant detection parameters using the improved particle swarm algorithm, and configuring the entire process of part geometric parameter detection through the optimal solution of the relevant detection parameters to improve the detection accuracy.

[0045] Compared with the prior art, the present invention has the following beneficial effects:

[0046] The present invention performs sub-pixel level edge extraction in the region of interest of the part, ensures the accuracy requirement of the key points of the part, realizes rapid positioning of the key points through the registration of the key points of the part, and reduces the interference of noise information while realizing rapid registration.

[0047] The present invention analyzes the detection errors of different shapes of geometries, uses the detection errors to perform feature selection, selects detection parameters that are highly correlated with the errors, and dynamically adjusts the detection system by learning to solve the optimal solution of the detection parameters, thereby further improving the detection accuracy of the part's geometric parameters. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the technical solutions in the embodiments or exemplary embodiments of the present invention, the drawings required for use in the embodiments or exemplary descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained according to the drawings without paying creative work.

[0049] Figure 1 A flow chart of a method for detecting geometric parameters of parts based on sub-pixel edge search according to the present invention is shown;

[0050] Figure 2 A flow chart of an embodiment of the present invention for performing part posture perception through sub-pixel coordinates is shown;

[0051] Figure 3 A flow chart showing an embodiment of the present invention using an improved particle swarm algorithm to optimize error-related detection parameters;

[0052] Figure 4 A block diagram of a part geometric parameter detection system based on sub-pixel edge search according to the present invention is shown. DETAILED DESCRIPTION

[0053] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.

[0054] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the protection scope of the present invention is not limited to the specific embodiments disclosed below.

[0055] Figure 1 The flowchart of the method for detecting part geometric parameters based on sub-pixel edge search of the present invention is shown.

[0056] like Figure 1 As shown, in a first embodiment of the present invention, a method for detecting geometric parameters of a part based on sub-pixel edge search is provided, comprising:

[0057] S102, reading a part image through image acquisition, preprocessing the part image, extracting a region of interest of the part image, and extracting a pixel-level coarse positioning point of the part edge in the region of interest;

[0058] S104, calculating the sub-pixel coordinates of the edge of the part based on the Zernike moment according to the pixel-level coarse positioning points of the edge of the part, performing part posture perception through the sub-pixel coordinates, and searching for key points of the part using the part posture information;

[0059] S106, calculating the geometric parameters of the part by using the acquired coordinates of the key points of the part, integrating the geometric parameters of the part, and analyzing and acquiring the detection errors of different geometric parameter categories;

[0060] S108, determining relevant detection parameters according to the detection error, optimizing the relevant detection parameters using an improved particle swarm algorithm, configuring the entire process of part geometric parameter detection through the optimal solution of the relevant detection parameters, and providing feedback on the detection accuracy.

[0061] It should be noted that the image acquisition system is used to acquire images of parts to obtain clear part images. Due to environmental interference or equipment limitations during the image acquisition and transmission process, various noises are often generated. The part images are denoised by using methods such as mean filtering, median filtering or Gaussian filtering. In addition, the part images are preprocessed by methods such as enhancing contrast and balancing brightness. The preprocessed part images are used as training data, and the training data is used to pre-train the VGG-16 network and variational autoencoder to construct a pre-training model. The network structure of the VGG-16 network consists of a convolutional layer, a pooling layer, a fully connected layer and an output layer, which are used for feature extraction tasks in part edge acquisition. Import the image of the part to be detected into the pre-trained model, remove the fully connected layer and output layer of the VGG-16 network in the pre-trained model, reconstruct the input image of the part to be detected, use the improved network results to extract features of the image data, and extract the area of ​​interest; in the training process of the VGG-16 network, select the 1st to 12th convolutional layers, retain the 1st to 8th convolutional layers, adjust the 9th to 12th convolutional layers and the 13th convolutional layers, the output features of the convolutional layers closer to the input layer are mostly texture features, and the output features of the convolutional layers closer to the fully connected layer have richer semantic information extracted and are closer to the corresponding category information. In the edge acquisition of parts, most irregular parts have problems such as fewer data samples. A small amount of data samples can easily lead to underfitting during network training. We use similarity calculation to obtain similar parts to build a source data set, and use the source data set for transfer learning to train the VGG-16 network. Using the pre-trained weights of transfer learning can greatly speed up the training time of the network, and the performance of the model is preserved. In addition, we use a small amount of data samples on the target domain data set to fine-tune the pre-trained network, which can enhance the performance of the network and provide better robustness and generalization capabilities.

[0062] The multi-scale image features in the region of interest are fused, and the fused features include the rich hierarchical representation of low-level feature information in the region of interest to global semantic information. A single feature map is constructed through splicing operations, and the single feature map is input into the variational autoencoder for feature reconstruction. The feature map is encoded and mapped to a low-dimensional latent space, and the reconstructed feature map is obtained by decoding; the variational autoencoder is trained using a back propagation algorithm through variational reasoning, and is usually used to separate image content and style. The variational autoencoder is trained using a standard part edge map, and the edge score is calculated based on the difference between the reconstructed feature map and the single feature map. The edge score map is constructed using the edge score. When the pixel point is an edge point, the difference between the reconstructed feature map and the single feature map is almost zero. Based on the edge score map, it is binarized according to a preset score threshold, and the pixel-level coarse positioning points of the part edge are extracted according to the part binarization image.

[0063] It should be noted that the Zernike moment is an integral operator. Due to its rotation invariance, it is used to solve edge parameters and use it for sub-pixel detection to achieve sub-pixel positioning. Obtain the parameter value of the 7*7 Zernike moment parameter template, perform convolution operations on the pixel-level coarse positioning points of the part edge and the 7 Zernike moment parameter templates respectively, and generate 7 Zernike moments; according to the horizontal offset angle of the part edge The Zernike moments are multiplied, the part image is corrected, the distance parameter l and the grayscale difference parameter k of the Zernike moments are calculated, and compared with the preset constraints to determine whether it is an edge point; in order to avoid the problem of accuracy reduction caused by the manual selection of thresholds of traditional Zernike moments, the maximum inter-class variance method is used to obtain the optimal segmentation threshold T of the part image. k , the optimal segmentation threshold is used as the condition for judging the edge, and the preset constraint condition is k≥T k , l≤T l , T l Represents the distance threshold, traverses all edge pixel-level coarse positioning points, and outputs the sub-pixel coordinates of the part edge after all pixel points are detected. The sub-pixel edge obtained by automatically setting the segmentation threshold is clearer and more accurate, which improves the sub-pixel positioning accuracy.

[0064] Figure 2 A flow chart of an embodiment of performing part posture perception through sub-pixel coordinates is shown.

[0065] According to an embodiment of the present invention, the part posture perception is performed through the sub-pixel coordinates, and the part posture information is used to search for the key points of the part, specifically:

[0066] S202, obtaining a part edge template according to historical inspection data of the part, selecting a part key point based on the part edge template according to a preset key geometric parameter category, and marking the part key point in the part edge template;

[0067] S204, encoding the sub-pixel coordinates of the part edge in the part to be detected and the part edge template, segmenting the part edge, using a multi-layer perceptron to perform single-point feature learning on the sub-pixel coordinates in each part edge sub-segment, and obtaining the spatial distribution features of the sub-pixel coordinates in the local area through an average pooling operation to generate local features of the part to be detected and the part edge template;

[0068] S206, performing feature splicing on the single point features and the local features on the feature dimension channel, obtaining the local final features of the edge sub-segments in the part to be detected and the part edge template through maximum pooling and batch normalization operations, introducing an attention mechanism to obtain weight information, and weighting the local final features of the edge sub-segments;

[0069] S208, performing feature aggregation on the local final features of the part to be detected and the part edge template after attention weighting through multiple fully connected layers, and performing part pose prediction based on the horizontal offset angle of the part edge of the part to be detected through different network depths in the fully connected layer;

[0070] S210, using the posture information of the part to be detected to search and locate the key points of the part, and reading the sub-pixel coordinates of the key points of the part.

[0071] It should be noted that the key points of the parts are selected according to the preset key geometric parameter categories, such as the starting point, end point, lowest point, highest point of the groove, and the starting point and end point of the inclined surface. The segmented part edge sub-segments are learned and encoded using the feature perceptron MLP with an input feature channel dimension of 3 and an output feature channel dimension of 64 to obtain the single point feature f d =MLP(b i ), b i represents the sub-pixel coordinates of the ith edge point, and the local feature f is obtained by learning the spatial distribution characteristics of the sub-pixel coordinates of the edge points in the local area. j Expressed as: f j =avg(conv(b i )), avg represents average pooling. After the single-point feature is concatenated with the local feature, the feature of each edge point in the part edge sub-segment is associated with the overall spatial distribution of the part edge sub-segment. The attention mechanism is introduced to weight the local final features of the edge sub-segments in the part to be detected and the part edge template, so that the feature learning process can integrate all the local information perceived in the part edge template, and weight the local final features of the part to be detected. The similar areas become more significant in the subsequent learning process. The local final features of the edge sub-segments in the part to be detected and the part edge template after attention weighting correction are aggregated through a symmetrical maximum pooling operation, and posture decoding is performed using three hierarchically stacked fully connected layers. The local final features after attention weighting correction are divided into deep and shallow features, where the deep features are responsible for predicting the part posture, and the shallow features are responsible for using the contained detail information to fine-tune the predicted part posture. The fully connected layer is preset and trained using the horizontal offset angle of the part edge obtained using the Zernike moment. On this basis, posture adjustment is performed to output the posture data of the part to be detected. After posture alignment, the key points of the part are searched and located according to the part edge template, and the sub-pixel coordinates of the key points of the part are read.

[0072] The coordinates of the key points of the parts are fitted according to the preset key geometric parameter categories, and the geometric parameter detection results are obtained according to the calculation method of the geometric parameters through the fitting results, and the geometric parameter sets corresponding to the key geometric parameter categories are generated; the mean square error between the detection value and the standard value is used to evaluate the detection accuracy in geometric parameter sets of different categories, and the detection errors of different geometric parameter categories are obtained.

[0073] Figure 3 A flow chart of an embodiment using an improved particle swarm algorithm to optimize error-related detection parameters is shown.

[0074] According to an embodiment of the present invention, relevant detection parameters are determined according to the detection error, and the relevant detection parameters are optimized using an improved particle swarm algorithm, specifically as follows:

[0075] S302, dividing the whole process data of part geometric parameter detection according to key geometric parameter categories, and generating detection parameter sets corresponding to different categories of geometric parameter sets;

[0076] S304, using the mRMR algorithm and the cross-measurement method to select features in each detection parameter set, obtaining the importance ranking based on the principle that the correlation between the detection parameter and the detection error is maximum and the redundancy between the detection features is minimum through the mRMR algorithm, and selecting a preset number of detection parameters based on the importance ranking;

[0077] S306, continuously connect SVM to generate a prediction model according to the selected detection parameters, obtain the mean square error of the prediction model in the cross-test training process, and obtain the first n detection parameters with the smallest mean square error to determine as detection error related detection parameters;

[0078] S308, initializing the particle swarm algorithm parameters and the particle position and velocity information based on the determined relevant detection parameters, setting the fitness function through the detection error, using the fitness function to calculate the individual fitness of the particles, selecting the individual optimum and the global optimum, introducing the simulated annealing algorithm for iterative optimization, and using the simulated annealing neighborhood search to update the particle position and velocity;

[0079] S306, when the termination condition is met, the iteration is stopped, and the optimal solution of the relevant detection parameters is determined according to the optimal position.

[0080] It should be noted that the simulated annealing algorithm is used to optimize the initial particle swarm algorithm. The annealing temperature is initialized in the particle swarm algorithm. After iterative optimization, the simulated annealing neighborhood search is performed on the fitness best individual of the particle, the particle individual fitness mechanism and the global fitness extreme value are updated, and the optimal particle position and speed information are obtained. With the continuous update and search of particles, the optimal solution of the relevant detection parameters is determined. The optimization direction of the relevant detection parameters is determined by optimizing the initial particle swarm algorithm through the simulated annealing algorithm, and the optimization speed of the relevant feature combination is improved.

[0081] Decode the optimal solutions of related detection parameters corresponding to different categories of geometric parameter sets to determine the optimal parameter values, obtain the common detection parameters in different categories, and average the optimal parameter values ​​corresponding to the overlapping detection parameters; configure the entire process of part geometric parameter detection using the optimal parameter values ​​corresponding to the unique related detection parameters of different categories and the average optimal parameter values ​​of the common related detection parameters; obtain the detection accuracy of different categories of geometric parameter sets, and when the detection accuracy is less than the preset accuracy threshold, use the historical geometric parameter detection data to re-optimize the unique related detection parameters of the category. Count the number of categories with detection accuracy less than the preset accuracy threshold, and when the number of categories is greater than the preset number threshold, re-optimize the common related detection parameters of different categories and the corresponding unique related detection parameters to ensure that the accuracy of the entire process of part geometric parameter detection is always maintained within the preset range.

[0082] Figure 4 The block diagram of the part geometric parameter detection system based on sub-pixel edge search of the present invention is shown.

[0083] The second embodiment of the present invention provides a part geometric parameter detection system 4 based on sub-pixel edge search, the system comprising: an image acquisition and preprocessing module, a sub-pixel edge extraction module, a part key point search module, a geometric parameter calculation module, a detection error evaluation module and a detection accuracy feedback module;

[0084] The image acquisition and preprocessing module is responsible for acquiring part images, preprocessing the part images, extracting regions of interest of the part images, and extracting pixel-level coarse positioning points of the part edges in the regions of interest;

[0085] The sub-pixel edge extraction module is responsible for calculating the sub-pixel coordinates of the part edge based on the Zernike moment according to the pixel-level coarse positioning points of the part edge, so as to achieve fine positioning of the part edge;

[0086] The part key point search module is responsible for sensing the part posture through sub-pixel coordinates and searching for the part key points using the part posture information;

[0087] The geometric parameter calculation module is responsible for calculating the geometric parameters of the part using the acquired coordinates of the key points of the part;

[0088] The detection error evaluation module is integrated based on the geometric parameters of the parts, and analyzes and obtains detection errors of different geometric parameter categories;

[0089] The detection accuracy feedback module is responsible for determining relevant detection parameters according to the detection error, optimizing the relevant detection parameters using the improved particle swarm algorithm, and configuring the entire process of part geometric parameter detection through the optimal solution of the relevant detection parameters to improve the detection accuracy.

[0090] The third embodiment of the present invention provides a computer-readable storage medium, which includes a part geometric parameter detection method program based on sub-pixel edge search. When the part geometric parameter detection method program based on sub-pixel edge search is executed by a processor, the steps of the part geometric parameter detection method based on sub-pixel edge search are implemented.

[0091] In the several embodiments provided in the present application, it should be understood that the disclosed method can be implemented in other ways. The embodiments described above are merely illustrative. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as: multiple modules or components can be combined, or can be integrated into another system, or some features can be ignored, or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.

[0092] Those skilled in the art can understand that: all or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiments; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), disks or optical disks, and other media that can store program codes.

[0093] Alternatively, if the above-mentioned integrated module of the present invention is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention can be essentially or partly reflected in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.

[0094] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.

Claims

1. A method for detecting part geometric parameters based on sub-pixel edge search, characterized in that: The following steps are involved: Read the part image through image acquisition, pre-process the part image, extract the region of interest of the part image, and extract the pixel-level coarse positioning points of the part edge in the region of interest; Calculate the sub-pixel coordinates of the edge of the part based on the Zernike moment according to the pixel-level coarse positioning points of the edge of the part, perceive the posture of the part through the sub-pixel coordinates, and search for the key points of the part using the posture information of the part; The geometric parameters of the parts are calculated by obtaining the coordinates of the key points of the parts, and the geometric parameters of the parts are integrated to analyze and obtain the detection errors of different geometric parameter categories; Relevant detection parameters are determined according to the detection error, and the improved particle swarm algorithm is used to optimize the relevant detection parameters. The entire process of part geometric parameter detection is configured through the optimal solution of the relevant detection parameters, and feedback is given on the detection accuracy.

2. The part geometric parameter detection method based on sub-pixel edge search according to claim 1 is characterized in that: The part image is preprocessed to extract the region of interest of the part image, and the pixel-level coarse positioning points of the part edge are extracted in the region of interest, specifically: Acquire a part image, perform image enhancement and image denoising on the part image, use the preprocessed part image as training data, use the training data to pre-train a VGG-16 network and a variational autoencoder, and build a pre-training model; Importing the image of the part to be detected into the pre-trained model, removing the fully connected layer and the output layer of the VGG-16 network in the pre-trained model, performing a reconstruction operation on the input image of the part to be detected, and using the improved network result to perform feature extraction on the image data to extract the region of interest; Performing feature fusion on multi-scale image features in the region of interest, constructing a single feature map through a splicing operation, inputting the single feature map into a variational autoencoder for feature reconstruction, encoding the feature map, mapping it to a low-dimensional latent space, and obtaining a reconstructed feature map through decoding; The edge score is calculated according to the difference between the reconstructed feature map and the single feature map, the edge score is used to construct an edge score map, binarization is performed based on the edge score map according to a preset score threshold, and the pixel-level coarse positioning points of the part edge are extracted according to the part binarized image.

3. The part geometric parameter detection method based on sub-pixel edge search according to claim 1 is characterized in that: The sub-pixel coordinates of the edge of the part are calculated based on the Zernike moment according to the pixel-level coarse positioning points of the edge of the part, specifically: Obtain the parameter values ​​of the 7*7 Zernike moment parameter template, perform convolution operations on the pixel-level coarse positioning points on the edge of the part and the 7 Zernike moment parameter templates respectively, and generate 7 Zernike moments; The Zernike moment is multiplied according to the horizontal offset angle of the part edge, the part image is corrected, the distance parameter and the grayscale difference parameter of the Zernike moment are calculated, and compared with the preset constraint conditions to determine whether it is an edge point; Traverse all edge pixel-level coarse positioning points, and output the sub-pixel coordinates of the part edge after all pixel points are detected.

4. The part geometric parameter detection method based on sub-pixel edge search according to claim 1 is characterized in that: The sub-pixel coordinates are used to perceive the posture of the part, and the posture information of the part is used to search for the key points of the part, specifically: Acquire a part edge template according to historical inspection data of the part, select key points of the part according to preset key geometric parameter categories based on the part edge template, and mark the key points of the part in the part edge template; Encode the sub-pixel coordinates of the part edge in the part to be detected and the part edge template, segment the part edge, use a multi-layer perceptron to perform single-point feature learning on the sub-pixel coordinates in each part edge sub-segment, and obtain the spatial distribution features of the sub-pixel coordinates in the local area through an average pooling operation to generate local features of the part to be detected and the part edge template; The single point features and local features are concatenated on the feature dimension channel, and the local final features of the edge sub-segments in the part to be detected and the part edge template are obtained through maximum pooling and batch normalization operations. The attention mechanism is introduced to obtain weight information, and the local final features of the edge sub-segments are weighted; The local final features of the parts to be detected and the part edge template after attention weighting are aggregated through multiple fully connected layers. The pose of the parts is predicted based on the horizontal offset angle of the part edge of the parts to be detected through different network depths in the fully connected layers. The posture information of the part to be inspected is used to search and locate the key points of the part, and the sub-pixel coordinates of the key points of the part are read.

5. The part geometric parameter detection method based on sub-pixel edge search according to claim 1 is characterized in that: The geometric parameters of the parts are calculated by obtaining the coordinates of the key points of the parts, and the geometric parameters of the parts are integrated to analyze and obtain the detection errors of different geometric parameter categories, specifically: Fit the coordinates of the key points of the parts according to the preset key geometric parameter categories, obtain the geometric parameter detection results through the fitting results, and generate the geometric parameter set corresponding to the key geometric parameter category; The detection accuracy is evaluated by using the mean square error between the detection value and the standard value in different categories of geometric parameter sets to obtain the detection error of different geometric parameter categories.

6. The part geometric parameter detection method based on sub-pixel edge search according to claim 1 is characterized in that: The relevant detection parameters are determined according to the detection error, and the improved particle swarm algorithm is used to optimize the relevant detection parameters, specifically: According to the full process data of part geometric parameter detection, the full process data is divided according to key geometric parameter categories to generate detection parameter sets corresponding to different categories of geometric parameter sets; Using the mRMR algorithm and the cross-measurement method to select features in each detection parameter set, obtaining the importance ranking based on the principle that the correlation between the detection parameter and the detection error is maximum and the redundancy between the detection features is minimum through the mRMR algorithm, and selecting a preset number of detection parameters based on the importance ranking; According to the selected detection parameters, the SVM is continuously connected to generate a prediction model, the mean square error of the prediction model in the cross-test training process is obtained, and the first n detection parameters with the smallest mean square error are obtained to be determined as detection error related detection parameters; Initialize the particle swarm algorithm parameters and particle position and velocity information based on the determined relevant detection parameters, set the fitness function through the detection error, use the fitness function to calculate the individual fitness of the particles, select the individual optimum and the global optimum, introduce the simulated annealing algorithm for iterative optimization, and use the simulated annealing neighborhood search to update the particle position and velocity; When the termination condition is met, the iteration is stopped, and the optimal solution of the relevant detection parameters is determined according to the optimal position.

7. The part geometric parameter detection method based on sub-pixel edge search according to claim 1 is characterized in that: The whole process of part geometry parameter detection is configured through the optimal solution of relevant detection parameters, and the detection accuracy is fed back, specifically: Decode the optimal solutions of related detection parameters corresponding to different categories of geometric parameter sets to determine the optimal parameter values, obtain the common detection parameters of different categories, and average the optimal parameter values ​​corresponding to the overlapping detection parameters; Use the optimal parameter values ​​corresponding to the relevant detection parameters unique to different categories and the average optimal parameter values ​​of the common relevant detection parameters to configure the entire process of part geometric parameter detection; The detection accuracy of different categories of geometric parameter sets is obtained. When the detection accuracy is less than a preset accuracy threshold, the historical geometric parameter detection data is used to re-optimize the relevant detection parameters unique to the category.

8. A part geometric parameter detection system based on sub-pixel edge search, characterized in that: Implementing the part geometric parameter detection method based on sub-pixel edge search as described in any one of claims 1 to 7, the system comprises: an image acquisition and preprocessing module, a sub-pixel edge extraction module, a part key point search module, a geometric parameter calculation module, a detection error evaluation module and a detection accuracy feedback module; The image acquisition and preprocessing module is responsible for acquiring part images, preprocessing the part images, extracting regions of interest of the part images, and extracting pixel-level coarse positioning points of the part edges in the regions of interest; The sub-pixel edge extraction module is responsible for calculating the sub-pixel coordinates of the part edge based on the Zernike moment according to the pixel-level coarse positioning points of the part edge, so as to achieve fine positioning of the part edge; The part key point search module is responsible for sensing the part posture through sub-pixel coordinates and searching for the part key points using the part posture information; The geometric parameter calculation module is responsible for calculating the geometric parameters of the part using the acquired coordinates of the key points of the part; The detection error evaluation module is integrated based on the geometric parameters of the parts, and analyzes and obtains detection errors of different geometric parameter categories; The detection accuracy feedback module is responsible for determining relevant detection parameters according to the detection error, optimizing the relevant detection parameters using the improved particle swarm algorithm, and configuring the entire process of part geometric parameter detection through the optimal solution of the relevant detection parameters to improve the detection accuracy.

Citation Information

Cited By

  • Mine personnel behavior identification method and system based on YOLOv5

    CN121074986A