A Part Geometric Accuracy Acceptance Rate Inspection System and Method Based on Improved SOBEL Algorithm

By improving and combining the SOBEL and CANNY algorithms, and integrating deep learning and machine learning, automated geometric accuracy inspection of parts is achieved. This solves the problems of low efficiency and error-proneness of manual inspection in existing technologies, improves inspection accuracy and speed, and adapts to the inspection needs of different types of parts.

CN116664534BActive Publication Date: 2026-03-06SHENYANG AEROSPACE UNIVERSITY
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202310665854.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-06
Publication Date
2026-03-06
Estimated Expiration
2043-06-06

AI Technical Summary

Technical Problem

Existing parts inspection methods rely on manual inspection, which is inefficient and prone to errors, making it difficult to meet the demand for high-precision inspection of mechanical parts, especially when there are a large number of diverse parts on conveyor belts.

Method used

A part geometric accuracy pass rate inspection system based on the improved SOBEL algorithm is adopted. It combines a binocular camera, a light source, a micrometer, and a laser scanner. By combining the improved SOBEL algorithm with the CANNY algorithm, and integrating deep learning and machine learning, the system achieves automated part geometric accuracy inspection.

Benefits of technology

It improves the accuracy and efficiency of part geometry inspection, reduces the error rate, is applicable to different types of parts, reduces inspection costs in production workshops, and improves inspection speed and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116664534B_ABST
    Figure CN116664534B_ABST
Patent Text Reader

Abstract

This invention provides a part geometric accuracy pass rate detection system and method based on an improved SOBEL algorithm, relating to the fields of visual inspection and optical technology. The invention involves inputting basic information of various parts into the display software, simultaneously moving the machine arm to the operating table to capture standard part images, correcting tangential and radial distortion of the images, processing the part images, and inspecting each part on the conveyor belt. Geometric accuracy recognition and detection are performed on the part images. If the difference between the measurement result and the standard image shape or six geometric features of the part exceeds a pre-set allowable deviation percentage for that type of part, the system indicator light illuminates and an alarm sounds, requiring the operator to remove the defective part. After all parts on the conveyor belt have been inspected, the total number of parts inspected, the number of defective parts, the number of qualified parts, and the pass rate for each category are transmitted back to the display and shown to the operator.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of visual inspection and optical technology, and in particular to a part geometric accuracy pass rate detection system and method based on an improved SOBEL algorithm. Background Technology

[0002] my country's machinery industry is booming and has achieved considerable production scale and equipment capabilities. In particular, the position of the machinery parts industry within the machinery value chain has undergone significant changes. Currently, my country's machinery parts industry comprises six sub-sectors, including fasteners, gears, and powder metallurgy, with a total output value exceeding 500 billion yuan. Facing a challenging domestic and international machinery trade environment, my country's parts industry needs to address various risks, seize innovation opportunities, and maintain a balanced supply chain to achieve a relatively stable strategic production chain. This chain includes the functional shape design of parts, mass production, and testing. Parts are the foundation and core of mechanical equipment, and existing parts testing methods are no longer sufficient to meet the current development needs of the machinery industry. Parts testing conveyors are facing significant challenges.

[0003] The quality inspection of mechanized production parts is the most crucial step in the maintenance of mechanical equipment. By inspecting parts, the technical condition of a machine can be determined, improvement measures can be implemented, and the next steps in the manufacturing process can be planned. It also allows for a comparison of the machine's technical quality before and after inspection. Conveyor belts have a large number and diverse types of parts. Relying solely on a large number of inspectors to visually assess the quality of parts would significantly reduce inspection efficiency and increase labor costs. Furthermore, if inspectors on conveyor belts rely solely on intuition and past experience to assess certain high-precision parts, errors are easily made, leading to inaccurate overall parts pass rates.

[0004] With the development of automated production and the artificial intelligence industry in recent years, machine vision technology has made significant breakthroughs in research. Machine vision inspection has a wide range of applications both domestically and internationally. Applying machine vision inspection to the geometric accuracy inspection of parts will greatly improve inspection efficiency and accuracy. Summary of the Invention

[0005] To address the shortcomings of existing technologies, this invention provides a part geometric accuracy pass rate inspection system and method based on an improved SOBEL algorithm. This invention improves the efficiency and accuracy of part geometric accuracy inspection, solving the problem of requiring manual intervention in existing part inspection processes. This method is not limited to the type of part being inspected and does not need to consider the differences between part types.

[0006] A part geometric accuracy pass rate detection system based on an improved SOBEL algorithm, specifically including a detection equipment group and a host computer;

[0007] The detection equipment group includes a camera, a mechanical rocker arm, a light source, a worktable, an equipment box, and fixtures;

[0008] The workbench is a rectangular platform. The tail end of the mechanical rocker arm is fixed to one edge of the workbench, and the head end moves between the workbench and the production line. The camera is a binocular camera fixed to the mechanical rocker arm. The light source is fixed to the other edge of the workbench. The brightness is set according to the camera shooting environment to provide illumination for the parts to be inspected. The fixture is fixed at the center of the workbench.

[0009] The equipment box is fixed to the edge of the workbench. The equipment box includes a micrometer, a laser scanner, a module for storing part geometric accuracy standards, and a module for detecting whether the part's geometric accuracy is acceptable. The module for storing part geometric accuracy standards includes a first hard disk drive and a first data acquisition card for storing the part's geometric data. The module for detecting whether the part's geometric accuracy is acceptable includes a second hard disk drive and a second data acquisition card for analyzing and evaluating the part's geometric accuracy. The input terminals of both the first and second hard disk drives are connected to the micrometer and laser scanner, respectively. The output terminals of both hard disk drives are connected to the first and second data acquisition cards, respectively. The first and second data acquisition cards are connected together.

[0010] The device box communicates with the host computer via RS-232 serial communication protocol;

[0011] The host computer is a display software, i.e., a graphical user interface, used to interact with the operator. It includes a module for inputting part information and a module for displaying part inspection results. The module for inputting part information inputs the standard information of various qualified parts in sequence, and then transmits the standard information of various qualified parts to the testing equipment. The module for displaying part inspection results in the display terminal displays the geometric accuracy test results of various parts.

[0012] On the other hand, a method for detecting the pass rate of part geometric accuracy based on an improved SOBEL algorithm, implemented based on the aforementioned system for detecting the pass rate of part geometric accuracy based on an improved SOBEL algorithm, specifically includes the following steps:

[0013] Step 1: Enter relevant information on various qualified parts in this production workshop, and input the standard information of various qualified parts into the display terminal of this system to form a parts standard information database;

[0014] Step 1.1: Select one qualified part from the various parts, place it on the worktable in sequence, adjust the direction of the machine rocker arm of the testing equipment to the worktable, and place this part directly under the binocular camera on the rocker arm, and adjust the light source to a suitable light intensity;

[0015] Step 1.2: Enter the standard information of all types of qualified parts currently produced in this machinery production workshop into the part information module. Only one set of standard information should be entered for qualified parts of the same type, including the type name of the part, its type number, and the allowable error size e of the part type.

[0016] Step 1.3: After entering the part type name (name), its type number (number), and the allowable error size (e) of its type part, the part information will be displayed in the part information input module under the binocular camera of the rocker arm. Adjust the light intensity, rocker arm angle, and height to center the part in the image.

[0017] Step 2: Use the binocular camera on the rocker arm to capture real-time images of the parts on the conveyor belt;

[0018] Step 2.1: The optical axes of the two cameras are always kept parallel. Let the focal length of the camera be f, and the horizontal distance between the two cameras, i.e., the baseline distance, be B.

[0019] Step 2.2: The two cameras simultaneously capture a 3D spatial point of the part, denoted as P, with coordinates P(x). i ,y i ,z i Point P has two-dimensional coordinates (x1, y1) in the image captured by one camera and (x2, y2) in the image captured by another camera, where y1 = y2. Let the parallax be D, where D = x1 - x2.

[0020] Step 2.3: The coordinates of point P in the 3D space in the viewpoint coordinate system are represented as follows: The relationship between parallax and the spatial depth of a point P in three-dimensional space is expressed as follows: B represents the baseline distance;

[0021] Step 3: Correct the images captured by the binocular cameras;

[0022] Step 3.1: Perform radial distortion correction on the image, where radial distortion is divided into barrel distortion and pincushion distortion;

[0023] The formula for correcting the radial distortion is:

[0024] x j =x i *(1+k1r 2 +k3r 6 +k2r 4 )

[0025] y j =yi *(1+k1r 2 +k3r 6 +k2r 4 )

[0026] Where k1, k2, and k3 are radial distortion parameters, r is the vector length, and x j Let y be the abscissa after radial distortion. j x is the ordinate after radial distortion; i The corrected x-coordinate, y i The corrected ordinate;

[0027] Step 3.2: Perform tangential distortion correction on the image;

[0028] The formula for correcting the tangential distortion is:

[0029] x0=x+2p1y+p2(r 2 +2x 2 )

[0030] y0=y+2p2x+p1(r 2 +2y 2 )

[0031] Where x0 is the abscissa after tangential distortion, and y0 is the ordinate after tangential distortion; x is the corrected abscissa, and y is the corrected ordinate.

[0032] Step 4: Preprocess the images captured by the binocular cameras and extract features from the processed images;

[0033] Step 4.1: Crop the image so that the part image is placed in the center of the image, remove the image edges, and crop the image size to 1:1.

[0034] Step 4.2: Adjust the image's contrast and brightness;

[0035] Step 4.3: Perform image grayscale processing, enlarge the grayscale level of the image output, use the histogram equalization algorithm to correct the histogram of the original image to a uniform histogram, and then correct the original image according to the equalization histogram.

[0036] Step 4.4: Use the deep learning-based FCN method to segment the image, classify each pixel in the image, obtain the probability of each pixel belonging to each category, and then obtain the image shape, overall size and edge size.

[0037] Step 4.5: Extract the edge features of the part using the improved SOBEL operator method.

[0038] The improved SOBEL operator method combines SOBEL with the CANNY algorithm. Specifically, it first uses image binarization to improve image contrast. Then, it applies non-maximum suppression (NMS) to the preliminary edge detection results after contrast enhancement. The edges after NMS are then subjected to dual thresholding (high and low thresholds) to classify them into strong and weak edges. Strong edges include those with pixel values ​​greater than the high threshold, while weak edges include those with pixel values ​​between the low and high thresholds. The weak edges are then connected to the strong edges to form complete edge lines. The connected edges are then filtered to remove noise and non-edge points, resulting in the final part edges. Next, the CANNY algorithm is used for noise removal and smoothing. A Gaussian filter is used to weight the pixels surrounding each pixel in the image, with pixels closer to the current pixel having a higher weight and pixels farther away having a lower weight. Finally, connected component analysis is performed, treating each connected component as an object to obtain the edge information in the part image.

[0039] Step 4.6: Perform corner feature extraction on the part image. Use the Harris corner detection algorithm to calculate the corner response value of each pixel, and determine the corner position in the image by calculating the autocorrelation matrix. Then, threshold the corner response values ​​to remove response values ​​and duplicate corners.

[0040] Step 5: Staff assist the production workshop in inputting the features extracted in Step 4 into the classifier, and then train, test and optimize the classifier in sequence;

[0041] First, the staff preprocesses and extracts features from the collected part images to obtain relevant feature vectors representing the geometric features of the parts. Next, these feature vectors, along with the corresponding part category labels, are used as input to train a classifier. During training, machine learning algorithms are used to build the classifier model. The model's parameters and hyperparameters are adjusted to optimize classification performance. After training, the classifier is evaluated using an independent test dataset. Performance is assessed by calculating metrics such as accuracy, recall, and precision on the test dataset. If the classifier's performance is unsatisfactory, the process returns to the training phase for parameter adjustment and retraining. Once the classifier reaches a satisfactory performance level, it is applied to actual part image classification problems. New part images are input into the classifier, and through feature extraction and the classifier's judgment, they are automatically classified into the appropriate category.

[0042] Step 5.1: Use the training set to train the classifier. The training set contains images of qualified parts with known accuracy for each type of part.

[0043] Step 5.2: Continuously adjust and optimize the classifier's learning rate, structure and size, the number of samples used in each iteration, the regularization parameter, and the step size of gradient descent;

[0044] Step 6: After all the different types of parts have been entered, adjust the machine arm onto the conveyor belt and prepare for the part pass rate test in the module that displays whether the geometric accuracy of the parts is qualified.

[0045] Step 6.1: Adjust the direction of the machine arm to be on the conveyor belt. At this time, the vertical distance between the binocular camera on the machine arm and the conveyor belt is h.

[0046] Step 6.2: Start the conveyor belt operation switch. The staff places the parts to be inspected at the starting point in sequence, keeping a set distance between each part. The parts begin to be transported to the end point.

[0047] Step 7: Perform geometric accuracy recognition and detection processing on the part image;

[0048] Step 7.1: The conveyor belt starts running. When the camera detects and identifies a complete part appearing in the field of view, it captures an image of the part.

[0049] Step 7.2: Read the barcode information on the part and obtain the type and type code of the currently detected part: First, the position and orientation of the QR code are detected and identified by the module matching method. After the QR code is detected, it is decoded by the binarization method to obtain its type and type code.

[0050] Step 7.3: Repeat steps 2, 3, and 4 to obtain the imaging and related measurement data of the currently inspected part, including part diameter, hole roundness, roundness, parallelism, perpendicularity, and edge features.

[0051] Step 7.4: In the part standard information database that was entered in step 1, find the part standard information corresponding to the part type obtained in step 7.2 and compare them one by one;

[0052] If, in any of the aspects of image shape, diameter, aperture roundness, roundness, parallelism, perpendicularity, and edge features, the difference between the measurement result in step 7.2 and the standard value of this type of part in step 1 exceeds the allowable deviation, the part is considered unqualified. At this time, the number F of unqualified parts of this type is incremented by one, and the conveyor belt stops running. The system instruction light issues an alarm prompt. After the staff removes the part from under the binocular camera, the conveyor belt resumes operation, and the inspection of the remaining parts continues.

[0053] If the difference between the measurement result in step 7.2 and the standard value of this type of part in step 1 is within the allowable deviation range in each of the aspects of imaging shape, diameter, aperture roundness, roundness, parallelism, perpendicularity and edge features, then the part is considered qualified, and the qualified quantity A of this type of part is increased by one.

[0054] Step 7.5: The total number of parts inspected for each type is T = F + A.

[0055] Step 8: Once all parts on the conveyor belt have been inspected, the conveyor belt stops running, and staff can view the inspection results in the parts inspection results display module.

[0056] The specific results of the inspection work are as follows: the name of each type of part, part number, total number of parts inspected T, number of parts with qualified geometric accuracy A, number of parts with unqualified geometric accuracy F, and pass rate Q = A / T are displayed on the display interface.

[0057] The beneficial effects of adopting the above technical solution are as follows:

[0058] This invention provides a part geometric accuracy pass rate inspection system and method based on an improved SOBEL algorithm. Compared with existing technologies, this invention significantly improves the geometric inspection accuracy of parts, resulting in more accurate inspection results. It reduces the error rate and improves the reliability of the system. Optimized algorithms and hardware configurations lower inspection costs in production workshops and also increase inspection speed. Furthermore, it is applicable to different part types and shapes, demonstrating high practicality. In conclusion, this invention has significant application prospects and market value. Attached Figure Description

[0059] Figure 1 A flowchart illustrating the overall steps for detecting the pass rate of part geometric accuracy provided in this embodiment of the invention;

[0060] Figure 2 This is a schematic diagram illustrating the association between the display terminal and the detection equipment module provided in an embodiment of the present invention;

[0061] Figure 3 This is a schematic diagram of the interface for the part information input function (information input mode) of the display terminal software provided in this embodiment of the invention.

[0062] Figure 4 This is a flowchart of the image preprocessing steps for the acquired image provided in an embodiment of the present invention.

[0063] Figure 5 This is a flowchart of the geometric accuracy recognition and detection process for part imaging provided in an embodiment of the present invention. Detailed Implementation

[0064] The specific embodiments of the present invention will be described in further detail below with reference to the accompanying drawings and examples. The following examples are for illustrative purposes only and are not intended to limit the scope of the invention.

[0065] A part geometric accuracy pass rate detection system based on an improved SOBEL algorithm, specifically including a detection equipment group and a host computer;

[0066] The detection equipment group includes a camera, a mechanical rocker arm, a light source, a worktable, an equipment box, and fixtures;

[0067] The worktable is a rectangular platform. The tail end of the mechanical rocker arm is fixed to one edge of the worktable, while the head end moves between the worktable and the production line. The camera is a binocular camera, fixed to the mechanical rocker arm, used to capture images of the parts to be inspected. The light source is fixed to the other edge of the worktable, and its brightness is set according to the camera's shooting environment to provide appropriate lighting conditions for the parts to be inspected.

[0068] The equipment box is fixed to the edge of the workbench. It includes a micrometer, a laser scanner, a module for storing part geometric accuracy standards, and a module for detecting whether the part's geometric accuracy is acceptable. This specially designed physical structure ensures the installation of the hardware in both modules. The equipment in the box includes: a micrometer for real-time measurement of the part's geometric features, measuring key characteristics such as size and shape; a laser scanner that acquires the part's three-dimensional shape data by emitting a laser beam and recording the reflection of the laser beam on the part's surface; a first hard disk drive and a first data acquisition card for storing the part's geometric data; and a second hard disk drive and a second data acquisition card for analyzing and evaluating the part's geometric accuracy. The input terminals of both the first and second hard disk drives are connected to the micrometer and laser scanner, respectively, and their output terminals are connected to the first and second data acquisition cards. The first and second data acquisition cards are also connected.

[0069] The module for storing part geometric accuracy standards is used to store the geometric data of the parts, and the first hard disk drive is used to store the measured geometric features of the parts as a reference standard for the geometric accuracy of the parts in subsequent inspection work.

[0070] The module for detecting whether the geometric accuracy of a part is qualified is used to analyze and evaluate the geometric accuracy of the part. It can compare the data with the data in the module storing the geometric accuracy standard of the part to determine whether the part meets the requirements. The second hard disk drive has the function of data storage and comparison, used for real-time measurement and comparison, recording and storing the actual geometric accuracy data of the parts to be inspected on the production line, and can read the geometric accuracy reference standard information of the parts in the first data acquisition card for comparison to determine whether the part is qualified, and store the inspection results of various types of parts.

[0071] The fixture is fixed at the center of the worktable to hold the part to be inspected, ensuring the stability of the part's position relative to the laser scanner and micrometer. The laser scanner and micrometer can scan at different angles and directions to obtain more comprehensive geometric information.

[0072] The equipment enclosure connects to a host computer via a data transmission interface to enable data transmission and communication. This allows the host computer to receive and process data acquired from the testing equipment, and to analyze and evaluate the geometric accuracy of the parts, such as... Figure 2 As shown.

[0073] The host computer is the display software, i.e., the graphical user interface, used for interaction with the operator, such as... Figure 3 As shown. The testing equipment communicates with the host computer via the RS-232 serial communication protocol, allowing the testing equipment to send testing data to the host computer and receive standard information for various qualified parts from the host computer. It includes a part information input module and a part testing result display module. The part information input module sequentially inputs the standard information for various qualified parts, and then transmits this information to the testing equipment. The part testing result display module shows the geometric accuracy testing results for various parts.

[0074] On the other hand, a method for detecting the pass rate of part geometric accuracy based on an improved SOBEL algorithm is implemented based on the aforementioned system for detecting the pass rate of part geometric accuracy based on an improved SOBEL algorithm, such as... Figure 1 As shown, the specific steps include:

[0075] Step 1: The display software is implemented in C++, featuring a user-friendly, concise, and easy-to-operate interface, using button triggers and dialog boxes. It inputs relevant information about various qualified parts from the production workshop, and then inputs the standard information of these qualified parts into the system's display, forming a parts standard information database.

[0076] Step 1.1: Select one qualified part from the various parts, place it on the worktable in sequence, adjust the direction of the machine rocker arm of the testing equipment to the worktable, and place this part directly under the binocular camera on the rocker arm, and adjust the light source to a suitable light intensity;

[0077] Step 1.2: Enter the standard information of all types of qualified parts currently produced in this machinery production workshop into the part information module. Only one set of standard information should be entered for qualified parts of the same type, including the type name of the part, its type number, and the allowable error size e (in percentage).

[0078] Step 1.3: After entering the part type name (name), its type number (number), and the allowable error size (e) of the part type, the part image content displayed in the part information input module under the binocular camera of the rocker arm will be displayed. Adjust the light intensity, rocker arm angle, and height to center the part in the image and make the image clear and bright. After the adjustment is completed, trigger the part image acquisition command. For details of the image acquisition process, please refer to Step 2, Step 3, Step 4, and Step 5.

[0079] Step 2: Use the binocular camera on the rocker arm to capture real-time images of the parts on the conveyor belt; the conveyor belt is a workshop conveyor belt located next to the workbench;

[0080] Step 2.1: The optical axes of the two cameras are always kept parallel. Let the focal length of the camera be f, and the horizontal distance between the two cameras, i.e., the baseline distance, be B.

[0081] Step 2.2: The two cameras simultaneously capture a 3D spatial point of the part, denoted as P, with coordinates P(x). i ,y i ,z i Point P has two-dimensional coordinates (x1, y1) in the image captured by one camera and (x2, y2) in the image captured by the other camera, with y1 = y2. Since the binocular camera simulates two human eyes, there is always a directional difference when the naked eye observes an object, which is called parallax, let's call it D, where D = x1 - x2.

[0082] Step 2.3: The coordinates of point P in the 3D space in the viewpoint coordinate system are represented as follows: The relationship between parallax and the spatial depth of a point P in three-dimensional space is expressed as follows: B represents the baseline distance;

[0083] Step 3: Resolve image distortion issues by correcting the images captured by the binocular cameras;

[0084] Step 3.1: Perform radial distortion correction on the image, where radial distortion is divided into barrel distortion and pincushion distortion;

[0085] The formula for correcting the radial distortion is:

[0086] x j =x i *(1+k1r 2 +k3r 6 +k2r 4 )

[0087] y j =y i *(1+k1r 2 +k3r 6 +k2r 4 )

[0088] Where k1, k2, and k3 are radial distortion parameters, r is the vector length, and x j Let y be the abscissa after radial distortion. j x is the ordinate after radial distortion; i The corrected x-coordinate, y i K is the corrected ordinate. In this formula, k1 plays a major role when correcting the image center region with relatively small distortion, and k2 plays a major role when correcting the image edge region with relatively large distortion.

[0089] Step 3.2: To address the impact of errors during mechanical assembly, tangential distortion correction is performed on the image;

[0090] The formula for correcting the tangential distortion is:

[0091] x0=x+2p1y+p2(r 2 +2x 2 )

[0092] y0=y+2p2x+p1(r 2 +2y 2 )

[0093] Where x0 is the abscissa after tangential distortion, and y0 is the ordinate after tangential distortion; x is the corrected abscissa, and y is the corrected ordinate.

[0094] Step 4: Preprocess the images captured by the binocular cameras to eliminate differences between different features, thereby improving the efficiency of the classifier in Step 5. Then, extract features from the processed images, such as... Figure 4 As shown;

[0095] Step 4.1: Crop the image to center the part image to reduce the complexity of subsequent image recognition, remove useless parts at the edges of the image, and crop the image size to 1:1 to suit the subsequent detection scenario.

[0096] Step 4.2: Adjust the contrast and brightness of the image to improve the visual effect; the image will become brighter.

[0097] Step 4.3: Perform image grayscale processing, enlarge the grayscale level of the image output, use the histogram equalization algorithm to correct the histogram of the original image to a uniform histogram, and then correct the original image according to the equalization histogram.

[0098] Step 4.4: Use the deep learning-based FCN method to segment the image, classify each pixel in the image, obtain the probability of each pixel belonging to each category, and then obtain the image shape, overall size and edge size.

[0099] Step 4.5: Extract the edge features of the part using the improved SOBEL operator method.

[0100] The improved SOBEL operator method combines SOBEL with the CANNY algorithm, enabling more accurate detection of part edges in images. Specifically, it first uses image binarization to enhance contrast. Then, it applies non-maximum suppression (NMS) to the initial edge detection results after contrast enhancement to preserve more prominent edges. The edges after NMS are then subjected to dual thresholding (high and low thresholds), categorizing them into strong and weak edges. Strong edges include those with pixel values ​​greater than the high threshold, while weak edges include those with pixel values ​​between the low and high thresholds. Weak edges are then connected to strong edges to form complete edge lines. These connected edges are then filtered to remove noise and non-edge points, yielding the final part edges. Next, the CANNY algorithm is used for noise removal and smoothing. A Gaussian filter is used to weight the pixels surrounding each pixel in the image, with pixels closer to the current pixel having a higher weight and pixels farther away having a lower weight. This effectively removes noise and details while preserving edge information. Finally, connected component analysis is performed, treating each connected component as an object to obtain edge information in the part image.

[0101] The advantages of this improved method are: it significantly reduces the false detection rate. When using the Sobel algorithm to detect edges, it may detect some areas that are not edges as well. The Canny algorithm, by removing noise and details, ensures that only true edges are detected, thus reducing the false detection rate. It is also adaptable to different types of parts. Different types of parts may have different shapes and features, exhibiting considerable variation. Combining the Sobel and Canny algorithms can adapt to different types of parts and detect their edge information. Furthermore, employing GPU-based parallel computing technology can accelerate the computation speed.

[0102] Step 4.6: Perform corner feature extraction on the part image. Use the Harris corner detection algorithm to calculate the corner response value of each pixel, and determine the corner position in the image by calculating the autocorrelation matrix. Then, threshold the corner response values ​​to remove response values ​​and duplicate corners.

[0103] Step 5: Staff members assist the production workshop in inputting the features extracted in Step 4 into the classifier, and then train, test and optimize the classifier in sequence so that it can be applied to the classification problem of part images.

[0104] First, the collected part images undergo preprocessing and feature extraction to extract relevant feature vectors representing the geometric features of the parts. Next, these feature vectors, along with the corresponding part category labels, are used as input to train a classifier. During training, machine learning algorithms are used to build the classifier model. The model's parameters and hyperparameters are adjusted during training to optimize classification performance. After training, the classifier is evaluated using an independent test dataset. Performance is assessed by calculating metrics such as accuracy, recall, and precision on the test dataset. If the classifier's performance is unsatisfactory, the process returns to the training phase for parameter adjustments and retraining to improve performance. Once the classifier reaches a satisfactory performance level, it is applied to actual part image classification problems. New part images are input into the classifier, and through feature extraction and the classifier's judgment, they are automatically classified into the appropriate category.

[0105] Step 5.1: Train the classifier using the training set, applying the random forest method to avoid high-dimensional and missing data due to the special structure of the parts. The training set contains images of qualified parts of various types with known precision. Each image contains geometric features such as dimensions and shape with known precision. In this step, the classifier will learn how to map the features of the part images to the part categories one-to-one.

[0106] Step 5.2: Continuously adjust and optimize the classifier's learning rate, structure and size, the number of samples used in each iteration, the regularization parameter, and the step size of gradient descent;

[0107] Step 6: After all the different types of parts have been entered, adjust the machine arm onto the conveyor belt and prepare for the part pass rate test in the module that displays whether the geometric accuracy of the parts is qualified.

[0108] Step 6.1: Adjust the direction of the machine arm to be on the conveyor belt. At this time, the vertical distance between the binocular camera on the machine arm and the conveyor belt is h.

[0109] Step 6.2: Start the conveyor belt operation switch. The staff places the parts to be inspected at the starting point in sequence, keeping a set distance between each part. The parts begin to be transported to the end point.

[0110] Step 7: Perform geometric accuracy recognition and detection processing on the part image, such as... Figure 5 As shown;

[0111] Step 7.1: The conveyor belt starts running. When the camera detects and identifies a complete part appearing in the field of view, it captures an image of the part.

[0112] Step 7.2: Read the barcode information on the part and obtain the type and type code of the currently detected part: First, the position and orientation of the QR code are detected and identified by the module matching method. After the QR code is detected, it is decoded by the binarization method to obtain its type and type code.

[0113] Step 7.3: Repeat steps 2, 3, and 4 to obtain the imaging and related measurement data of the currently inspected part, including part diameter, hole roundness, roundness, parallelism, perpendicularity, and edge features.

[0114] Step 7.4: In the part standard information database that was entered in step 1, find the part standard information corresponding to the part type obtained in step 7.2 and compare them one by one;

[0115] If, in any of the aspects of image shape, diameter, aperture roundness, roundness, parallelism, perpendicularity, and edge features, the difference between the measurement result in step 7.2 and the standard value of this type of part in step 1 exceeds the allowable deviation, the part is considered unqualified. At this time, the number F of unqualified parts of this type is incremented by one, and the conveyor belt stops running. The system instruction light issues an alarm prompt. After the staff removes the part from under the binocular camera, the conveyor belt resumes operation, and the inspection of the remaining parts continues.

[0116] If the difference between the measurement result in step 7.2 and the standard value of this type of part in step 1 is within the allowable deviation range in each of the aspects of imaging shape, diameter, aperture roundness, roundness, parallelism, perpendicularity and edge features, then the part is considered qualified, and the qualified quantity A of this type of part is increased by one.

[0117] Step 7.5: The total number of parts inspected for each type is T = F + A.

[0118] Step 8: Once all parts on the conveyor belt have been inspected, the conveyor belt stops running, and staff can view the inspection results in the parts inspection results display module.

[0119] The specific results of the inspection work are as follows: the name of each type of part, part number, total number of parts inspected T, number of parts with qualified geometric accuracy A, number of parts with unqualified geometric accuracy F, and pass rate Q = A / T are displayed on the display interface.

[0120] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in the embodiments of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described inventive concept. For example, technical solutions formed by substituting the above-described features with (but not limited to) technical features with similar functions disclosed in the embodiments of this disclosure.

Claims

1. A part geometric accuracy qualification detection system based on an improved SOBEL algorithm, characterized in that, It comprises a detection device group and a host computer; The detection device group comprises a camera, a mechanical rocker arm, a light source, a workbench, a device box and a clamp; The workbench is a rectangular platform, the tail end of the mechanical rocker arm is fixed on the edge of one side of the workbench, and the head end moves between the workbench and the production line; the camera is a binocular camera fixed on the mechanical rocker arm, and the light source is fixed on the edge of the other side of the workbench to set the brightness according to the camera shooting environment and provide illumination conditions for the parts to be detected; the clamp is fixed at the center of the workbench; The device box communicates with the host computer through the RS-232 serial communication protocol; The host computer is a display terminal software, namely a graphical user interface, which is used for interaction with the operator and comprises a part information input module and a part detection result display module; The part information input module sequentially inputs the standard information of various qualified parts, and the part information input module further transmits the standard information of various qualified parts to the detection device, and the part detection result display module in the display terminal displays the geometric precision detection results of various parts; The device box is fixed on the edge of the workbench, and the device box comprises an instrument micrometer, a laser scanner, a part geometric precision standard storage module and a part geometric precision qualification detection module; the part geometric precision standard storage module comprises a first hard disk drive and a first data acquisition card, which are used for storing the geometric data of the parts; the part geometric precision qualification detection module comprises a second hard disk drive and a second data acquisition card, which are used for analyzing and evaluating the geometric precision of the parts; The input ends of the first hard disk drive and the second hard disk drive are connected with the instrument micrometer and the laser scanner, the output ends of the first hard disk drive and the second hard disk drive are connected with the first data acquisition card and the second data acquisition card respectively, and the first data acquisition card is connected with the second data acquisition card; The part geometric precision qualification detection system based on the improved SOBEL algorithm is used to realize a part geometric precision qualification detection method based on the improved SOBEL algorithm, which comprises the following steps: Step 1: input the related information of various qualified parts in the production workshop into the display terminal of the system to form a part standard information database; Step 1.1: take a qualified part from various parts, place it on the workbench in sequence, adjust the direction of the machine rocker arm of the detection device to the workbench, and place the part under the binocular camera on the rocker arm, and adjust the light source to the appropriate illumination intensity; Step 1.2: Enter all the standard information of all the qualified parts of various types that have been produced in the present mechanical production workshop into the input part information module, and only one set of standard information is entered for the qualified parts of the same type, which includes the type name name, the type number number and the allowable error size of the type part ; Step 1.3: input the type name of the part, its type number and the allowable error size of the type part After that, the part information input module displays the imaging content of this part under the binocular camera of the rocker arm, and the light intensity, rocker arm angle and height are adjusted to make the part in the imaging center. Step 2: use the binocular camera on the rocker arm to collect the part image on the conveying belt in real time; Step 3: correct the image collected by the binocular camera; Step 4: pre-process the image captured by the binocular camera, and extract features from the processed image; Step 5: the staff assists the production workshop to input the features extracted in step 4 into the classifier, and sequentially trains, tests and optimizes the classifier; Step 6: After all the parts of different categories are recorded, adjust the machine rocker arm to the conveying belt, and prepare for the qualified rate detection of the parts in the display part detection part geometric precision qualified module; Step 6.1: Adjust the direction of the machine rocker arm to the conveying belt, at this time the vertical distance between the binocular camera on the machine rocker arm and the conveying belt is h; Step 6.2: Start the running switch of the conveying belt, and the workers place the parts to be detected in turn at the starting point and keep a certain distance between each part, and the parts start to transport to the terminal end; Step 7: Geometric precision identification and detection processing is performed on the part imaging; Step 8: All part detection work on the conveying belt is completed, the conveying belt stops running, and the workers check the detection result of this detection work in the display part detection result module; Specifically, the inspection results are displayed on the display interface as follows: the name, part number, and total number of parts inspected for each type. Number of qualified geometric precision Number of geometric precision defects pass rate ; The step 2 specifically includes the following steps: Step 2.1: The binocular camera is placed with the optical axes of the two cameras always kept parallel, and the horizontal line connecting the two cameras is the baseline distance ; Step 2.2: The two cameras on the left and right capture a three-dimensional point of the part simultaneously, which is set as , the coordinates of which are ; the point has a two-dimensional coordinate in the image captured by one of the cameras as , a two-dimensional coordinate in the image captured by the other camera as , and , and the parallax is set as , ; Step 2.3: Three-dimensional spatial point The coordinates in the viewpoint coordinate system are represented as The relationship of the parallax and the spatial depth of the three-dimensional spatial point is represented as B represents the baseline distance; The step 3 specifically includes the following steps: Step 3.1: Radial distortion correction is performed on the image, and the radial distortion is divided into barrel distortion and pillow distortion; The correction formula of the radial distortion is: x j =x i *(1+k1r 2 + k3r 6 + k2r 4 ); y j =y i *(1+k1r 2 + k3r 6 + k2r 4 ); wherein k1, k2, k3 are radial distortion parameters, r is the vector length, x j is the horizontal coordinate after radial distortion occurs, y j is the vertical coordinate after radial distortion occurs; x i is the corrected horizontal coordinate, y i is the corrected vertical coordinate; Step 3.2: Tangential distortion correction is performed on the image; The correction formula of the tangential distortion is: x0 = x + 2 p1y + p2(r 2 + 2x 2 ); y0 = y + 2 p2x + p1(r 2 + 2y 2 ); Wherein, x0 is the horizontal coordinate after tangential distortion, y0 is the vertical coordinate after tangential distortion; x is the corrected horizontal coordinate, and y is the corrected vertical coordinate; The step 4 specifically includes the following steps: Step 4.1: Crop the image so that the part imaging is placed in the center of the image, remove the image edge, and crop the image size to 1:1; Step 4.2: Adjust the contrast and brightness of the image; Step 4.3: Perform image grayscale processing, enlarge the gray level output by the image, use the histogram equalization algorithm to modify the histogram of the original image to a uniform histogram, and then modify the original image according to the equalized histogram; Step 4.4: The FCN method based on deep learning is used for image segmentation, each pixel in the image is classified and processed, the probability size of each pixel belonging to each category is obtained, and then the imaging shape, overall size and edge size of the image are obtained; Step 4.5: The edge features of the parts are extracted by improving the SOBEL operator method; The improved SOBEL operator method combines SOBEL and CANNY algorithm, specifically, first, the image binarization method is used to improve the image contrast, then the non-maximum suppression is performed on the preliminary edge detection result after improving the image contrast, the edge after non-maximum suppression is processed by high and low threshold double threshold value, and the edge is divided into two categories of strong edge and weak edge, wherein the strong edge includes the edge with pixel value greater than the high threshold value, and the weak edge includes the edge with pixel value between the low threshold value and the high threshold value; the weak edge is connected, and it is connected with the strong edge, so as to form a complete edge line; then the connected edge is filtered to remove noise and non-edge points, so as to obtain the final part edge; then the Canny algorithm is used for noise removal and smoothing processing, and a Gaussian filter is used to weight average the pixels around each pixel in the image, wherein the closer the pixel is to the pixel, the greater the weight is, and the farther the pixel is, the smaller the weight is, and finally the connected domain analysis is performed, each connected domain is regarded as an object, and the edge information in the part image is obtained; Step 4.6: Perform corner feature extraction operation on the part image, use Harris corner detection algorithm to calculate the corner response value of each pixel point, and judge the corner position in the image by calculating the autocorrelation matrix of the image; then the threshold value of the corner response value is processed to remove the repeated corner points with response value; The step 5 specifically includes: First, the staff extracts the relevant feature vector representing the geometric features of the parts after pre-processing and feature extraction of the collected part images, then the staff uses the feature vector as input together with the corresponding part category label to train the classifier; In the training process, a machine learning algorithm is used to build a classifier model; In the training process, the parameters and hyperparameters of the model are adjusted to optimize the classification performance; After the training is completed, the staff evaluates the classifier using an independent test data set; They will evaluate the performance of the classifier by calculating the accuracy, recall rate, precision and other indicators of the classifier on the test data set; If the performance of the classifier is not ideal, go back to the training stage and adjust the parameters and retrain, once the classifier reaches a satisfactory performance level, the staff will apply the optimized classifier to the actual part image classification problem, input the new part image into the classifier, and automatically classify it into the appropriate category through feature extraction and classifier judgment; Step 5.1: Use the training set to train the classifier, which contains known accuracy of qualified part images of various types of parts; Step 5.2: Continuously adjust and optimize the learning rate, structure and size of the classifier, the number of samples used in each iteration, the regularization parameter and the step size of gradient descent; The step 7 specifically includes the following steps: Step 7.1: The conveyor belt starts to run, and when the complete part is detected and recognized in the field of view, the camera captures the part image; Step 7.2: Read the barcode information on the part, obtain the type and type code of the current detected part: first detect and identify the position and direction of the two-dimensional code by module matching method, then decode the two-dimensional code after using the binarization method to obtain the type and type code of the two-dimensional code; Step 7.3: Repeat the operations of steps 2, 3 and 4 to obtain the imaging and related measurement data of the current detected part, including part diameter, hole diameter roundness, roundness, parallelism, perpendicularity and edge characteristics; Step 7.4: In the part standard information library recorded in step 1, find the part standard information corresponding to the part type obtained in step 7.2 for one-to-one comparison; If the difference between the measurement result of step 7.2 and the standard value of the parts in step 1 in the aspects of imaging shape, diameter, aperture roundness, roundness, parallelism, perpendicularity and edge characteristics exceeds the allowable deviation, the parts are considered unqualified; at this time, the unqualified number of this type of parts is added by one, and at this time the conveyor belt stops running, the system instruction light gives an alarm prompt, and after the worker moves the part out from under the binocular camera, the conveyor belt continues to run, and the detection work of the remaining parts continues; one, and at this time the conveyor belt stops running, the system instruction light gives an alarm prompt, and after the worker moves the part out from under the binocular camera, the conveyor belt continues to run, and the detection work of the remaining parts continues; If the difference between the measurement result of step 7.2 and the standard value of the parts of this type in step 1 in the aspects of imaging shape, diameter, aperture roundness, roundness, parallelism, perpendicularity and edge characteristics is within the allowable deviation range for each item, the parts are considered qualified, and the qualified number of parts of this type is added by one at this time one; Step 7.5: Total number of detected parts per part type .

Citation Information

Patent Citations

  • Stereoscopic-vision-based rapid workpiece sorting method and device

    CN108480239A

  • System and method for detecting quality of parts

    CN109612993A

  • Part size high-precision measurement method based on machine vision

    CN115096206A

  • Control box assembly defect detection method and device based on YOLOv4 neural network, and medium

    CN115330997A