A multi-station visual inspection processing method
By establishing a unified template size and image correction method in multi-station visual inspection, and combining multiple industrial control computers for data sharing and secondary inspection, the problems of large image data volume and inconsistent inspection results in multi-station visual inspection are solved, achieving efficient and accurate defect detection.
Patent Information
- Application Number
- CN202211536103.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-02
- Publication Date
- 2025-12-02
- Estimated Expiration
- 2042-12-02
AI Technical Summary
In multi-station visual inspection, a single industrial computer cannot handle the computational load of multiple cameras. The large amount of image data leads to low inspection efficiency, and the inspection results between different stations cannot be shared, which easily causes false positives and overlapping defect data, making effective analysis impossible.
By establishing a unified template size, using linear and bilinear interpolation methods to correct image distortion, the images acquired at each workstation are sized uniformly, and comprehensive inspection is performed at the second workstation. Multiple industrial control computers are used for data sharing and secondary judgment to achieve accurate classification and grading of defects.
It enables image data sharing between various workstations, avoids over-detection and false alarms, improves the accuracy of detection results, and reduces costs.
Smart Images

Figure CN115774017B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of appearance inspection methods, and more specifically to a multi-station visual inspection processing method. Background Technology
[0002] For visual inspection of complex products, due to high inspection requirements and numerous defect types, a single camera cannot complete all inspection items. Multi-station visual inspection allows for the setting of different lighting and imaging conditions, complementing each other to jointly complete all product inspection tasks. However, multi-station inspection involves a large number of inspection cameras, and a single industrial computer cannot handle the computational load of all cameras. Furthermore, due to the large volume of image data, to ensure inspection efficiency, multiple industrial computers are used for processing. The inspection images at each of the first inspection stations are independent, and cannot be shared among all hosts, easily leading to over-detection and false alarms between different first stations. Additionally, some defect data overlaps, hindering subsequent centralized data processing and analysis. Moreover, it cannot effectively handle defects requiring simultaneous analysis of images from multiple first stations. Summary of the Invention
[0003] The purpose of this invention is to overcome the above-mentioned defects or problems in the prior art and to provide a multi-station visual inspection processing method.
[0004] To achieve the above objectives, the present invention adopts the following technical solution:
[0005] Option 1, a multi-station visual inspection processing method, including...
[0006] Establish template dimensions based on the dimensional parameters of the surface to be tested of the object;
[0007] At least two different first stations acquire the first image of the surface to be tested, and the size of each first image is unified according to the template size;
[0008] Each first station performs the first detection processing on the first image after the size is unified, and classifies, grades and extracts the defects obtained by detection, and extracts the first information including the classification, grading and location of the corresponding defects;
[0009] Each first workstation will send the extracted first information to the second workstation;
[0010] The second station collects the first information from each first station and performs a second inspection based on the grade, classification, and location of each defect to obtain the final inspection result; the second station and each first station include an industrial control computer.
[0011] Option 2, based on Option 1, establishes template dimensions according to the dimensional parameters of the surface to be measured, including the following steps: For N first stations, accurately calibrate and calculate the lateral pixel resolution P of the camera at each first station.i (i = 1 - N)(mm / pixel); Calculate the average horizontal pixel resolution of all first-station cameras based on their horizontal pixel resolution.
[0012]
[0013] Based on the dimensions W×H (mm) of the test surface in the horizontal and vertical directions of the camera imaging, calculate the average size of the image acquired by the camera: Width×Height, where Width=W / Pavg and Height=H / Pavg, and use it as the template size for all first stations.
[0014] Option 3, based on Option 1, involves each first workstation performing distortion correction on the first image and then unifying the size of each first image according to the template size.
[0015] Option 4, based on Option 3, uses a line scan camera to acquire the first image at each first workstation. Piecewise linear interpolation is used for horizontal correction, and linear interpolation is used for vertical correction according to the calibration plate.
[0016] Option 5, based on Option 4, uses a piecewise linear interpolation method for horizontal correction, including the following steps: N segmentation points are given in the horizontal direction of the first image, and in each interval [u... i ,u i+1 M = u on (i = 1 - N - 1) i+1 -u i Each interpolation point corresponds to a grayscale value g. j Where j = 1 - M, its interpolation function is: S(x) = (xu i+1 ) / (u i -u i+1 )*g j +(xu i ) / (u i+1 -u i )*g j+1 u i <=x<=u i+1 .
[0017] Option 6, based on Option 5, uses bilinear interpolation to unify the size of each first image.
[0018] Option 7, based on Option 1, classifies and grades defects by distinguishing them using feature vectors of the defect image. The feature vectors used for statistics include: area, average gray level, maximum circumscribed circle radius, and first-order and second-order gray-level moment features.
[0019] Option 8, based on Option 1, includes the following methods for the second detection process:
[0020] For defects detected at each first station with a classification higher than a certain threshold, they are identified as NG data, and the classification of the defect is confirmed. For defect classification data with a classification lower than a certain threshold, a second judgment is made based on the defect classification and location, combined with the first information from other first stations, and according to different weight priorities, to finally determine the classification of the defect.
[0021] As can be seen from the above description of the present invention, compared with the prior art, the present invention has the following beneficial effects:
[0022] 1. Option 1: By establishing a unified template size, the first images obtained from each workstation can be of uniform size, which facilitates the identification of the same defect on each first image.
[0023] Each first station performs the first detection processing on the first image after the size is unified, and classifies, grades and extracts the defects obtained by detection, and extracts the first information including the classification, grading and location of the corresponding defects;
[0024] Then, each piece of first information is sent to the second station; the second station collects the first information from each first station and performs a second detection process based on the grade, classification, and location of each defect to obtain the final detection result; each second station and each first station includes an industrial control computer. Each industrial control computer in the first station can handle the computational load of a single first image, while the first information is low-volume data. The industrial control computer in the second station can handle multiple pieces of first information and perform calculations, enabling data sharing among the first stations. Each defect corresponds to a detection result, preventing over-detection and false alarms. Because data sharing is achieved before analysis, the detection results are more accurate, and the cost required to achieve the above is lower than that of a single industrial control computer with high computing power.
[0025] 2. Option Two: Establish template dimensions based on the dimensional parameters of the surface to be measured, including the following steps:
[0026] For N first workstations, accurately calibrate and calculate the lateral pixel resolution P of the camera at each first workstation. i (i = 1 - N)(mm / pixel); Calculate the average horizontal pixel resolution of all first-station cameras based on their horizontal pixel resolution.
[0027]
[0028] Based on the dimensions W×H (mm) of the test surface in the camera's imaging row and column directions, the average image size Width×Height acquired by the camera is calculated, where Width = W / Pavg and Height = H / Pavg. This average size is then used as the template size for each first station to ensure that the first images acquired by each station are of uniform size, facilitating the identification of defect locations. The horizontal pixel resolution is determined by the lens, while the vertical pixel resolution is determined by the external trigger frequency. The horizontal resolution is fixed, while the vertical resolution can be adjusted to accommodate the horizontal pixel resolution. Finally, images with consistent horizontal and vertical resolution will not be distorted, making it more convenient to calibrate the camera's horizontal pixel resolution.
[0029] 3. Option 3: After each first station performs distortion correction on the first image, the size of each first image is unified according to the template size. This prevents the same defect from not corresponding in the different first images due to distortion, which would affect subsequent inspection. After distortion correction, the pixel units of the images have the same scale, which facilitates the unification of the size of each first image in the future.
[0030] 4. Scheme 4: The camera used to acquire the first image at each first station is a line scan camera. Since the horizontal distortion of the line scan camera image is mainly caused by lens distortion, the horizontal correction adopts a piecewise linear interpolation method. The vertical distortion is mainly caused by the nonlinear error of the trigger sampling, so the vertical correction is performed by linear interpolation according to the calibration board.
[0031] 5. Option five, the piecewise linear interpolation method for line direction correction includes the following steps: N segmentation points are given in the line direction of the first image, and in each interval [u... i ,u i+1 M = u on (i = 1 - N - 1) i+1 -u i Each interpolation point corresponds to a grayscale value g. j Where j = 1 - M, its interpolation function is: S(x) = (xu i+1 ) / (u i -u i+1 )*g j +(xu i ) / (u i+1 -u i )*g j+1 u i <=x<=u i+1 This allows for correction.
[0032] 6. Option Six: Use bilinear interpolation to unify the size of each first image, thereby achieving size reduction or enlargement.
[0033] 7. Scheme 7: The classification and grading of defects are distinguished by the feature vectors of the defect images. The vectors used for statistics include: area, average gray level, maximum circumscribed circle radius, first-order and second-order gray-level moment features, thereby realizing the classification and grading of defects.
[0034] 8. Option 8: Defects detected at each first workstation with a classification higher than a certain threshold are identified as NG data, and the classification of the defect is confirmed.
[0035] For defect classification data that is below a certain threshold, a second judgment is made based on the defect classification and location, combined with the first information from other first stations, and according to different weight priorities, to finally determine the classification of the defect. After a second inspection, the final result is output. Each defect corresponds to one inspection result to prevent over-inspection and false alarms. Attached Figure Description
[0036] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments are briefly introduced. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0037] Figure 1 This is a flowchart illustrating the steps of a multi-station visual inspection processing method in this embodiment. Detailed Implementation
[0038] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are preferred embodiments of the present invention and should not be considered as excluding other embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0039] Unless otherwise expressly defined, the use of terms such as "first," "second," or "third" in the claims, description, and accompanying drawings of this invention is for distinguishing different objects and not for describing a specific order.
[0040] Unless otherwise expressly defined, in the claims, description, and accompanying drawings of this invention, the use of directional terms such as "center," "lateral," "longitudinal," "horizontal," "vertical," "top," "bottom," "inner," "outer," "upper," "lower," "front," "rear," "left," "right," "clockwise," and "counterclockwise" to indicate orientation or positional relationships is based on the orientation and positional relationships shown in the accompanying drawings and is only for the convenience of describing the invention and simplifying the description, and is not intended to indicate or imply that the device or element referred to must have a specific orientation or be constructed and operated in a specific orientation, and therefore should not be construed as limiting the specific scope of protection of this invention.
[0041] Unless otherwise expressly defined, the terms "fixed connection" or "fixed connection" used in the claims, description and drawings of this invention should be interpreted broadly to refer to any connection in which there is no displacement or relative rotation relationship between the two parties, including non-removable fixed connection, detachable fixed connection, integral connection and fixed connection by other means or components.
[0042] In the claims, description and accompanying drawings of this invention, the terms "comprising," "having," and variations thereof are used to mean "including but not limited to."
[0043] A multi-station visual inspection processing method includes the following steps:
[0044] The template dimensions are established based on the dimensional parameters of the surface to be measured of the object, specifically including the following steps:
[0045] For N first workstations, accurately calibrate and calculate the lateral pixel resolution P of the camera at each first workstation. i (i = 1 - N)(mm / pixel);
[0046] Calculate the average horizontal pixel resolution of all first-station cameras based on their horizontal pixel resolution.
[0047] Based on the dimensions W×H (mm) of the test object and its surface in the horizontal and vertical directions of the camera image, the average image size Width×Height acquired by the camera is calculated, where Width = W / Pavg and Height = H / Pavg. This average size is then used as the template size for each first station. The horizontal pixel resolution is determined by the lens, while the vertical pixel resolution is determined by the external trigger frequency. The horizontal resolution is fixed, while the vertical resolution can be adjusted to accommodate the horizontal pixel resolution. This ensures consistent horizontal and vertical image quality without distortion, making camera horizontal pixel resolution calibration more convenient.
[0048] At least two different first stations acquire first images of the surface to be tested. Each first station performs distortion correction on the first image and then unifies the size of each first image according to the template size. In this embodiment, different first stations refer to different lighting and imaging conditions, such as different relative positions of the two first stations to the object under test, different light sources, or different relative positions of the light source to the object under test.
[0049] The camera used to acquire the first image at each of the first workstations is a line scan camera. Since the lateral distortion of the line scan camera image is mainly caused by lens distortion, a piecewise linear interpolation method is used for lateral correction, including assuming the camera image width is W. Image Given N segmentation points along the row direction of the first image, [u i ,u i+1 M = u on (i = 1 - N - 1) i+1 -u i Each interpolation point corresponds to a grayscale value g. j Where j = 1 - M, its interpolation function is: S(x) = (xu i+1 ) / (u i -u i+1 )*g j +(xu i ) / (u i+1 -u i )*g j+1 u i <=x<=u i+1 .
[0050] The vertical distortion is mainly caused by the nonlinear error of the triggered sampling. Therefore, the vertical correction is performed using linear interpolation based on the calibration plate. This distortion correction prevents the same defect from being misplaced in different first images due to distortion of the first image, thus affecting subsequent detection.
[0051] Then, after distortion correction, the size of each first image is unified by bilinear interpolation, that is, corrected to the size of the template. The first images of each first station are processed to the same size to facilitate the subsequent synchronization of defect location information.
[0052] The bilinear interpolation method is as follows:
[0053] Suppose we want to obtain the value of an unknown function f at point P = (x, y), and assume we know the values of function f at four points: Q11 = (x1, y1), Q12 = (x1, y2), Q21 = (x2, y1), and Q22 = (x2, y2). In the most common case, f is simply the pixel value of a single pixel. First, we perform linear interpolation in the x-direction to obtain...
[0054]
[0055]
[0056] Then, linear interpolation is performed in the y-direction to obtain...
[0057]
[0058] In summary, this is the final result of bilinear interpolation:
[0059]
[0060] Each first workstation performs a first detection process on the first image after it has been standardized in size, and classifies, grades, and extracts first information from the defects of the object under test. Each first workstation includes an industrial control computer to process and analyze each first image. The classification and grading are mainly based on the feature vectors of the defect images. The vectors used for statistics include: area, average gray level, maximum circumscribed circle radius, first-order and second-order gray-level moment features. Different algorithms are used for different objects under test and different defect classifications, which have been described in the existing technology and will not be elaborated further.
[0061] The first piece of information includes the corresponding defect category name, defect level, and location.
[0062] Then, each first workstation sends the extracted first information to the second workstation. The second workstation includes an industrial control computer to process and analyze the first information. Specifically, the second workstation collects the first information from each first workstation and performs a second inspection based on the grade, classification, and location of each defect to obtain the final inspection result. The specific steps include:
[0063] Defects detected at each first workstation with a classification higher than a certain threshold are identified as NG data, and the defect category is determined accordingly.
[0064] For defect classification data that is below a certain threshold, it indicates that there is a possibility of misjudgment. In this case, it is necessary to make a secondary judgment based on the defect classification and location, combined with the first information of other first workstations, and according to different weight priorities, so as to finally obtain the defect classification.
[0065] In practice, category has the highest priority. There are three categories: NG, RI, and OK, with NG > RI > OK. Within the same category, defects are sorted from highest to lowest grade. Within the same grade, defects are sorted from highest to lowest defect priority. Defects in the same location are merged according to the same-position merging rule to obtain the defect name and grade for that location, which are then used in the above sorting. For example, if 8 (concave / convex) is NG and 10 (dirty) is RI, then the sorting is 8 (concave / convex) > 10 (dirty); if 10 (scratches) is NG, 9 (spots) is NG, and 8 (dirty) is RI, then 10 (scratches) > 9 (spots) > 8 (dirty).
[0066] Merging rules for same rank:
[0067] 1. Category priority is highest: NG > RI > OK;
[0068] 2. Sorting pool 1 consists of defects that satisfy both the defect type and priority station. Sorting pool 2 consists of defects that do not have priority stations or whose defect type does not match the priority station. Sorting pool 1 > Sorting pool 2. Priority station sorting refers to the priority sorting of stations, that is, setting a higher priority for defects detected by a certain station, and each station has a priority for a certain defect.
[0069] 3. Within the same sorting pool, sort by defect level from highest to lowest;
[0070] 4. For products of the same grade, sort them by defect type priority;
[0071] 5. For items of the same grade and type, sort them from workstation 1 to workstation 7.
[0072] 6. For defects in the same position, only the first small image in the output will be displayed. The remaining small images can be hidden or shown.
[0073] Example 1: The same location is detected as concave-convex 5 (station 2) and edge leak 6 (station 5). According to rule 2, both defects are in sorting pool 1. According to rule 3, edge leak 6 > concave-convex 5.
[0074] Example 2: Scratches 6 (station 1), 7 (station 3), 6 (station 7). According to rules 3 and 5, scratches 7 (station 3) > scratches 6 (station 1) > scratches 6 (station 7).
[0075] Example 3: Concave / convex 5 (station 2), scratch 6 (station 1), edge leakage 5 (station 5). According to rules 2 and 3, concave / convex 5 (station 2) > edge leakage 5 (station 5) > scratch 6 (station 1).
[0076] In summary, by establishing a unified template size, the first images acquired by each workstation can be made of the same size, which facilitates the identification of the location of the same defect on each first image.
[0077] Each first station performs the first detection processing on the first image after the size is unified, and classifies, grades and extracts the defects obtained by detection, and extracts the first information including the classification, grading and location of the corresponding defects;
[0078] Then, each piece of first information is sent to the second station; the second station collects the first information from each first station and performs a second detection process based on the grade, classification, and location of each defect to obtain the final detection result; each second station and each first station includes an industrial control computer. Each industrial control computer in the first station can handle the computational load of a single first image, while the first information is low-volume data. The industrial control computer in the second station can handle multiple pieces of first information and perform calculations, enabling data sharing among the first stations. Each defect corresponds to a detection result, preventing over-detection and false alarms. Because data sharing is achieved before analysis, the detection results are more accurate, and the cost required to achieve the above is lower than that of a single industrial control computer with high computing power.
[0079] The foregoing description of the specifications and embodiments is intended to explain the scope of protection of this invention, but does not constitute a limitation on the scope of protection of this invention. Modifications, equivalent substitutions, or other improvements to the embodiments of this invention or a portion thereof that can be obtained by those skilled in the art through logical analysis, reasoning, or limited experimentation, based on the teachings of this invention or the foregoing embodiments, in conjunction with common knowledge, general technical knowledge, and / or existing technology, should all be included within the scope of protection of this invention.
Claims
1. A multi-station visual inspection processing method, characterized in that: include Establish template dimensions based on the dimensional parameters of the surface to be measured of the object; for N first stations, accurately calibrate and calculate the lateral pixel resolution P of the camera at each first station. i (i=1-N)(mm / pixel); Calculate the average horizontal pixel resolution of all first-station cameras based on their horizontal pixel resolution. ; Based on the dimensions W×H (mm) of the test surface in the horizontal and vertical directions of the camera imaging, calculate the average size of the image acquired by the camera: Width×Height, where Width=W / Pavg and Height=H / Pavg, and use it as the template size for all first stations. At least two different first stations acquire the first image of the surface to be tested, and the size of each first image is unified according to the template size; Each first station performs the first detection processing on the first image after the size is unified, and classifies, grades and extracts the defects obtained by detection, and extracts the first information including the classification, grading and location of the corresponding defects; Each first workstation will send the extracted first information to the second workstation; The second station collects the first information from each first station and performs a second inspection based on the grade, classification, and location of each defect to obtain the final inspection result; the second station and each first station include an industrial control computer.
2. The multi-station visual inspection processing method as described in claim 1, characterized in that: Each first workstation performs distortion correction on the first image and then unifies the size of each first image according to the template size.
3. The multi-station visual inspection processing method as described in claim 2, characterized in that: The camera used to acquire the first image at each first station is a line scan camera. Piecewise linear interpolation is used for horizontal correction, and linear interpolation is used for vertical correction based on the calibration plate.
4. The multi-station visual inspection processing method as described in claim 3, characterized in that: The piecewise linear interpolation method used for horizontal correction includes the following steps: N segmentation points are given in the horizontal direction of the first image, and in each interval... [u i , u i+1 M = u on (i = 1 to N-1) i+1 - u i Each interpolation point corresponds to a grayscale value g. j Where j = 1 — M, its interpolation function is: S(x) = (x - u i+1 ) / (u i - u i+1 )*g j + (x- u i ) / (u i+1 - u i )* g j+1 u i <= x <= u i+1 .
5. A multi-station visual inspection processing method as described in any one of claims 1-4, characterized in that: The dimensions of each first image are standardized using bilinear interpolation.
6. The multi-station visual inspection processing method as described in claim 1, characterized in that: Defects are classified and graded by feature vectors of defect images. The feature vectors used for statistics include: area, average gray level, maximum circumscribed circle radius, first-order and second-order gray-level moment features.
7. The multi-station visual inspection processing method as described in claim 1, characterized in that: The second detection process includes the following methods: Defects detected at each first workstation with a classification higher than a certain threshold are identified as NG data, and the classification of the defect is confirmed. For defect classification data that is below a certain threshold, a secondary judgment is made based on the defect classification and location, combined with the first information from other first workstations, and according to different weight priorities, in order to finally determine the classification of the defect.
Citation Information
Patent Citations
Double-sided multi-target equal-interval array visual detection method and detection system
CN112964723A