A method for acquiring a target region of a visual inspection image and a teaching method

By acquiring sensitivity parameters and edge contour point markers through the teaching process, the problems of uneven brightness and low contrast in visual inspection are solved, enabling high-precision acquisition of the glue target area and improving the reliability of the inspection results.

CN115601623BActive Publication Date: 2025-12-09EASY THINKING HANGZHOU TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211375787.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-04
Publication Date
2025-12-09
Estimated Expiration
2042-11-04

AI Technical Summary

Technical Problem

Existing visual inspection technologies suffer from uneven image brightness and low contrast between the adhesive strip and the background due to the numerous image acquisition locations in the adhesive coating process. Existing threshold segmentation methods struggle to accurately capture the target area of ​​the adhesive strip, resulting in low reliability of the detection results.

Method used

Sensitivity parameters are obtained through the teaching process, image edge contour points are manually marked, the minimum bounding rectangle is found and expanded, sensitivity parameters are set, and points in the local area that meet the difference condition are marked as target areas. Coordinate correction and mapping are performed by combining the detection image comparison to obtain the target area.

Benefits of technology

It improves the accuracy of target area acquisition, reduces the requirements for image quality, and can accurately acquire the glue target area even in cases of uneven brightness and low contrast between the glue strip and the background.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115601623B_ABST
    Figure CN115601623B_ABST
Patent Text Reader

Abstract

The application discloses a kind of visual inspection image target area acquisition method and teaching method, which is aimed at the image obtained by visual inspection sensor repeatedly sampling in the same position;First, the following teaching steps are used to obtain sensitivity parameters, 1) image acquisition;2) manually mark the edge profile of the measured target in the image;3) obtain the minimum circumscribed rectangle of the measured target, expand;4) set sensitivity parameters for single area, filter the points that satisfy the difference between current point gray value and the average value of the region ≥ sensitivity parameters × the maximum gray difference value of the same region as target area points;5) compare the results, if it is satisfied, the sensitivity parameters are appropriate, otherwise, repeat step 4);6) complete the teaching after determining the sensitivity parameters of all areas;Secondly, the image to be measured is processed by using the sensitivity parameters, and finally the target area is segmented.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of visual detection, in particular to a target region acquisition method and teaching method of visual detection image. BACKGROUND

[0002] The gluing process is widely used in the industrial manufacturing industry, mainly used to replace the traditional welding process, especially in the field of automobile manufacturing, gluing has the advantages of enhancing the structure of the car, sealing and rust prevention, heat insulation and shock absorption, prolonging the life and improving the performance. The quality of gluing is directly related to the stability, sealing and life of the assembled parts. In order to quickly and accurately realize the quality detection of gluing, visual detection technology is introduced.

[0003] However, as the gluing process is more and more applied in the vehicle body manufacturing process, when using visual detection technology to detect the quality of the adhesive strip, due to the multiple image acquisition positions, the pictures obtained have problems such as uneven brightness and low contrast between the adhesive strip and the background. When using the existing threshold segmentation method (such as OSTU, region growing, fixed threshold binary) to extract the target area of the adhesive strip from the picture, the deviation from the actual adhesive strip is large, and the final detection result has low reliability. SUMMARY

[0004] In order to solve the above technical problems, the present application provides a target region acquisition method and teaching method of visual detection image, which is simple to operate and can accurately obtain the glue target area for pictures with uneven brightness and low contrast between the adhesive strip and the background.

[0005] Therefore, the technical scheme of the present application is as follows:

[0006] A teaching method of a target region acquisition method of visual detection image, the visual detection image being an image obtained by a visual detection sensor detecting the same object at the same image acquisition position, using the same parameter configuration;

[0007] Before testing, the sensitivity parameter is obtained through the following teaching process;

[0008] 1) At a certain detection position, the visual detection sensor obtains an image A of the object to be detected; the image A is a 2D gray image;

[0009] 2) The edges of all measured targets in the image A are manually marked, and the point set composed of the edge contour points of each measured target is recorded as point set B i , i is a natural number, and the value is ≤ the number of measured targets in the image A;

[0010] 3) The minimum circumscribed rectangle of the edge contour points of the point set B i is calculated, and then expanded to obtain the region I i ;

[0011] 4) for a single region I i After setting the sensitivity parameter, the image is segmented into multiple local regions, and then the following operations are performed on each local region:

[0012] ① Calculate the maximum gray scale difference and the average gray scale in the single local region, and record the maximum gray scale difference as C;

[0013] ② Calculate the difference between the current point gray scale value and the average gray scale of the single local region, and record it as D;

[0014] ③ Traverse the single local region, and mark all points that satisfy D≥sensitivity parameter×C as target region points;

[0015] 5) Compare all the target region points marked by the local regions in region I i with the edge profile of the measured target, if the coincidence degree meets the preset condition, the sensitivity parameter of region I i is appropriate and can be used for actual measurement; if it does not meet the preset condition, step 4) is performed again;

[0016] 6) After the sensitivity parameters of all regions I i in image A are determined, the teaching process is completed.

[0017] Further, the D is greater than 5 gray scale differences.

[0018] Further, the visual detection sensor is fixed at a predetermined position;

[0019] Alternatively, the visual detection sensor is installed at the end of the robot, and its relative position to the measured object is fixed at a specific detection position.

[0020] Further, the edge profile points in step 2) are at least 4.

[0021] Further, the expansion in step 3) is to increase the width and height of the rectangle according to a preset value without changing the center of the minimum circumscribed rectangle.

[0022] Further, the local region in step 4) is a square, and its side length is 0.2-1 times the smaller value of the width or height of region I i .

[0023] Further, the sensitivity parameter has a value range of 0-1.

[0024] A method for acquiring a target region of a visual detection image, comprising the following steps:

[0025] S1, according to the teaching method as described above, acquire the sensitivity parameters of all regions I i in image A;

[0026] S2, based on the acquisition condition of image A, using a visual sensor to detect the same object in the same image acquisition pose, using the same parameter configuration, and acquiring a detection image;

[0027] S3, comparing the detection image with the image A obtained in the teaching process to obtain the position deviation of the detection image compared with image A, and then correcting the coordinates of the point set B i and mapping it to the detection image;

[0028] S4, finding the minimum circumscribed rectangle of the edge contour points of the corrected point set B i , and then expanding it to obtain the region I i ;

[0029] S5, setting the sensitivity parameter value according to the sensitivity parameter of the single region I i determined in the teaching process; dividing the region I i into multiple local regions, and marking the points in each local region that satisfy the difference I≥sensitivity parameter×difference II as target region points;

[0030] wherein the difference I is the difference between the gray value of the current point and the gray mean value of the local region in which the current point is located;

[0031] Difference II is the maximum gray difference of the local region in which the current point is located;

[0032] S6, traversing the detection image to mark all target region points in the region I i .

[0033] The target region acquisition method and the teaching method for visual detection image provided by the application are simple to operate, have low requirements for the contrast of the target region to be acquired and the background in the image to be detected and the uniformity of the image, and have higher accuracy in acquiring the target region compared with the existing threshold segmentation method. The target region of glue can be accurately acquired even for images with uneven brightness and low contrast between the glue strip and the background, thereby reducing the requirement for the quality of the image. BRIEF DESCRIPTION OF DRAWINGS

[0034] Figure 1a is a to-be-processed image;

[0035] Figure 1b is a glue strip extraction effect diagram obtained by processing Fig. 1 using the method of the application;

[0036] Figure 1c is a glue strip extraction effect diagram obtained by processing Fig. 1 using the OSTU method;

[0037] Figure 1d is a glue strip extraction effect diagram obtained by processing Fig. 1 using the region growing method;

[0038] Figure 2a A second image to be processed;

[0039] Figure 2b A rubber strip extraction effect diagram obtained after processing of Fig. 2 by using the method of the present application;

[0040] Figure 2c A rubber strip extraction effect diagram obtained after processing of Fig. 2 by using the OSTU method;

[0041] Figure 2d A rubber strip extraction effect diagram obtained after processing of Fig. 2 by using the region growing method;

[0042] Figure 3a A third image to be processed;

[0043] Figure 3b A rubber strip extraction effect diagram obtained after processing of Fig. 3 by using the method of the present application;

[0044] Figure 3c A rubber strip extraction effect diagram obtained after processing of Fig. 3 by using the OSTU method;

[0045] Figure 3d A rubber strip extraction effect diagram obtained after processing of Fig. 3 by using the region growing method; DETAILED DESCRIPTION

[0046] The technical solutions of the present application will be described in detail below in combination with the drawings and specific embodiments.

[0047] A teaching method of a target region acquisition method of a visual detection image, the visual detection image being an image 1a acquired by a visual detection sensor at a same image capturing pose, using a same parameter configuration, and detecting a same object to be measured;

[0048] In actual testing, the visual sensor can be fixedly installed at a fixed position or installed at the end of a robot, so as to ensure that the relative position between the visual sensor and the object to be measured is fixed at a specific detection position;

[0049] Before testing, the sensitivity parameter is acquired through the following teaching process;

[0050] 1) At a certain detection position, the visual detection sensor acquires an image A of the object to be measured; the image A is a 2D gray image;

[0051] 2) The edge profile of all measured targets in the image A is manually marked, and a point set B composed of edge profile points of each measured target is recorded i , i is a natural number, and the value is ≤ the number of measured targets in the image A; in order to ensure the calculation result, i≥4;

[0052] 3) Respectively, the minimum circumscribed rectangle of the edge contour points of point set B i is calculated, and then the rectangle is expanded to obtain region I i ; Specifically, the expansion is to increase the width and height of the rectangle by a preset value without changing the center of the minimum circumscribed rectangle;

[0053] 4) The sensitivity parameter of a single region I i is set, and the value range is 0-1, and then the region I i is divided into multiple local regions, and then the single local region is operated as follows: In the specific operation, in order to facilitate calculation, the local region can be set as a square, and the side length is 0.2-1 times the smaller value of the width or height of the region I i ;

[0054] ① The maximum gray scale difference and the gray scale average in the single local region are calculated, and the maximum gray scale difference is denoted as C;

[0055] ② The difference between the gray scale value of the current point and the gray scale average of the single local region is calculated, and is denoted as D; In order to ensure the test quality, D should be greater than 5 gray scale differences;

[0056] ③ All points in the single local region that satisfy D≥sensitivity parameter×C are marked as target region points;

[0057] 5) The target region points marked by all local regions in the region I i are compared with the edge contour of the measured target, and if the coincidence degree meets the preset condition, the sensitivity parameter of the region I i is suitable and can be used for actual measurement; If the preset condition is not met, step 4) is performed again;

[0058] 6) After the sensitivity parameters of all regions I i of the image A are determined, the teaching process is completed.

[0059] A target region acquisition method for visual detection image, comprising the following steps:

[0060] S1, according to the teaching method, the sensitivity parameters of all regions I i of the image A are obtained;

[0061] S2, based on the acquisition conditions of the image A, the detection image is obtained by using the visual sensor to detect the same object under the same pose, using the same parameter configuration;

[0062] S3, the detection image is compared with the image A obtained in the teaching process to obtain the position deviation of the detection image compared with the image A, and then the coordinates of each point in the point set B i are corrected, and then the point set B i is mapped to the detection image;

[0063] S4, finding the minimum circumscribed rectangle of the edge contour points of the modified point set B i , and expanding the minimum circumscribed rectangle to obtain region I i ;

[0064] S5, setting the sensitivity parameter value according to the sensitivity parameter of the single region I i determined in the teaching process; dividing the region I i into a plurality of local regions, and marking the points in each local region that satisfy the difference I >= sensitivity parameter * difference II as target region points;

[0065] wherein the difference I is the difference between the gray value of the current point and the average gray value of the local region in which the current point is located;

[0066] the difference II is the maximum gray difference of the local region in which the current point is located;

[0067] S6, traversing the detection image to mark the target region points in all regions I i .

[0068] The following uses the method provided by the present application, the OSTU (Otsu method) and the region growing method respectively to process the pictures obtained under different scenarios, to obtain the LASD glue strip region, Figure 1a in which the glue part is not uniformly illuminated, Figure 2a in which the glue is reflective and the contrast between the glue and the background is weak, Figure 3a in which the contrast between the glue and the background is weak; Figure 1b the processing results obtained when the sensitivity parameter is 0.4, it can be seen that the method provided by the present application can adapt to the case of uneven illumination and can accurately obtain the glue region; the Otsu method Figure 1c , the background of which contains many dark regions, has poor detection effect; the region growing method Figure 1d , which fails to correctly obtain the glue in the bright region, has poor detection effect. For Figure 2a , the method provided by the present application takes the sensitivity parameter as 0.5 to obtain Figure 2b , it can be seen that the glue strip region can be clearly distinguished from the background, while Figure 2c the background containing many dark regions, Figure 2d although it can obtain the glue in most regions, still cannot obtain the glue in the region with strong reflection. For Figure 3a , the method provided by the present application takes the sensitivity parameter as 0.6 to obtain Figure 3b , except that the local background and the glue cannot be clearly distinguished, the segmentation effect of other regions is relatively clear; while Figure 3c the background containing many dark regions in Figure 3dThe detection effect of 3c can obtain the region of glue, contains more noise, the detection effect is normal, and it is better than 3b but worse than 3c.

[0069] The foregoing description of specific exemplary embodiments of the application is presented for the purpose of illustration and description. It is not intended to be a limitation on the application as it is apparent that many modifications and variations to the described embodiments are possible in light of this teaching. The exemplary embodiments were chosen and described in order to explain the principles of the application and its practical application to thereby enable others skilled in the art to implement and utilize various exemplary embodiments of the present application, as well as various alternatives and modifications thereof. It is intended that the scope of the application be defined solely by the appended claims and their equivalents.

Claims

1. A teaching method for acquiring a target region of a visual inspection image, the visual inspection image being an image acquired by a visual inspection sensor in the same image acquisition pose, using the same parameter configuration, and detecting the same object to be detected; characterized in that Before testing, the sensitivity parameter is acquired through the following teaching process; 1) At a certain detection position, the visual inspection sensor acquires an image A of the object to be detected; 2) manually marking the edge contour of all the measured targets in image A, and recording the point set composed of the edge contour points of each measured target as point set B i , i is a natural number, and the value is ≤ the number of measured targets in image A; 3) find the minimum circumscribed rectangle for the edge contour points of point set B i , and then expand it to get region I i ; 4) for each individual region I i The sensitivity parameter is set, the image is divided into a plurality of local regions, and then the following operations are performed on each individual local region: ① Calculate the maximum gray difference value and the gray mean value in a single local region, and denote the maximum gray difference value as C; ② Calculate the difference between the gray value of the current point and the gray mean value of the single local region, and denote it as D; ③ Traverse the single local region, and mark all points satisfying D≥sensitivity parameter×C as points in the target region; 5) compare the points in the target area marked by all the local areas in region I i with the edge profile of the measured target, if the coincidence degree meets the preset condition, the sensitivity parameter of region I i is appropriate and can be used for actual measurement; if the preset condition is not met, step 4) is performed again. 6) All regions I of image A i After the sensitivity parameters of all regions I of image A are determined, the teaching process is completed.

2. The method of claim 1, wherein: The D is greater than 5 gray differences.

3. The method of claim 1, wherein: The visual inspection sensor is fixed at a predetermined position; Alternatively, the visual inspection sensor is mounted at the end of a robot, and the relative position between the visual inspection sensor and the object to be detected is fixed at a specific detection position.

4. The method of claim 1, wherein: The edge contour points in step 2) are at least 4.

5. The method of claim 1, wherein: The expansion in step 3) is to increase the width and height of the rectangle according to a preset value without changing the center of the minimum circumscribed rectangle.

6. The method of claim 1, wherein: The local area in step 4) is a square with a side length of 0.2 to 1 times the smaller of the width value or height value of the area I i .

7. The method of claim 1, wherein: The value range of the sensitivity parameter is 0-1.

8. A method for acquiring a target region of a visual inspection image, characterized by The method comprises the following steps: S1. According to the teaching method of any one of claims 1-7, acquiring the sensitivity parameter of all regions I of image A i . S2, based on the acquisition condition of the image A, using the visual sensor to acquire a detection image in the same image acquisition pose, using the same parameter configuration, and detecting the same object to be detected; S3, compare the detection image with the picture A acquired in the teaching process, acquire the position deviation of the detection image compared with the picture A, and then correct the coordinates of each point in the point set B i and map them to the detection image; S4. For the corrected point set B i Find the minimum bounding rectangle of the edge contour points, and then expand it to obtain region I. i ; S5, setting a sensitivity parameter value according to the determined single region I i sensitivity parameter; dividing the region I i into a plurality of local regions, and marking points in each local region that satisfy the difference I ≥ the sensitivity parameter × the difference II as target region points; Wherein, the difference I is the difference between the gray value of the current point and the gray mean value of the local region where it is located; and the difference II is the maximum gray difference value of the local region where the current point is located; S6, traverse the detection image, mark all region I i target region points within.

Citation Information

Patent Citations

  • Screening method of adhesive tape edge points

    CN114120051A

  • Method and apparatus for filling grooves on basis of controlling moving speed of robot

    WO2022222513A1