A machine vision detection method and system for workpiece defect detection

Through pre-inspection processing and position adjustment combined with image stitching technology, the problems of low efficiency and incomplete detection of workpiece defects in the prior art are solved, and efficient and accurate workpiece defect detection is achieved.

CN118010751BActive Publication Date: 2025-01-03HANGZHOU HUICUI INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410410816.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-08
Publication Date
2025-01-03
Estimated Expiration
2044-04-08

AI Technical Summary

Technical Problem

The existing workpiece defect detection methods are not efficient and cannot achieve comprehensive inspection, and lack comprehensive inspection in all directions of the workpiece.

Method used

The workpiece matching information is obtained through pre-inspection processing, the original workpiece point information is determined and feature points are added, and the position adjustment device and visual detection module are used to perform position adjustment to realize all-round image sampling and detection, combining image stitching technology and comparison and judgment strategy Obtain the test results.

Benefits of technology

It improves detection efficiency and accuracy, and achieves all-round inspection of workpieces without manual assistance, so the inspection results are more accurate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118010751B_ABST
    Figure CN118010751B_ABST
Patent Text Reader

Abstract

The present invention relates to a machine vision detection method and system for workpiece defect detection, the method comprising the following steps: determining a workpiece to be detected, performing a pre-inspection process on the workpiece to be detected, and obtaining workpiece matching information that matches the workpiece to be detected according to the result of the pre-inspection process; determining original workpiece point information according to the workpiece matching information and adding feature points based on the workpiece to be detected, and generating final adjustment point information of the workpiece corresponding to the workpiece to be detected; controlling a positioning device to adjust the position of the workpiece to be detected according to the final adjustment point information of the workpiece, and adjusting the position of a visual detection module to achieve omnidirectional image sampling; using the adjusted visual detection module to detect the workpiece to be detected, forming a feature image based on the same reference object by using a captured image splicing technology, and obtaining a detection result by comparing and judging a strategy analysis; the system is established based on the method; the present invention can achieve intelligent detection of workpieces.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of machine vision technology, and in particular to a machine vision detection method and system for workpiece defect detection. Background Art

[0002] Visual inspection refers to the process of converting captured targets into image signals through machine vision products and transmitting them to a dedicated image processing system. The image system performs various operations on these signals to extract the features of the target and obtain the corresponding inspection results through identification and judgment of the target features. Visual inspection has inestimable value in detecting defects and preventing defective products from being delivered to consumers.

[0003] In the prior art, defect detection of workpieces often adopts manual detection or collaborative detection methods of machine vision and manual detection. These existing detection methods all have technical problems such as low detection efficiency and inability to achieve comprehensive detection of workpieces in all directions. Summary of the invention

[0004] The purpose of the present invention is to overcome the defects of the prior art and provide a machine vision detection method and system for workpiece defect detection.

[0005] The present invention provides a machine vision detection method for workpiece defect detection, and its technical solution is as follows:

[0006] A machine vision inspection method for workpiece defect detection comprises the following steps:

[0007] S1: determining a workpiece to be measured, performing a pre-inspection process on the workpiece to be measured, and obtaining workpiece matching information that matches the workpiece to be measured according to a result of the pre-inspection process;

[0008] S2: determining the original workpiece point information according to the workpiece matching information and adding feature points based on the workpiece to be measured, to generate final workpiece adjustment point information corresponding to the workpiece to be measured;

[0009] S3: controlling the position adjustment device to adjust the position of the workpiece to be tested according to the final adjustment point information of the workpiece, and adjusting the position of the visual inspection module to achieve omnidirectional image sampling;

[0010] S4: using the visual inspection module adjusted in step S3 to inspect the workpiece to be inspected, forming a feature image based on the same reference object by the acquired image stitching technology, and obtaining the inspection result by comparing and judging the strategy analysis.

[0011] The method in the technical solution of the present invention, first, after determining the workpiece to be measured, after placing the workpiece to be measured at the detection position, pre-inspection processing is performed on the workpiece to be measured to obtain matching information of the workpiece to be measured; then, the preset point information of the workpiece is verified according to the workpiece matching information, and the corresponding feature points are added to obtain the final adjustment point information of the workpiece, and based on the final adjustment point information of the workpiece, the position of the workpiece to be measured and the visual inspection module are adjusted respectively; finally, the workpiece to be measured is inspected according to the visual inspection module, and the final inspection result is determined according to the feature image comparison, and the inspection result obtained is highly accurate.

[0012] Compared with the prior art, the present invention involves a machine vision inspection method for workpiece defect detection, which utilizes machine vision inspection technology to inspect the workpiece to be inspected, and can flexibly adjust different workpieces to achieve comprehensive inspection without the need for human assistance, thereby greatly improving the inspection efficiency. At the same time, compared with manual defect detection, the accuracy is higher.

[0013] Preferably, the result of the pre-inspection processing obtained in the step S1 includes obtaining the pre-inspection position result and the pre-inspection image result corresponding to the workpiece to be measured; thereby focusing on the key items of the pre-inspection, improving the pre-inspection efficiency, and providing a guarantee for the processing of the subsequent results.

[0014] Preferably, the step S1 comprises the following steps:

[0015] S11, obtaining the position information of the workpiece to be measured and converting it into a three-dimensional coordinate form, judging whether it exceeds a preset coordinate range, if not, taking the currently obtained three-dimensional coordinate form as the pre-inspection position result corresponding to the workpiece to be measured, and proceeding to the next step; if so, adjusting the placement position of the workpiece to be measured by manipulating the positioning device so that the corresponding three-dimensional coordinate falls within the preset coordinate range, and taking the three-dimensional coordinate form at this time as the pre-inspection position result corresponding to the workpiece to be measured, and proceeding to the next step;

[0016] S12, capturing the initial image information corresponding to the workpiece to be measured through the visual inspection module in the initialization state, and judging whether the clarity of the initial image information is not less than the preset clarity range requirement, if so, taking the initial image information as the pre-inspection image result corresponding to the workpiece to be measured, and proceeding to the next step, if not, adjusting the parameters of the visual inspection module to achieve a clarity not less than the preset clarity range requirement, and taking the image corresponding to the workpiece to be measured obtained at this time as the pre-inspection image result corresponding to the workpiece to be measured, and proceeding to the next step;

[0017] S13, according to the pre-inspection image result corresponding to the workpiece to be measured, traverse the workpiece matching database to find out the workpiece matching information adapted to the workpiece to be measured, and use it as the workpiece matching information;

[0018] This enables fast and efficient acquisition of the pre-inspection position results and pre-inspection image results of the workpiece to be tested, ensures the acquisition of workpiece matching information, and ensures that the algorithm is simple and feasible with low complexity.

[0019] Preferably, step S2 comprises the following steps:

[0020] S21: determining the original workpiece point information, the improved shape characteristics and the change requirement characteristics of the workpiece to be measured from the workpiece matching information, and generating feature point information based on the workpiece to be measured;

[0021] S22: inserting or replacing the original workpiece point information according to the characteristic point information obtained in step S21 to obtain the final adjusted point information of the workpiece;

[0022] The above-mentioned workpiece matching information mainly includes various types of workpiece parameters and workpiece detection information, and the workpiece point information is a type of workpiece detection information.

[0023] Preferably, step S3 comprises the following steps:

[0024] S31: controlling the positioning device to adjust the position of the workpiece to be measured according to a first adjustment strategy within the preset coordinate range, wherein the first adjustment strategy is to adjust the position according to the distribution of the final adjustment point information of the workpiece and to minimize the distance change from the position center of the workpiece to each point;

[0025] S32: using a second adjustment strategy to adjust the position of the visual inspection module, wherein the second adjustment strategy is to adjust the position according to the change of the inserted points and the replaced points when executing the step S22 and according to the principle of minimum change distance;

[0026] This provides a reasonable and efficient control method for manipulating the positioning device to adjust the position of the workpiece to be tested, as well as for adjusting the position of the visual inspection module, thereby ensuring all-round sampling of the visual module and ensuring efficient and complete image acquisition.

[0027] Preferably, step S4 comprises the following steps:

[0028] S41, using the visual inspection module adjusted in step S32 to acquire images of the workpiece to be inspected in various directions;

[0029] S42, using image stitching technology to stitch the collected images obtained in step S41 to form a plurality of feature images based on the same reference object, and sorting the feature images;

[0030] S43, comparing and judging the feature images according to the sorting order of step S43 by using the comparison and judgment strategy to obtain the final detection result;

[0031] This greatly improves the detection efficiency and is more accurate than manual defect detection.

[0032] Preferably, the comparison and judgment strategy in step S43 includes the following steps:

[0033] S431: Retrieving a standard feature image converted from the design drawing of the workpiece to be tested, and performing edge detection and local enhancement processing on the standard feature image to generate a standard feature image for comparison;

[0034] S432: Compare the standard feature image with the feature image currently to be compared to determine whether there is a contour deviation. If yes, proceed to the next step; if no, proceed to step S434;

[0035] S433: extract the contour deviation part, obtain the contour deviation amount by calculation, and judge whether the contour deviation amount exceeds the standard value calculated by the specified tolerance. If so, it is determined that the feature image currently required to be compared has the contour deviation part that causes the defect, and it is used as the corresponding detection result, and then the next step is executed; if not, it is determined that the feature image currently required to be compared has the contour deviation, but does not have the contour deviation part that causes the defect, and it is used as the corresponding detection result, and then the next step is executed;

[0036] S434: according to the sorting order of step S43, determine whether the feature image currently to be compared is the last one, if so, the comparison ends; if not, take the next feature image to be compared as the feature image currently to be compared, and return to step S432;

[0037] This enables comparison and judgment of feature images to ensure accurate comparison and obtain accurate and complete detection results.

[0038] Preferably, the method further comprises the following steps:

[0039] S5, sending the test result obtained in step S4 to the test terminal after security processing, and checking the test result after the test terminal analyzes it;

[0040] Since the detection terminal can view the test results more conveniently, for security reasons, the test result data needs to be securely processed and then sent to the monitoring terminal, and the authorized detection terminal can view it, thus realizing the intelligence and visualization of the test results.

[0041] The present invention provides a machine vision inspection system for workpiece defect detection, and its technical solution is as follows:

[0042] A machine vision detection system for workpiece defect detection, based on the machine vision detection method for workpiece defect detection described in the present invention, includes:

[0043] A positioning device, used for placing a workpiece to be measured and adjusting the position of the workpiece to be measured;

[0044] A visual inspection module, used to obtain images of the workpiece to be inspected in various directions;

[0045] A position detector, used to obtain the position information of the workpiece to be measured;

[0046] A pre-inspection module is configured to collect the captured image output by the visual inspection module and the position information of the workpiece to be measured output by the position detector after the workpiece to be measured is placed on the positioning device, find out the workpiece matching information adapted to the workpiece to be measured, and form a pre-inspection result;

[0047] The workpiece matching module is configured to generate workpiece matching information according to the pre-check result output by the pre-check module;

[0048] A point setting module is configured to generate final adjustment point information of the workpiece according to the workpiece matching information output by the workpiece matching module;

[0049] A control module is configured to control the position adjustment device to adjust the position of the workpiece to be measured according to the final adjustment point information of the workpiece output by the point setting module, and to adjust the position of the visual inspection module to achieve omnidirectional image sampling;

[0050] The comparison and judgment module is configured to collect the acquired images output by the visual inspection module when inspecting the workpiece to be inspected after the control module completes the manipulation, form a feature image based on the same reference object through the acquired image stitching technology, and finally obtain the inspection result through analysis.

[0051] Compared with the prior art, the present invention relates to a machine vision inspection system for workpiece defect detection, which relies on the above method and utilizes the collaborative operation control of the workpiece matching module, the point setting module, the comparison and judgment module and the visual inspection module, so as to greatly improve the inspection efficiency and greatly enhance the inspection accuracy, thereby realizing the intelligent and efficient inspection of workpieces.

[0052] Preferably, the system further comprises:

[0053] A security processing module, used for performing security processing on the detection result output by the comparison and judgment module;

[0054] A display module, used to analyze the output of the security processing module and visualize the analysis results;

[0055] in,

[0056] The security processing module communicates with the comparison and judgment module, and the display module communicates with the comparison and judgment module;

[0057] This ensures that the detection information is safe and accurate while guaranteeing the visualization of the processing results. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] Figure 1 This is a flow chart of a machine vision inspection method for workpiece defect inspection in Embodiment 1 of the present invention;

[0059] Figure 2 This is a schematic diagram of a scene of a workpiece to be measured and points in the first embodiment of the present invention;

[0060] Figure 3 This is a flow chart of a machine vision inspection method for workpiece defect inspection in Embodiment 2 of the present invention;

[0061] Figure 4 This is a flow chart of step S1 in Embodiments 1 and 2 of the present invention;

[0062] Figure 5 This is a flow chart of the comparison and judgment strategy in step S43 of embodiments 1 and 2 of the present invention;

[0063] Figure 6 This is a schematic diagram of the structure of a machine vision inspection system for workpiece defect detection in Embodiment 3 of the present invention.

[0064] The numbers in the figure represent: 1. Workpiece to be measured; 2. Point position. DETAILED DESCRIPTION

[0065] The following will use three embodiments and combine with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the present invention.

[0066] Embodiment 1

[0067] like Figure 1 , Figure 2 , Figure 3 and Figure 4 As shown, an embodiment of the present invention provides a machine vision detection method for workpiece defect detection, the method comprising the following steps:

[0068] S1: determining a workpiece to be measured, performing a pre-inspection process on the workpiece to be measured, and obtaining workpiece matching information that matches the workpiece to be measured according to the result of the pre-inspection process;

[0069] As an implementation manner, in this embodiment, the result of the pre-inspection processing obtained in step S1 includes obtaining a pre-inspection position result and a pre-inspection image result corresponding to the workpiece to be measured.

[0070] Place the workpiece to be tested at the initial testing position, and then perform a pre-inspection on the workpiece after placement. Figure 4 is a flow chart of step S1, specifically as follows Figure 4 As shown, step S1 includes the following steps:

[0071] S11, obtaining the position information of the workpiece to be measured and converting it into the form of three-dimensional coordinates, judging whether it exceeds the preset coordinate range, if not, taking the currently obtained three-dimensional coordinate form as the pre-inspection position result corresponding to the workpiece to be measured, and proceeding to the next step; if so, adjusting the placement position of the workpiece to be measured by manipulating the positioning device so that the corresponding three-dimensional coordinates fall within the preset coordinate range, and taking the three-dimensional coordinate form at this time as the pre-inspection position result corresponding to the workpiece to be measured, and proceeding to the next step;

[0072] In this embodiment, the initial detection position where the workpiece to be tested is placed only needs to ensure that there is space around it to accommodate the visual inspection module. In addition, the stability of the placement of the workpiece to be tested also needs to be ensured;

[0073] S12, capturing initial image information corresponding to the workpiece to be measured through the visual inspection module in the initialized state, and determining whether the clarity of the initial image information is not less than the preset clarity range requirement. If so, the initial image information is used as the pre-inspection image result corresponding to the workpiece to be measured, and the next step is entered; if not, the parameters of the visual inspection module are adjusted to achieve a clarity not less than the preset clarity range requirement, and the image corresponding to the workpiece to be measured obtained at this time is used as the pre-inspection image result corresponding to the workpiece to be measured, and the next step is entered;

[0074] S13, according to the pre-inspection image result corresponding to the workpiece to be measured, traverse the workpiece matching database to find out the workpiece matching information that matches the workpiece to be measured, and use it as the workpiece matching information.

[0075] When executing step S1, the position information of the workpiece to be measured is first judged to determine whether its position is within the preset coordinate range. If so, it means that the initial placement position of the workpiece to be measured is correct. If not, the position needs to be adjusted. After the adjustment, it is judged again. If the judgment is passed, step S12 can be entered.

[0076] The image information is then judged to determine whether its clarity meets the requirements; for the above-mentioned image information, it is the image information captured by the visual inspection module at the initial position (that is, the visual inspection module has not been adjusted). If both the position information and the image information meet the requirements, step S13 is entered to perform workpiece matching to obtain the corresponding workpiece matching information.

[0077] As for the workpiece matching database, it is mainly set in the workpiece matching module. The workpiece matching information includes various types of workpiece parameters and workpiece detection information. After the workpiece to be tested is matched with the adapted workpiece information in the workpiece matching database, the corresponding workpiece matching information is obtained. At the same time, the workpiece matching database is also provided with a corresponding data interface to ensure the input of subsequent feature point information.

[0078] The pre-inspection position result and pre-inspection image result in the pre-inspection processing result are the judgment results of S11 and S12 respectively. If the judgment of S11 is passed, that is, the position information is within the preset coordinate range, a first pre-inspection position result will be generated; if the judgment of S11 is not passed, a second pre-inspection position result will be generated. It can be inferred that the second pre-inspection position result can be converted into the first pre-inspection position result after the above-mentioned adjustment of the placement position of the workpiece to be measured.

[0079] Similar to the above-mentioned pre-inspection position result, the pre-inspection image result is the judgment result of S12. If the image information meets the requirements, a first pre-inspection image result is generated. Otherwise, a second pre-inspection image result is generated. Similarly, the second pre-inspection image result can be converted into a first warning image result, that is, after adjusting the parameters of the visual detection module and passing the judgment result of S12, it is converted into the first warning image result.

[0080] S2: determining the original workpiece point information according to the workpiece matching information and adding feature points based on the workpiece to be measured, and generating the final workpiece adjustment point information corresponding to the workpiece to be measured;

[0081] As an implementation manner, in this embodiment, step S2 includes the following steps:

[0082] S21: determining the original workpiece point information, the improved shape characteristics and the change requirement characteristics of the workpiece to be measured from the workpiece matching information, and generating feature point information based on the workpiece to be measured;

[0083] S22: inserting or replacing the original workpiece points according to the feature point information obtained in step S21 to obtain the final adjusted point information of the workpiece.

[0084] The workpiece matching information in this embodiment mainly includes various types of workpiece parameters and workpiece detection information, and the original workpiece point information is a type of workpiece detection information.

[0085] Regarding improved shape features: Even for the same type of workpieces, some temporary improvements are often made to the workpieces for the purpose of process improvement and functional adaptation. For example, for the trial production of cover sheet metal products, local structural improvements will be made; therefore, it is necessary to obtain the inspection information of these locally improved parts, and then conduct focused defect detection on these parts.

[0086] In addition to the improved shape features of the workpiece to be tested, there are also variable demand features, which are features based on temporary human input. For example, relevant R&D personnel need to focus on testing a certain part of the workpiece for safety reasons and pay special attention to whether this part has defects.

[0087] According to the above-mentioned improved shape features and change demand characteristics, several feature points based on the workpiece to be tested are adaptively added to ensure all-round detection.

[0088] Finally, the feature point is inserted or replaced into the original workpiece point. The circumstances under which the insertion and replacement are performed are described in detail here: when the feature point does not overlap with any point of the original workpiece point, and the distance to the adjacent original workpiece point is greater than the preset threshold range, the feature point is selected to be inserted, and the position of the original workpiece point does not change; when the feature point overlaps with any point of the original workpiece point, or the distance to the adjacent original workpiece point is less than or equal to the preset threshold range, the feature point is selected to be replaced, that is, the corresponding point in the original workpiece point is deleted and the feature point is filled.

[0089] Figure 2 The schematic diagram of the scene of the workpiece to be measured and the point in this embodiment is shown, in which the number 1 represents the workpiece to be measured, and the number 2 represents the point. Figure 2 As shown, the points are distributed in all directions of the workpiece to be measured.

[0090] S3: According to the final adjustment point information of the workpiece, the positioning device is controlled to adjust the position of the workpiece to be tested, and the visual inspection module is adjusted to achieve omnidirectional image sampling;

[0091] As an implementation manner, in this embodiment, step S3 includes the following steps:

[0092] S31: controlling the positioning device to adjust the position of the workpiece to be measured according to the first adjustment strategy within a preset coordinate range, wherein the first adjustment strategy is to adjust the position according to the distribution of the final adjustment point information of the workpiece and to minimize the distance change from the position center of the workpiece to each point;

[0093] S32: Use the second adjustment strategy to adjust the position of the visual inspection module, wherein the second adjustment strategy is to adjust the position according to the changes of the inserted points and the replaced points when executing step S22 and according to the principle of minimum change distance.

[0094] In this embodiment, the first adjustment strategy performs position adjustment according to the final adjustment point information of the workpiece, and tries to ensure that the distance from the position center of the adjusted workpiece to each point is equal, that is, the minimum variance of the distance from the position center to each point is used as the standard; the second adjustment strategy mainly needs to follow the principle of minimum distance change based on the comprehensive position changes of the insertion points and the replacement points.

[0095] In this embodiment, the first adjustment strategy may use a corresponding objective function to find the workpiece position when the distance variance from the position center to each point is the smallest.

[0096] S4: Using the visual inspection module adjusted in step S3 to inspect the workpiece to be inspected, forming a feature image based on the same reference object by the acquired image stitching technology, and obtaining the inspection result by comparing and judging the strategy analysis;

[0097] As an implementation manner, in this embodiment, step S4 includes the following steps:

[0098] S41, using the visual inspection module adjusted in step S32 to obtain images of the workpiece to be inspected in various directions;

[0099] S42, using image stitching technology to stitch the collected images obtained in step S41 to form a number of feature images based on the same reference object, and sorting the feature images;

[0100] S43, comparing and judging the feature images according to the sorting order of step S43 by using a comparison and judgment strategy to obtain the final detection result.

[0101] In this embodiment, the visual inspection module is first used to collect images. It is noted that the visual inspection module includes a number of image acquisition devices corresponding to various points of the workpiece to be measured. Therefore, the collected images obtained by the visual inspection module need to be spliced. As for the specific splicing technology, it is an existing technology and will not be elaborated here.

[0102] In this embodiment, the image acquisition device is a high-precision adjustable camera, but is not limited to a camera. Any device that can achieve the same functions as a camera can be used as a replacement, which will not be elaborated here.

[0103] A plurality of characteristic images are formed according to the splicing technology, and then the characteristic images are judged by using a comparison and judgment strategy to obtain the final detection result.

[0104] After executing step S42, that is, after completing the image acquisition and splicing, the feature image can be enhanced. First, the main contour of the feature image is detected and identified using an edge detection algorithm. Specifically, the edge detection algorithm of this embodiment uses a second-order detection algorithm, such as the Laplacian algorithm and the Canny algorithm.

[0105] Subsequently, an image augmentation algorithm is used to enhance the subject contour, and specifically, the Retinex algorithm is used to achieve image enhancement.

[0106] As an implementation method, Figure 5 As shown, the comparison and judgment strategy in step S43 of this embodiment includes the following steps:

[0107] S431: Retrieving a standard feature image converted from a design drawing of the workpiece to be tested, and performing edge detection and local enhancement processing on the standard feature image to generate a standard feature image for comparison;

[0108] S432: Compare the standard feature image with the feature image currently to be compared to determine whether there is a contour deviation. If so, proceed to the next step; if not, proceed to step S434;

[0109] S433: extract the contour deviation part, obtain the contour deviation amount by calculation, and judge whether the contour deviation amount exceeds the standard value calculated by the specified tolerance. If so, it is determined that the feature image currently required to be compared has the contour deviation part that causes the defect, and it is used as the corresponding detection result, and then the next step is executed; if not, it is determined that the feature image currently required to be compared has the contour deviation, but does not have the contour deviation part that causes the defect, and it is used as the corresponding detection result, and then the next step is executed;

[0110] S434: According to the sorting order of step S43, determine whether the feature image currently to be compared is the last one. If so, the comparison ends; if not, take the next feature image to be compared as the feature image currently to be compared, and return to execute step S432.

[0111] First, in this embodiment, the standard feature image is converted from the design drawings of the R&D personnel, and the specific conversion method can be achieved through three-dimensional software; then the standard feature image is processed in the same way as the above features to obtain a standard feature image that can be compared, and then the standard feature image is compared with the feature image to determine whether there is a contour deviation part. If there is a contour deviation part, it is necessary to perform specific calculations on the contour deviation; if there is no contour deviation part, continue to traverse the feature image to continue to confirm whether there is a contour deviation in other parts until all parts of the feature image are traversed; after calculating the specific size of the contour deviation, compare it with the standard value. If it exceeds the standard value, it means that the feature image has a contour deviation part that will cause defects. If it does not exceed the standard value, it means that the feature image has a contour deviation part, but it is not enough to cause defects.

[0112] In summary, the inspection results include the judgment results and the corresponding contour deviation location, size, and whether it will cause defects.

[0113] In summary, for a machine vision detection method for workpiece defect detection in this embodiment, its specific process can be expressed as follows: first, select the corresponding workpiece to be measured, place the workpiece to be measured at the detection position, and then perform pre-inspection processing on the workpiece to be measured. The pre-inspection processing mainly performs initial detection on the position information and image information of the workpiece to be measured, and detects whether the position information of the workpiece to be measured is within the preset coordinate range, and whether the clarity of the approximate image information obtained by the unadjusted visual detection module meets the detection requirements. If both meet the pre-inspection requirements, the matching process of the workpiece to be measured can be performed; the preset point information of the workpiece is verified according to the workpiece matching information, and the corresponding feature points are added to obtain the final adjustment point information of the workpiece, and based on the final adjustment point information of the workpiece, the position of the workpiece to be measured and the visual detection module are adjusted respectively; the workpiece to be measured is detected according to the visual detection module, and the final detection result is determined according to the feature image comparison; the detection method of the present invention utilizes machine vision detection technology, and can flexibly adjust different workpieces to achieve all-round detection without manual assistance, so that the detection efficiency is greatly improved. At the same time, compared with manual defect detection, the accuracy is higher.

[0114] Embodiment 2

[0115] This embodiment further proposes a machine vision inspection method for workpiece defect detection, which, based on the first embodiment, also includes the following steps:

[0116] S5, the detection result obtained in step S4 is sent to the detection terminal after security processing, and the detection result is checked after being analyzed by the detection terminal.

[0117] Since the detection terminal can view the detection results more conveniently, for security reasons, the detection result data needs to be securely processed and then sent to the detection terminal, so that the detection terminal can view it. The method flow chart corresponding to this embodiment is as follows: Figure 3 shown.

[0118] Regarding the safe processing method of the detection results, in this embodiment, the detection results include the judgment results and the corresponding contour deviation position, size and whether it will cause defects. Since the judgment result and whether it will cause defects can be obtained based on the contour deviation position, contour deviation size and contour deviation size, there is no need to send the judgment result and whether it will cause defects; therefore, it is only necessary to safely process the contour deviation position, contour deviation size and contour deviation size and send them to the detection terminal.

[0119] The contour deviation position, contour deviation size and contour deviation size safe handling method include the following processes.

[0120] S51: respectively normalizing the contour deviation position, the contour deviation size, and the contour deviation size; that is, normalizing the contour deviation position, normalizing the contour deviation size, and normalizing the contour deviation size.

[0121] S52: Record the relationship between the data obtained after normalization processing and the original contour deviation position, contour deviation size and contour deviation size; the contour deviation position, contour deviation size and contour deviation size data generated after normalization are all in the range of 0 to 1, and these data are enlarged and transformed so that the contour deviation position, contour deviation size and contour deviation size converted data are in the range of 0 to 255.

[0122] S53: Represent the contour deviation position, contour deviation size and the data after the contour deviation size conversion in the form of coordinates respectively; for example, the first group of contour deviation position, contour deviation size and the data after the contour deviation size conversion is represented as (250, 50, 150), and several groups of contour deviation position, contour deviation size and the data after the contour deviation size conversion are represented respectively.

[0123] S54: Convert the data in coordinate form into digital image as RGB values; a set of contour deviation position, contour deviation size and contour deviation size converted data can be used as corresponding RGB values ​​and filled into a fixed pixel block, and several sets of contour deviation position, contour deviation size and contour deviation size converted data can form several blocks with different RGB values.

[0124] Several blocks with different RGB values ​​are finally combined into an overall large image domain according to the set order, forming a y*y large image domain, where y is the number of rows and columns of the large image domain, and y*y is also the total number of blocks included.

[0125] S55: Data is transmitted through a large image domain until it is transmitted to a detection terminal; the detection terminal can parse the large image domain to obtain a parsing result. Specifically, the detection terminal retrieves the data obtained after normalization processing and the original contour deviation position, contour deviation size, and the relationship between the contour deviation size, and the order in which the blocks are spliced ​​to form an overall large image domain, thereby parsing the original contour deviation position, contour deviation size, and contour deviation size according to a reverse process, and deriving a judgment result and whether a defect will be caused based on these data.

[0126] In this embodiment, the detection terminal may be a mobile phone, a computer, or other mobile readable devices, which are not limited here.

[0127] Embodiment 3

[0128] like Figure 6 As shown, based on the machine vision detection method for workpiece defect detection described in Embodiment 1 or 2, this embodiment further proposes a machine vision detection system for workpiece defect detection, including:

[0129] A positioning device, used for placing the workpiece to be measured and adjusting the position of the workpiece to be measured;

[0130] A visual inspection module is used to obtain images of the workpiece to be inspected in various directions;

[0131] A position detector, used to obtain position information of the workpiece to be measured;

[0132] The pre-inspection module is configured to collect the captured image output by the visual inspection module and the position information of the workpiece to be measured output by the position detector after the workpiece to be measured is placed on the positioning device, find out the workpiece matching information adapted to the workpiece to be measured, and form a pre-inspection result;

[0133] The workpiece matching module is configured to generate workpiece matching information according to the pre-check result output by the pre-check module;

[0134] A point setting module is configured to generate final adjustment point information of the workpiece according to the workpiece matching information output by the workpiece matching module;

[0135] The control module is configured to control the positioning device to adjust the position of the workpiece to be measured according to the final adjustment point information of the workpiece output by the point setting module, and to adjust the position of the visual inspection module to achieve omnidirectional image sampling;

[0136] The comparison and judgment module is configured to collect the acquired images output by the visual inspection module for inspecting the workpiece to be inspected after the control module completes the operation, form a feature image based on the same reference object through the acquired image stitching technology, and finally obtain the inspection result through analysis.

[0137] As an implementation method, this embodiment adopts the following communication connection method:

[0138] The pre-inspection module communicates with the positioning device, the visual inspection module, and the position detector respectively; the workpiece matching module communicates with the pre-inspection module; the point setting module communicates with the workpiece matching module; the control module communicates with the point setting module, the positioning device, and the visual inspection module respectively; and the comparison and judgment module communicates with the control module.

[0139] In this embodiment, the pre-inspection module is provided with a workpiece matching database, so that when the pre-inspection image result corresponding to the workpiece to be measured is obtained, the pre-inspection module can find the workpiece matching information that matches the workpiece to be measured by traversing the workpiece matching database.

[0140] On this basis, it also includes:

[0141] A security processing module, used for performing security processing on the detection results output by the comparison and judgment module;

[0142] A display module is used to analyze the output of the security processing module and visualize the analysis results;

[0143] in,

[0144] The security processing module communicates with the comparison and judgment module, and the display module communicates with the comparison and judgment module.

[0145] Although embodiments of the present invention have been shown and described, it will be apparent to those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A machine vision inspection method for workpiece defect detection, characterized in that: The steps include: S1: determining a workpiece to be measured, performing a pre-inspection process on the workpiece to be measured, and obtaining workpiece matching information that matches the workpiece to be measured according to a result of the pre-inspection process; S2: determining the original workpiece point information according to the workpiece matching information and adding feature points based on the workpiece to be measured, to generate final workpiece adjustment point information corresponding to the workpiece to be measured; S3: controlling the position adjustment device to adjust the position of the workpiece to be tested according to the final adjustment point information of the workpiece, and adjusting the position of the visual inspection module to achieve omnidirectional image sampling; S4: using the visual inspection module adjusted in step S3 to inspect the workpiece to be inspected, forming a feature image based on the same reference object by using the acquired image stitching technology, and obtaining the inspection result by comparing and judging the strategy analysis; S5, sending the test result obtained in step S4 to the test terminal after security processing, and checking the test result after the test terminal analyzes it; The step S1 comprises the following steps: S11, obtaining the position information of the workpiece to be measured and converting it into a three-dimensional coordinate form, judging whether it exceeds a preset coordinate range, if not, taking the currently obtained three-dimensional coordinate form as the pre-inspection position result corresponding to the workpiece to be measured, and proceeding to the next step; If yes, the placement position of the workpiece to be measured is adjusted by manipulating the positioning device so that the corresponding three-dimensional coordinates fall within the preset coordinate range, and the three-dimensional coordinate form at this time is used as the pre-inspection position result corresponding to the workpiece to be measured, and the next step is entered; S12, capturing the initial image information corresponding to the workpiece to be measured through the visual inspection module in the initialization state, and judging whether the clarity of the initial image information is not less than the preset clarity range requirement, if so, taking the initial image information as the pre-inspection image result corresponding to the workpiece to be measured, and proceeding to the next step, if not, adjusting the parameters of the visual inspection module to achieve a clarity not less than the preset clarity range requirement, and taking the image corresponding to the workpiece to be measured obtained at this time as the pre-inspection image result corresponding to the workpiece to be measured, and proceeding to the next step; S13, according to the pre-inspection image result corresponding to the workpiece to be measured, traverse the workpiece matching database to find out the workpiece matching information adapted to the workpiece to be measured, and use it as the workpiece matching information; The step S2 comprises the following steps: S21: determining the original workpiece point information, the improved shape characteristics and the change requirement characteristics of the workpiece to be measured from the workpiece matching information, and generating feature point information based on the workpiece to be measured; S22: inserting or replacing the original workpiece points according to the feature point information obtained in step S21 to obtain the final adjusted point information of the workpiece; The step S3 comprises the following steps: S31: controlling the positioning device to adjust the position of the workpiece to be measured according to a first adjustment strategy within the preset coordinate range, wherein the first adjustment strategy is to adjust the position according to the distribution of the final adjustment point information of the workpiece and to minimize the distance change from the position center of the workpiece to each point; S32: using a second adjustment strategy to adjust the position of the visual inspection module, wherein the second adjustment strategy is to adjust the position according to the change of the inserted points and the replaced points when executing the step S22 and according to the principle of minimum change distance; The step S4 comprises the following steps: S41, using the visual inspection module adjusted in step S32 to acquire images of the workpiece to be inspected in various directions; S42, using image stitching technology to stitch the collected images obtained in step S41 to form a plurality of feature images based on the same reference object, and sorting the feature images; S43, comparing and judging the feature images according to the sorting order of step S42 by using the comparison and judgment strategy to obtain the final detection result.

2. The machine vision inspection method for workpiece defect detection according to claim 1, characterized in that: The result of the pre-check processing obtained in the step S1 includes obtaining a pre-check position result and a pre-check image result corresponding to the workpiece to be measured.

3. The machine vision inspection method for workpiece defect detection according to claim 2, characterized in that: The comparison and judgment strategy in step S43 includes the following steps: S431: Retrieving a standard feature image converted from the design drawing of the workpiece to be tested, and performing edge detection and local enhancement processing on the standard feature image to generate a standard feature image for comparison; S432: Compare the standard feature image with the feature image currently to be compared to determine whether there is a contour deviation. If yes, proceed to the next step; if no, proceed to step S434; S433: extract the contour deviation part, obtain the contour deviation amount by calculation, and judge whether the contour deviation amount exceeds the standard value calculated by the specified tolerance. If so, it is determined that the feature image currently required to be compared has the contour deviation part that causes the defect, and it is used as the corresponding detection result, and then the next step is executed; if not, it is determined that the feature image currently required to be compared has the contour deviation, but does not have the contour deviation part that causes the defect, and it is used as the corresponding detection result, and then the next step is executed; S434: According to the sorting order of step S42, determine whether the feature image currently required to be compared is the last one. If so, the comparison ends; if not, take the next feature image required to be compared as the feature image currently required to be compared, and return to execute step S432.

4. A machine vision inspection system for workpiece defect detection, characterized in that: A machine vision inspection method for workpiece defect inspection according to any one of claims 1 to 3, comprising establishing a communication relationship: A positioning device, used for placing a workpiece to be measured and adjusting the position of the workpiece to be measured; A visual inspection module, used to obtain images of the workpiece to be inspected in various directions; A position detector, used to obtain the position information of the workpiece to be measured; A pre-inspection module is configured to collect the captured image output by the visual inspection module and the position information of the workpiece to be measured output by the position detector after the workpiece to be measured is placed on the positioning device, find out the workpiece matching information adapted to the workpiece to be measured, and form a pre-inspection result; A workpiece matching module, configured to generate workpiece matching information according to the pre-check result output by the pre-check module; A point setting module is configured to generate final adjustment point information of the workpiece according to the workpiece matching information output by the workpiece matching module; A control module is configured to control the position adjustment device to adjust the position of the workpiece to be measured according to the final adjustment point information of the workpiece output by the point setting module, and to adjust the position of the visual inspection module to achieve omnidirectional image sampling; The comparison and judgment module is configured to collect the acquired images output by the visual inspection module when inspecting the workpiece to be inspected after the control module completes the manipulation, form a feature image based on the same reference object through the acquired image stitching technology, and finally obtain the inspection result through analysis.

5. The machine vision inspection system for workpiece defect detection according to claim 4, characterized in that: Also includes: A security processing module, used for performing security processing on the detection result output by the comparison and judgment module; A display module, used to analyze the output of the security processing module and visualize the analysis results; in, The security processing module communicates with the comparison and judgment module, and the display module communicates with the comparison and judgment module.