Parts processing detection method and system
By using edge detection algorithms and significant feature values in part processing and detection, the problem of mismatch in traditional methods when dealing with similar textured parts is solved, and the accuracy and reliability of detection are improved.
Patent Information
- Application Number
- CN202510436289.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-09
- Publication Date
- 2025-06-06
- Estimated Expiration
- 2045-04-09
AI Technical Summary
When processing parts with similar texture structures, traditional part processing and detection methods based on feature point extraction and matching are easily increased due to the extremely high similarity of feature point descriptors, which affects the accuracy and reliability of the detection.
By obtaining images of parts to be inspected and template parts, the gradient information is extracted using edge detection algorithm, candidate feature points are filtered, and clustered based on the significance feature values to generate a matching descriptor, and the comprehensive matching degree is calculated to determine whether the part image is abnormal.
It effectively improves the accuracy and reliability of feature point matching, reduces the mismatch rate, improves detection efficiency and quality, and ensures the accuracy and production efficiency of parts processing.
Smart Images

Figure CN119941740B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing, and in particular to a parts processing detection method and system. Background Art
[0002] In modern manufacturing, parts processing is the core link of the production process, which directly determines the quality and performance of the product. With the continuous advancement of technology, the precision and complexity of parts processing are also constantly improving, which puts higher requirements on quality control in the production process. Parts processing covers the entire process from raw material processing to finished product manufacturing, including machining, welding, casting, injection molding and other processes. The efficient execution and precise control of these processes are the basis for ensuring product quality.
[0003] Parts processing inspection is a key link to ensure that parts meet design specifications and quality standards during the production process. Through a series of inspection methods and systems, real-time or offline inspection of key indicators such as part size, shape, surface quality, position deviation, etc. can be carried out to promptly detect and correct defects or deviations in the processing process. This inspection method can not only improve production efficiency and reduce defective rates, but also ensure the stability and consistency of product quality. However, real-time part inspection on the production line can quickly identify problems such as position deviation, part deformation, and installation errors, thereby preventing defective parts from flowing into subsequent processes and reducing production costs and resource waste.
[0004] Although part processing inspection plays an important role in quality control, some problems are still encountered in the actual inspection process. Although the traditional detection method based on feature point extraction and matching shows strong robustness in complex scenes, for parts with similar texture structures such as grids and stripes, their similar structures will lead to extremely high similarity of feature point descriptors, thereby increasing the mismatch rate. This mismatch problem seriously affects the accuracy and reliability of detection, especially in the field of high-precision processing. In addition, the stability of the detection system and environmental factors (such as light changes, equipment wear, etc.) may also affect the detection results. Summary of the invention
[0005] In order to solve the problem that when traditional feature point extraction and matching methods are used to process parts with similar texture structures, the mismatch rate is easily increased due to the extremely high similarity of feature point descriptors, thereby affecting the accuracy and reliability of detection, the present invention provides solutions in the following aspects.
[0006] In a first aspect, a part processing detection method includes: respectively acquiring images of a part to be inspected and a template part on a production line and performing preprocessing to obtain grayscale images of the part to be inspected and the template part; using an edge detection algorithm to respectively acquire the gradient amplitude and gradient direction of each pixel point in the grayscale images of the part to be inspected and the template part, performing non-maximum suppression in the neighborhood of each pixel point, screening candidate feature points, and obtaining significant feature values of the candidate feature points of the part to be inspected and the template part based on the candidate feature points and multiple attributes in the neighborhood; matching the part to be inspected and the template part according to the significant feature values, and calculating the comprehensive matching degree, Based on the comprehensive matching degree, it is judged whether the image of the part to be inspected is abnormal, and the part processing detection is completed; wherein, the matching process includes: clustering and grouping the candidate feature points in the grayscale image based on the significant feature value to obtain a number of clusters, obtaining the significant feature value corresponding to the center point of each cluster, determining the importance of each cluster in the matching according to the significant feature value, and generating a matching descriptor for each cluster, and calculating the comprehensive matching degree between the descriptor of each cluster in the image of the part to be inspected and the descriptor of the corresponding cluster in the template part image; the matching descriptor of the cluster includes: the center point pixel value, the center point gradient amplitude and the shape complexity.
[0007] By acquiring the image of the parts to be inspected on the production line and preprocessing it, the edge detection algorithm is used to extract the gradient information of each pixel point, and the candidate feature points are screened out by non-maximum suppression. Further, the significant eigenvalues are calculated based on the multiple attributes of the candidate feature points and their neighborhoods, and clustering and grouping are performed on this basis to form multiple clusters. Each cluster generates a matching descriptor containing the center point pixel value, gradient amplitude and shape complexity, which is used to match the template image and calculate the comprehensive matching degree. Finally, the image of the part to be inspected is judged to be abnormal based on the comprehensive matching degree, and the detection is completed. It effectively improves the accuracy and reliability of feature point matching, enhances the distinguishing ability of feature descriptors, and at the same time improves the detection efficiency, reduces the defective rate, and ensures the quality and production efficiency of part processing.
[0008] Preferably, the pretreatment comprises:
[0009] A filter is applied to the grayscale images of the parts to be inspected and the template parts for smoothing to reduce the influence of noise in the grayscale images. Histogram equalization is used to enhance the contrast of the images. The images of the parts to be inspected are segmented to obtain the part area images in the grayscale images of the parts to be inspected and the template parts.
[0010] Preferably, the candidate feature points include:
[0011] The Sobel operator is used to perform convolution operation on the denoised grayscale images of the inspected part and the template part, and the gradient amplitude and gradient direction of each pixel are calculated. Within the eight neighborhoods of each pixel, if the gradient amplitude of the pixel is a local maximum, the pixel is retained and used as a candidate feature point. Otherwise, the pixel is ignored, and the candidate feature points of the inspected part and the template part are obtained respectively.
[0012] The Sobel operator is used to perform convolution operations on the grayscale image of the denoised part image to be inspected, and the gradient amplitude and gradient direction of each pixel are calculated. In the eight neighborhoods of each pixel, the pixel with the local maximum gradient amplitude is selected as the candidate feature point through non-maximum suppression, thereby effectively reducing the number of pseudo feature points and improving the accuracy and reliability of feature point extraction. It is particularly suitable for processing parts with similar texture structures, which can significantly reduce the mismatch rate and improve the efficiency and quality of part processing inspection.
[0013] Preferably, the significant feature values include:
[0014] Preset the neighborhood size for the candidate feature points of the inspected part and the template part respectively, classify the pixel grayscale values, quantize the grayscale values of the original image to the corresponding grayscale level, and calculate the correlation value of the grayscale co-occurrence matrix of the pixel points in the neighborhood of each candidate feature point of the inspected part and the template part;
[0015] The correlation value satisfies the following relationship: ; In the formula, Indicates The significant feature values of candidate feature points, Indicates The correlation value of the gray level co-occurrence matrix of pixels in the neighborhood of the candidate feature points, Indicates The gradient direction entropy values of all pixels in the neighborhood of a candidate feature point.
[0016] By presetting the neighborhood size, the pixel grayscale value is quantified, and the grayscale co-occurrence matrix correlation value and gradient direction entropy value in the neighborhood of the candidate feature point are calculated to obtain the significant eigenvalue; it can effectively distinguish between real feature points and pseudo feature points, reduce the mismatch rate caused by similar texture structures, and improve the accuracy and reliability of feature point extraction, thereby improving the efficiency and quality of part processing and inspection.
[0017] Preferably, the significant feature value further includes:
[0018] Preset the neighborhood size for the candidate feature points of the inspected part and the template part respectively, take the central pixel in the neighborhood as the reference pixel, compare the gray value of the reference pixel with the gray value of the pixels in the surrounding neighborhood, generate a binary number according to the comparison result, and in response to the gray value of the neighborhood pixel being greater than or equal to the gray value of the reference pixel, the binary bit of the position of the domain pixel is 1; otherwise, it is 0;
[0019] The generated binary number is converted into a decimal number, which is the LBP value of the pixel point; and the LBP histogram is constructed to calculate the contrast of the histogram to obtain the significant feature values of the candidate feature points of the part to be inspected and the template part.
[0020] By effectively capturing local texture features and being insensitive to lighting changes, the accuracy and reliability of feature point extraction are significantly improved, thereby improving the efficiency and quality of part processing inspection.
[0021] Preferably, the shape complexity includes:
[0022] For each cluster, the convex hull algorithm is used to obtain the boundary, the length of each boundary line of the convex hull is calculated, the Euclidean distance between each boundary line of the cluster convex hull and the cluster center is calculated, and the product of the Euclidean distance and the boundary line length is summed to obtain the overall expansion degree of the cluster convex hull; the overall expansion degree is divided by the number of boundary lines to obtain the average boundary line expansion degree;
[0023] The mean of the Euclidean distance between each candidate feature point in the cluster and the center point of the cluster is calculated, and the absolute value of the natural logarithm of the difference between 1 and the normalized mean is calculated to obtain the distribution compactness; the product of the average boundary line extension degree and the distribution compactness is taken as the shape complexity of the cluster.
[0024] The effect is: by comprehensively considering the boundary characteristics of the clusters and the distribution of internal points, the shape complexity of the clusters can be effectively quantified, thereby improving the accuracy and reliability of feature point matching and enhancing the precision and efficiency of part processing detection.
[0025] Preferably, the shape complexity further includes:
[0026] For each cluster, use the convex hull algorithm to obtain the boundary, and calculate the length of each boundary line and the convex hull area of the convex hull;
[0027] Calculate the Euclidean distance between each boundary line of the cluster convex hull and the cluster center point, and sum the product of the Euclidean distance and the boundary line length to obtain the overall expansion degree of the cluster convex hull; divide the overall expansion degree by the number of boundary lines to obtain the average boundary line expansion degree;
[0028] The product of the average boundary line extension degree and the convex hull area is taken as the shape complexity of the cluster.
[0029] Preferably, the comprehensive matching degree satisfies the following relationship:
[0030] ;
[0031] In the formula, Indicates the comprehensive matching degree, represents the total number of clusters, Indicates the first The significant eigenvalue of the center point of the clusters, Indicates The Euclidean distance between a cluster and its corresponding cluster feature descriptor vector, represents the normalization function, Represented by natural numbers An exponential function with base .
[0032] Preferably, judging whether the image of the inspected part is abnormal based on the comprehensive matching degree includes:
[0033] In response to the matching degree being greater than or equal to the preset threshold, there is no abnormality in the inspected part; otherwise, there is an abnormality in the image of the inspected part, and an early warning needs to be issued in time so that the staff can check it in time and reduce the defect rate of the parts.
[0034] In a second aspect, a part processing detection system includes: a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the above-mentioned part processing detection method is implemented.
[0035] The present invention has the following effects:
[0036] 1. The present invention can effectively distinguish real feature points from pseudo feature points and reduce the mismatch rate caused by similar texture structures by introducing multi-dimensional features such as significant feature values and shape complexity. Especially when processing parts with repeated or complex textures, significant feature values and shape complexity can provide richer information and help match feature points more accurately, thereby improving the accuracy and reliability of detection.
[0037] 2. The present invention considers the local information and global features of the feature points so that the multi-dimensional feature descriptor can more comprehensively reflect the characteristics of the clusters, making the distinction between different clusters more obvious. By comprehensively considering these features, the generated matching descriptor has a stronger ability to distinguish, further improving the accuracy of feature point matching. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1It is a method flow chart of steps S1 to S3 in a parts processing detection method according to an embodiment of the present invention.
[0039] Figure 2 It is a structural block diagram of a parts processing detection system according to an embodiment of the present invention. DETAILED DESCRIPTION
[0040] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments.
[0041] Reference Figure 1 A parts processing detection method includes steps S1 to S3, which are as follows:
[0042] S1: respectively obtain images of the parts to be inspected and the template parts on the production line and perform preprocessing to obtain grayscale images of the parts to be inspected and the template parts.
[0043] Select a fixed and suitable location on the production line to install the image acquisition device, ensuring that the field of view of the device can completely cover the entire area of the part to be inspected to avoid blind spots. Adjust the angle and height of the device to match the direction and speed of part transmission to ensure the clarity and stability of image acquisition. At the same time, debug the parameters of the image acquisition device, such as resolution, frame rate, exposure time, etc., to adapt to the light conditions and part transmission speed on the production line, and ensure that the quality of the acquired image meets the requirements of subsequent processing.
[0044] When the parts on the production line pass through the field of view of the image acquisition device according to the established transmission mechanism, the images of the parts to be inspected on the production line are collected in real time. During the collection process, it is ensured that the image can accurately capture all details of the parts, including but not limited to: shape, texture, edge and other features, providing a sufficient information basis for subsequent inspections.
[0045] A filter is applied to the grayscale image for smoothing to reduce the influence of noise in the grayscale image. Histogram equalization is used to enhance the contrast of the image. The image of the inspected part is segmented to obtain the part area in the grayscale image.
[0046] The collected images of the parts to be inspected are converted into grayscale images, and Gaussian filtering is applied to the grayscale images to filter out noise, so as to prevent the noise from affecting the efficiency of feature point extraction and thus affecting the subsequent matching accuracy.
[0047] S2: Use edge detection algorithm to obtain the gradient amplitude and gradient direction of each pixel point in the grayscale image of the part to be inspected and the template part respectively, perform non-maximum suppression in the neighborhood of each pixel point, screen candidate feature points, and obtain the significant feature values of the candidate feature points of the part to be inspected and the template part respectively based on the candidate feature points and multiple attributes in the neighborhood.
[0048] The Sobel operator is used to perform convolution operation on the denoised grayscale images of the inspected part and the template part, and the gradient amplitude and gradient direction of each pixel are calculated. Within the eight neighborhoods of each pixel, if the gradient amplitude of the pixel is a local maximum, the pixel is retained and used as a candidate feature point. Otherwise, the pixel is ignored, and the candidate feature points of the inspected part and the template part are obtained respectively.
[0049] Significant feature values include:
[0050] Preset the neighborhood size for the candidate feature points of the inspected part and the template part respectively, classify the pixel grayscale values, quantize the grayscale values of the original image to the corresponding grayscale level, and calculate the correlation value of the grayscale co-occurrence matrix of the pixel points in the neighborhood of each candidate feature point of the inspected part and the template part;
[0051] The correlation value satisfies the following relationship: ; In the formula, Indicates The significant feature values of candidate feature points, Indicates The correlation value of the gray level co-occurrence matrix of pixels in the neighborhood of the candidate feature points, Indicates The gradient direction entropy values of all pixels in the neighborhood of a candidate feature point.
[0052] That is to say, The larger the value, the The greater the texture similarity of the pixels in the neighborhood of the candidate feature point, the The possibility that the candidate feature point is a pseudo feature point is higher; otherwise, The smaller the value, the The smaller the texture similarity of the pixels in the neighborhood of the candidate feature point, the The probability that the first candidate feature point is in the repeated texture area is small, so the The probability that the candidate feature points are significant feature points is high.
[0053] The larger the value, the The gradient directions of pixels in the neighborhood of a candidate feature point are quite different, and the possibility of being in a repeated texture area is small; on the contrary, The smaller the value, the The candidate feature points are in the repeated texture area. The possibility that the candidate feature points are pseudo feature points is high.
[0054] For example, the preset neighborhood size is Pixels are used to construct the gray-level co-occurrence matrix, which can reduce the computational complexity and improve the statistical stability by quantizing the pixel gray value to a fixed gray level range.
[0055] Specifically, the correlation value satisfies the following relationship:
[0056] ;
[0057] In the formula, Indicates In the neighborhood of candidate feature points, Represents the number of gray levels, Indicates that the gray value in the neighborhood is The pixel point and gray value are The number of times pixels appear adjacent to each other in a specific direction. Indicates that the gray value in the neighborhood is The pixel and gray value are The number of times pixels appear adjacent to each other in a specific direction.
[0058] That is to say, Reflects the gray value in the neighborhood The pixel point and gray value are The total number of times pixels appear adjacent to each other in a specific direction.
[0059] Specifically, the entropy value satisfies the following relationship:
[0060] ;
[0061] In the formula, Indicates The gradient direction entropy value of all pixels in the neighborhood of the candidate feature point is Indicates The total number of pixels in the neighborhood of the candidate feature points, Indicates The gradient direction of all pixels in the neighborhood of a candidate feature point is The probability of Indicates The logarithmic function with base .
[0062] That is to say, if The larger the value of is, the more the gradient direction changes in the neighborhood. candidate feature points are more likely to be true feature points; if The smaller the value of is, the more consistent the gradient direction is within the neighborhood. The candidate feature points may be pseudo feature points caused by repeated textures.
[0063] In addition, another implementation also includes:
[0064] Preset the neighborhood size for the candidate feature points of the inspected part and the template part respectively, take the central pixel in the neighborhood as the reference pixel, compare the gray value of the reference pixel with the gray value of the pixels in the surrounding neighborhood, generate a binary number according to the comparison result, and in response to the gray value of the neighborhood pixel being greater than or equal to the gray value of the reference pixel, the binary bit of the position of the domain pixel is 1; otherwise, it is 0;
[0065] The generated binary number is converted into a decimal number, which is the LBP value of the pixel point; and the LBP histogram is constructed to calculate the contrast of the histogram to obtain the significant feature values of the candidate feature points of the part to be inspected and the template part.
[0066] For example, the preset neighborhood size is Pixels are used to construct the entire area of the LBP histogram, with the candidate feature point as the center and 7 pixels extending to the surrounding areas to form a When calculating the LBP value, select or The central pixel of the neighborhood is used as the reference pixel.
[0067] S3: Match the significant feature values of the part to be inspected and the template part, calculate the comprehensive matching degree, judge whether the image of the part to be inspected is abnormal based on the comprehensive matching degree, and complete the part processing inspection.
[0068] The matching process includes: clustering and grouping the candidate feature points in the grayscale image based on the significant feature value to obtain several clusters, obtaining the significant feature value corresponding to the center point of each cluster, determining the importance of each cluster in the matching according to the significant feature value, and generating a matching descriptor for each cluster, calculating the comprehensive matching degree between the descriptor of each cluster in the image of the part to be inspected and the descriptor of the corresponding cluster in the template part image; the matching descriptors of the clusters include: center point pixel value, center point gradient amplitude and shape complexity.
[0069] Shape complexity, including:
[0070] For each cluster, the convex hull algorithm is used to obtain the boundary, the length of each boundary line of the convex hull is calculated, the Euclidean distance between each boundary line of the cluster convex hull and the cluster center is calculated, and the product of the Euclidean distance and the boundary line length is summed to obtain the overall expansion degree of the cluster convex hull; the overall expansion degree is divided by the number of boundary lines to obtain the average boundary line expansion degree;
[0071] The mean of the Euclidean distance between each candidate feature point in the cluster and the center point of the cluster is calculated, and the absolute value of the natural logarithm of the difference between 1 and the normalized mean is calculated to obtain the distribution compactness; the product of the average boundary line extension degree and the distribution compactness is taken as the shape complexity of the cluster.
[0072] Specifically, the shape complexity satisfies the following relationship:
[0073] ;
[0074] In the formula, Indicates The shape complexity of the convex hull of the clusters, Indicates The convex hull of the clusters The Euclidean distance between the boundary line and the cluster center point, Indicates The convex hull of the cluster The length of the border, Indicates The number of convex hull boundaries of clusters, Indicates The mean intra-cluster distance of clusters, represents the standard normalization function, Represented by natural numbers The logarithmic function with base .
[0075] That is to say, Reflects the compactness of feature points within a cluster. The larger the value, the more dispersed the feature points are and the more complex the shape of the cluster is. By taking the logarithm, The influence of the shape is amplified, making the shape complex and There is a positive correlation.
[0076] Specifically: when When it is large (the feature points are scattered), Smaller, The absolute value of is large, and the shape complexity Increase; when When is small (feature points are concentrated), Larger, The absolute value is small and the shape complexity is Reduce.
[0077] In addition, another embodiment further includes:
[0078] For each cluster, use the convex hull algorithm to obtain the boundary, and calculate the length of each boundary line and the convex hull area of the convex hull;
[0079] Calculate the Euclidean distance between each boundary line of the cluster convex hull and the cluster center point, and sum the product of the Euclidean distance and the boundary line length to obtain the overall expansion degree of the cluster convex hull; divide the overall expansion degree by the number of boundary lines to obtain the average boundary line expansion degree;
[0080] The product of the average boundary line extension degree and the convex hull area is taken as the shape complexity of the cluster.
[0081] Specifically, the shape complexity satisfies the following relationship:
[0082] ;
[0083] In the formula, Indicates The shape complexity of the convex hull of the clusters, Indicates The convex hull of the clusters The Euclidean distance between the boundary line and the cluster center point, Indicates The convex hull of the cluster The length of the border, Indicates The number of convex hull boundaries of clusters, Indicates The convex hull area of the clusters, Represents the standard normalization function.
[0084] That is to say, It reflects the extension degree of each boundary line. The larger the product, the farther the boundary line is from the center point and the longer the length, which means that the clusters are more widely distributed in this direction. By averaging, the influence of the number of boundary lines on the results is eliminated, making the shape complexity of different clusters comparable.
[0085] The comprehensive matching degree satisfies the following relationship:
[0086] ;
[0087] In the formula, Indicates the comprehensive matching degree, represents the total number of clusters, Indicates the first The significant eigenvalue of the center point of the clusters, Indicates The Euclidean distance between a cluster and its corresponding cluster feature descriptor vector, represents the normalization function, Represented by natural numbers An exponential function with base .
[0088] That is to say, the larger the significant eigenvalue, the more significant the feature point of the cluster is, and the more likely it is a real feature point; the smaller the Euclidean distance, the higher the matching degree; The function normalizes the comprehensive matching score to The closer the value is to 1, the higher the match degree is; the closer the value is to 0, the lower the match degree is.
[0089] By comprehensively considering the Euclidean distance between the significant feature value of each cluster and its corresponding cluster feature descriptor vector, the comprehensive matching degree is calculated to distinguish between real feature points and pseudo feature points, thereby improving the accuracy and reliability of matching.
[0090] In response to the matching degree being greater than or equal to the preset threshold, there is no abnormality in the inspected part; otherwise, there is an abnormality in the image of the inspected part, and an early warning needs to be issued in time so that the staff can check it in time and reduce the defect rate of the parts.
[0091] Exemplarily, the preset threshold is 0.8, which can be adjusted according to actual conditions.
[0092] The present invention also provides a parts processing detection system. Figure 2 As shown, the system includes a processor and a memory, the memory stores computer program instructions, and when the computer program instructions are executed by the processor, a part processing detection method according to the first aspect of the present invention is implemented. The system also includes other components well known to those skilled in the art, such as a communication bus and a communication interface, whose settings and functions are known in the art, so they are not described here.
[0093] It should be noted that, for those skilled in the art, several modifications and improvements can be made without departing from the concept of the present invention, and these modifications and improvements all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.
Claims
1. A parts processing detection method, characterized in that: include: The images of the parts to be inspected and the template parts on the production line are respectively acquired and preprocessed to obtain grayscale images of the parts to be inspected and the template parts; Use edge detection algorithm to obtain the gradient amplitude and gradient direction of each pixel in the grayscale image of the part to be inspected and the template part, perform non-maximum suppression in the neighborhood of each pixel, screen candidate feature points, and obtain significant feature values of the candidate feature points of the part to be inspected and the template part based on the candidate feature points and multiple attributes in the neighborhood; The candidate feature points include: The Sobel operator is used to perform convolution operation on the grayscale images of the inspected part and the template part, and the gradient amplitude and gradient direction of each pixel are calculated. Within the eight neighborhoods of each pixel, if the gradient amplitude of the pixel is the local maximum, the pixel is retained and used as a candidate feature point. Otherwise, the pixel is ignored, and the candidate feature points of the inspected part and the template part are obtained respectively. Match the significant feature values of the part to be inspected and the template part, calculate the comprehensive matching degree, judge whether the image of the part to be inspected is abnormal based on the comprehensive matching degree, and complete the part processing inspection; The matching process includes: clustering and grouping the candidate feature points in the grayscale image based on the significant feature value to obtain a number of clusters, obtaining the significant feature value corresponding to the center point of each cluster, determining the importance of each cluster in the matching according to the significant feature value, and generating a matching descriptor for each cluster, and calculating the comprehensive matching degree between the matching descriptor of each cluster in the image of the part to be inspected and the matching descriptor of the corresponding cluster in the template part image; the matching descriptor of the cluster includes: the center point pixel value, the center point gradient amplitude and the shape complexity; The comprehensive matching degree satisfies the following relationship: ; In the formula, Indicates the comprehensive matching degree, represents the total number of clusters, Indicates the first The significant eigenvalues corresponding to the center points of the clusters, Indicates The Euclidean distance between a cluster and its corresponding cluster’s matching descriptor vector, represents the normalization function, Represented by natural numbers An exponential function with base .
2. A parts processing detection method according to claim 1, characterized in that: The pre-processing comprises: A filter is applied to the grayscale images of the parts to be inspected and the template parts for smoothing to reduce the noise effect in the grayscale images. Then histogram equalization is used to enhance the contrast of the images. The grayscale images of the parts to be inspected are segmented to obtain the part area images in the grayscale images of the parts to be inspected and the template parts.
3. A parts processing detection method according to claim 1, characterized in that: The significant feature values include: Preset the neighborhood size for the candidate feature points of the part to be inspected and the template part respectively, classify the pixel grayscale values, and quantize the grayscale values of the original image to the corresponding grayscale levels, and calculate the correlation value of the grayscale co-occurrence matrix of the pixel points in the neighborhood of each candidate feature point of the part to be inspected and the template part; The correlation value satisfies the following relationship: ; In the formula, Indicates The significant feature values of candidate feature points, Indicates The correlation value of the gray level co-occurrence matrix of pixels in the neighborhood of the candidate feature points, Indicates The gradient direction entropy values of all pixels in the neighborhood of a candidate feature point.
4. A parts processing detection method according to claim 1, characterized in that: The significant feature value also includes: Preset the neighborhood size for the candidate feature points of the inspected part and the template part respectively, take the central pixel in the neighborhood as the reference pixel, compare the grayscale value of the reference pixel with the grayscale value of the pixels in the surrounding neighborhood, generate a binary number according to the comparison result, and in response to the grayscale value of the neighborhood pixel being greater than or equal to the grayscale value of the reference pixel, the position of the neighborhood pixel is binary 1; otherwise, it is 0; The generated binary number is converted into a decimal number, which is the LBP value of the pixel point; and the LBP histogram is constructed to calculate the contrast of the histogram to obtain the significant feature values of the candidate feature points of the part to be inspected and the template part.
5. A parts processing detection method according to claim 1, characterized in that: The shape complexity includes: For each cluster, the convex hull algorithm is used to obtain the boundary, the length of each boundary line of the convex hull is calculated, the Euclidean distance between each boundary line of the cluster convex hull and the cluster center is calculated, and the product of the Euclidean distance and the boundary line length is summed to obtain the overall expansion degree of the cluster convex hull; the overall expansion degree is divided by the number of boundary lines to obtain the average boundary line expansion degree; The mean of the Euclidean distance between each candidate feature point in the cluster and the center point of the cluster is calculated, and the absolute value of the natural logarithm of the difference between 1 and the normalized mean is calculated to obtain the distribution compactness; the product of the average boundary line extension degree and the distribution compactness is taken as the shape complexity of the cluster.
6. A parts processing detection method according to claim 1, characterized in that: The shape complexity also includes: For each cluster, use the convex hull algorithm to obtain the boundary, and calculate the length of each boundary line and the convex hull area of the convex hull; Calculate the Euclidean distance between each boundary line of the cluster convex hull and the cluster center point, and sum the product of the Euclidean distance and the boundary line length to obtain the overall expansion degree of the cluster convex hull; divide the overall expansion degree by the number of boundary lines to obtain the average boundary line expansion degree; The product of the average boundary line extension degree and the convex hull area is taken as the shape complexity of the cluster.
7. A parts processing detection method according to claim 1, characterized in that: The step of judging whether the image of the inspected part is abnormal based on the comprehensive matching degree includes: In response to the matching degree being greater than or equal to the preset threshold, there is no abnormality in the part to be inspected, otherwise there is an abnormality in the image of the part to be inspected.
8. A parts processing detection system, characterized in that: include: A processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the part processing detection method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Intelligent detection method for surface defects of power adapter
CN118014989A
Civil air defense channel blocking method and system
CN118196082A