A method for detecting rubber ring breakage

Through mask processing and normalized correlation matching algorithm, combined with the rotation counting technology of edge binary graph, the problem of difficulty in extracting edge information in rubber ring break detection is solved, and the accurate and efficient detection of rubber ring break is achieved, improving the improvement of rubber ring break Production efficiency and detection accuracy are achieved.

CN119151950BActive Publication Date: 2025-01-10SHENZHEN RUIYANG JINGSHI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411661721.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-20
Publication Date
2025-01-10
Estimated Expiration
2044-11-20

AI Technical Summary

Technical Problem

It is difficult for the prior art to realize efficient detection of rubber breakage in rubber rings, especially when the rubber rings are similar to the background color and the position is not fixed, traditional algorithms cannot effectively extract edge information, resulting in low detection efficiency and insufficient accuracy.

Method used

The template image is processed using mask to reduce background color interference, and the image to be tested is matched with the template image through normalized correlation matching algorithm to realize alignment and mask processing, and the pixel points are counted at a unit angle on the edge binary map, and the pixels are passed through the pixels. Comparing the number of points to the threshold value determines the unit of the rubber determination, and counts the number of continuous rubber breaks to determine the position of the rubber breaks.

Benefits of technology

It realizes accurate and efficient detection of rubber rings and rubber breakage, improves detection accuracy and efficiency, reduces manual overhead, and is suitable for machine inspection of rubber rings and rubber breakage in automated production process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119151950B_ABST
    Figure CN119151950B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for detecting rubber ring breakage, comprising the following steps: A method for detecting rubber ring breakage, comprising the following steps: S1, collecting a template image; S2, selecting a template matching area; S3, forming a mask image of the template image; S4, collecting an image to be tested; S5, image matching and alignment; S6, forming an edge binary image; S7, unit angle rotation counting; S8, rubber breakage determination within a unit angle; S9, rubber breakage defect location determination; S10, rubber breakage defect location marking. The present invention uses a mask to process the template image to reduce background color interference, and then matches the image to be tested with the template image through a normalized correlation matching algorithm; after obtaining an edge binary image of the rubber ring of the image to be tested through image binarization processing, the corresponding rubber ring end within a unit angle on the edge binary image is counted for pixel count to determine the rubber breakage position, thereby achieving accurate and efficient detection of the rubber breakage location.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of algorithms, and in particular to a method for detecting rubber ring breakage. Background Art

[0002] A production process that is often involved in the industrial production process is gluing, that is, covering the glue layer at a specific position by dispensing or coating to facilitate the subsequent adhesion and assembly of different parts. In order to ensure the quality of product assembly, it is necessary to strictly control the quality of gluing, such as the dimensional accuracy of gluing and whether there is glue breakage. In the gluing detection process, glue breakage detection is the most critical link, which directly affects the effect of gluing and subsequent bonding, and plays a vital role in subsequent product production. When the rubber ring is inspected by the naked eye, it is easy to miss the inspection due to sensory fatigue, and the inspection efficiency is also relatively low.

[0003] Automatic detection of rubber ring breakage has a significant effect on reducing labor costs and improving gluing production efficiency for corresponding manufacturers. When designing a rubber ring breakage detection algorithm, since the rubber ring and the background are both black, the contrast is small and cannot be directly extracted through the algorithm. In addition, since the position of the rubber ring is not completely fixed and there are interferences such as metal strips around it, it is also difficult to use a gradient algorithm to extract complete edge information. Therefore, the use of traditional morphological detection or edge detection algorithms cannot achieve rubber ring extraction and detection. In view of this, designing a rubber ring breakage detection method has a good effect on improving detection accuracy and improving gluing quality. Summary of the invention

[0004] The technical problem to be solved by the present invention is to address the deficiencies of the above-mentioned prior art and provide a method for using a mask to process a template image to reduce background color interference, and then matching the image to be tested with the template image through a normalized correlation matching algorithm to simultaneously achieve alignment and mask processing of the image to be tested; after obtaining an edge binary map of the rubber ring of the image to be tested through image binarization processing, a starting line is selected on the edge binary map, with the center of the rubber ring as the center and a unit angle as each rotation angle, and the rubber ring ends corresponding to the unit angle are rotated 360°, and the pixel points of the rubber ring ends corresponding to the unit angle are counted during each rotation process, and the rubber break unit is determined by comparing the number of pixel points with the pixel threshold, and the number of continuous rubber break units is counted and compared with the rubber break threshold to determine the rubber break position, thereby realizing a rubber ring break detection method that can accurately and efficiently detect the broken part.

[0005] The technical solution adopted by the present invention is as follows: A method for detecting rubber ring breakage, comprising the following steps:

[0006] S1. Acquiring a template image: capturing a template image with a complete rubber ring by using a CCD camera;

[0007] S2, selecting a template matching area: selecting a template matching area including an image of a position corresponding to the rubber ring in the template image in step S1;

[0008] S3, forming a mask image of the template image: converting the template matching area image selected in step S2 into a mask image of the template rubber ring;

[0009] S4, collecting the image to be tested: capturing the image to be tested including the rubber ring by using a CCD camera;

[0010] S5, image matching and alignment: performing template matching on the image to be tested in step S4 and the mask image of the template rubber ring in step S3, finding the actual position of the rubber ring to be tested in the mask image area of ​​the template rubber ring, and obtaining the rubber ring mask image of the image to be tested;

[0011] S6, forming an edge binary image: performing image binarization calculation processing in the rubber ring mask image of the image to be tested after matching in step S5, to obtain an edge binary image of the rubber ring;

[0012] S7, unit angle rotation counting: in the circular rubber ring corresponding to the edge binary image obtained in step S6, 360° angle is equally divided into unit angles; and the center of the circular rubber ring is used as the rotation center, the radial extension line is used as the starting point, and the unit angle is used as the rotation angle for each time, and the pixel points of the corresponding rubber ring segment within each unit angle are counted;

[0013] S8, determination of adhesive breakage within a unit angle: after calculating the pixel points corresponding to the adhesive ring segment of each unit angle one by one in step S7, the number of pixel points within each unit angle is compared with the pixel threshold, and the adhesive ring segment corresponding to the unit angle less than the pixel threshold is determined as the adhesive breakage unit;

[0014] S9, determination of adhesive break defective parts: after calculating and determining the rubber ring segments corresponding to all unit angles in step S8, extract the rubber ring segments where adhesive break units appear continuously, and calculate the number of continuous rubber ring segments, and compare the number with the adhesive break threshold. When the number is greater than or equal to the adhesive break threshold, determine that the continuous rubber ring segment is an adhesive break defective part;

[0015] S12, marking the adhesive break defective part: marking the position where the adhesive break defective part determined in step S9 is located at the actual position of the adhesive ring in the image to be tested in step S4.

[0016] Preferably, the template matching area is selected in step S2 and / or the test matching area is selected in step S5 by using Qupath software to frame the template matching area and / or the test matching area on the template image and / or the image to be tested respectively; the Qupath software is open source software for biological image analysis.

[0017] Preferably, in the image matching and alignment process of step S5, the mask image of the template image is continuously slid on the image to be tested in the vertical and horizontal directions using the normalized correlation matching method formula, and the coordinate points of the mask image of the template image and the pixel points of the image to be tested are matched during the sliding process, and the matching degree R (x, y) of the coordinate points is calculated, and then the matching degree of the whole image is obtained by summing the normalized correlation matching method formula, and whether the two images are aligned is determined according to the matching degree of the whole image. If not, continue sliding until the two images are aligned; the normalized correlation matching method formula is: ;

[0018] Where R(x,y) is the matching degree of the mask image of the template image at the coordinates (x,y) of the image to be tested; T(x , ,y , ) is the template image at (x , ,y , ), I(x+x , ,y+y , ) is the graph to be matched at point (x+x , ,y+y , ) is the gray value at .

[0019] Preferably, the maximum value of the matching degree R(x, y) calculated in step S5 is 1, and the larger the R(x, y), the higher the overlap between the image to be tested and the mask image of the template image at the coordinate (x, y); when T(x , ,y , ) = 1, I (x + x , ,y+y , ) = 1, R(x,y) = 1, and the two images are aligned at this coordinate; when T(x , ,y , ) = 1, I (x + x , ,y+y , ) = 255, there is an offset between the two images at this coordinate.

[0020] Preferably, after the image matching and alignment in step S5, the rubber ring position of the image to be tested is aligned with the rubber ring position on the mask image of the template image, that is, the coordinate points corresponding to the rubber rings of the two overlap, thereby obtaining the mask image of the image to be tested.

[0021] Preferably, in step S6, image binarization calculation is performed on the rubber ring position of the mask image of the image to be tested after matching and alignment, and the pixel points included in the rubber ring of the mask image of the image to be tested are binarized; the binarization formula is: ;

[0022] Wherein, the P (x, y) is the gray value corresponding to the pixel point, and T is the gray threshold.

[0023] Preferably, the binarization calculation in step S6 is to take the grayscale values ​​of the pixels included in the rubber ring of the mask image of the image to be tested one by one, and then compare the grayscale value corresponding to the pixel with the grayscale threshold T. When the grayscale value is greater than the threshold T, the binarization value corresponding to the pixel is taken as 255, and when the grayscale value is less than or equal to the threshold T, the binarization value corresponding to the pixel is taken as 0.

[0024] Preferably, the grayscale threshold value is determined according to the background base color of the image to be tested; and the threshold T is 100.

[0025] Preferably, the unit angle in step S7 is 0.2°, and during the counting process, the pixel points are counted on the rubber ring segment corresponding to the angle every time the angle is rotated by 0.2°; the glue breaking threshold is 20, and when the number of pixel points counted on the rubber ring segment corresponding to 0.2° is less than 20, it is determined to be a glue breaking unit.

[0026] Preferably, after determining the glue breaking unit in step S7, the number of continuous glue breaking locations is matched with the glue breaking threshold, and the glue breaking threshold is 3. When the number of continuous glue breaking locations is greater than or equal to 3, the continuous glue breaking locations are determined to be glue breaking defect locations.

[0027] The beneficial effects of the present invention are:

[0028] In view of the defects and shortcomings of the prior art, the present invention independently develops and designs a method of using a mask to process a template image to reduce background color interference, and then matching the image to be tested with the template image through a normalized correlation matching algorithm to simultaneously achieve alignment and mask processing of the image to be tested; after obtaining an edge binary map of the rubber ring of the image to be tested through image binarization processing, a starting line is selected on the edge binary map, and the rubber ring center is used as the center and the unit angle is used as the rotation angle each time, and the rubber ring end corresponding to the unit angle is rotated 360°, and the pixel points of the rubber ring end corresponding to the unit angle are counted during each rotation process, and the rubber break unit is determined by comparing the number of pixel points with the pixel threshold, and the rubber break position is determined after the number of continuous rubber break units is counted and compared with the rubber break threshold, thereby realizing a rubber ring break detection method that can accurately and efficiently detect the rubber break position.

[0029] The present invention aims to provide a machine detection method for realizing rubber ring breakage in an automated production process, which is applied to the field of gluing production. Through this method, the detection of broken glue parts can be automated, and the detection accuracy and efficiency can be improved. The technical solution of the present invention has a significant effect on reducing labor expenses and improving gluing production efficiency for production enterprises. Specifically, the present invention first captures a template image by shooting, selects an area containing a rubber ring on the template image as a template matching area, and then performs mask processing on the template matching area to remove the image background color or the influence of other materials around the rubber ring, so as to form a mask image with a black background and a white rubber ring; since both the mask image and the captured image to be tested can be represented by pixel coordinates, a normalized correlation matching method is used to move the mask image of the template image on the image to be tested in units of pixels along the horizontal and vertical directions one pixel at a time, and calculates the matching degree of the two images each time the movement is performed, and this cycle is repeated until the matching degrees corresponding to all moving points are calculated. The greater the matching degree, the closer the grayscale values ​​of the two images are. Therefore, the position corresponding to the value with the largest matching degree is taken as the superimposed position of the image to be tested and the template image, thereby realizing the position alignment of the image to be tested. In the subsequent calculation process, the position of the rubber ring on the image to be tested can be represented by the position of the rubber ring on the mask image of the template image (the coordinates of the positions of the rubber rings of the two are consistent), that is, the mask image of the rubber ring of the image to be tested (the pixel coordinate position of the rubber ring) is obtained. ; Then, perform image binarization processing in the rubber ring mask image to convert the rubber ring image into an edge binary image. The binary edge binary image only includes pixels of two grayscales, 0 and 255, so as to facilitate the subsequent counting of the number of pixels according to the grayscale value; after the rubber ring image of the image to be tested forms an edge binary image, take a starting line as the counting starting point (such as taking a horizontal right-pointing straight line on the image as the starting point) with the center of the rubber ring as the center, and rotate 360° clockwise or counterclockwise with a unit angle as each rotation angle, until it rotates around the rubber ring from the starting line for one circle, and During each rotation process, the rubber ring segments corresponding to the unit angle are counted, and after counting the number of pixel points within the unit angle, it is determined whether the rubber ring segment where the unit angle is located is a broken glue unit by matching it with the pixel threshold; after determining whether the rubber ring segments corresponding to all unit angles are broken glue, the number of broken glue units with continuous broken glue is counted, and the number of continuous broken glue is compared and matched with the broken glue threshold. When the number of continuous broken glue is greater than or equal to the broken glue threshold, it is determined that there is broken glue at the continuous broken glue position, and it is marked in the physical image of the image to be tested to complete the overall broken glue detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 It is a block diagram of the detection principle of the present invention.

[0031] Figure 2 This is a schematic diagram of a template image captured and photographed according to the present invention.

[0032] Figure 3 It is the mask image of the template image of the present invention.

[0033] Figure 4 This is a schematic diagram of an image to be tested captured and photographed by the present invention.

[0034] Figure 5 It is the edge binary image of the image to be tested of the present invention.

[0035] Figure 6 It is a schematic diagram of the rotation counting in the edge binary image of the image to be tested according to the present invention.

[0036] Figure 7 It is a schematic diagram of marking the glue breaking position in the image position to be tested according to the present invention. DETAILED DESCRIPTION

[0037] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0038] It should be noted that all directional indications such as up, down, left, right, front, back, etc. in the embodiments of the present invention are only used to explain the relative position relationship, movement status, etc. between the components in a certain specific posture. If the specific posture changes, the directional indication will also change accordingly.

[0039] In the present invention, unless otherwise clearly specified and limited, the terms "connection", "fixation", etc. should be understood in a broad sense. For example, "connection" can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements, unless otherwise clearly defined. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0040] like Figures 1 to 4 As shown, a method for detecting rubber ring breakage includes the following steps:

[0041] S1. Acquiring a template image: capturing a template image with a complete rubber ring by using a CCD camera;

[0042] S2, selecting a template matching area: selecting a template matching area including an image of a position corresponding to the rubber ring in the template image in step S1;

[0043] S3, forming a mask image of the template image: converting the template matching area image selected in step S2 into a mask image of the template rubber ring;

[0044] S4, collecting the image to be tested: capturing the image to be tested including the rubber ring by using a CCD camera;

[0045] S5, image matching and alignment: performing template matching on the image to be tested in step S4 and the mask image of the template rubber ring in step S3, finding the actual position of the rubber ring to be tested in the mask image area of ​​the template rubber ring, and obtaining the rubber ring mask image of the image to be tested;

[0046] S6, forming an edge binary image: performing image binarization calculation processing in the rubber ring mask image of the image to be tested after matching in step S5, to obtain an edge binary image of the rubber ring;

[0047] S7, unit angle rotation counting: in the circular rubber ring corresponding to the edge binary image obtained in step S6, 360° angle is equally divided into unit angles; and the center of the circular rubber ring is used as the rotation center, the radial extension line is used as the starting point, and the unit angle is used as the rotation angle for each time, and the pixel points of the corresponding rubber ring segment within each unit angle are counted;

[0048] S8, determination of adhesive breakage within a unit angle: after calculating the pixel points corresponding to the adhesive ring segment of each unit angle one by one in step S7, the number of pixel points within each unit angle is compared with the pixel threshold, and the adhesive ring segment corresponding to the unit angle less than the pixel threshold is determined as the adhesive breakage unit;

[0049] S9, determination of adhesive break defective parts: after calculating and determining the rubber ring segments corresponding to all unit angles in step S8, extract the rubber ring segments where adhesive break units appear continuously, and calculate the number of continuous rubber ring segments, and compare the number with the adhesive break threshold. When the number is greater than or equal to the adhesive break threshold, determine that the continuous rubber ring segment is an adhesive break defective part;

[0050] S12, marking the adhesive break defective part: marking the position where the adhesive break defective part determined in step S9 is located at the actual position of the adhesive ring in the image to be tested in step S4.

[0051] Step S2 selects the template matching area and / or step S5 selects the test matching area. The template matching area and / or the test matching area are framed on the template image and / or the image to be tested using Qupath software, respectively; the Qupath software is open source software for biological image analysis.

[0052] The present invention discloses a method for detecting the breakage of a rubber ring, which uses a normalized correlation matching algorithm to match the image to be tested with the template image after masking the template image to reduce background color interference; after obtaining the edge binary map of the rubber ring of the image to be tested by image binarization, a starting line is selected on the edge binary map, and the rubber ring center is used as the center and the unit angle is used as the rotation angle for each rotation, and the pixel points of the corresponding rubber ring end within the unit angle are counted during each rotation process; after the breakage unit is determined by comparing the number of pixels with the pixel threshold, the breakage position is determined after the number of continuous breakage units is compared with the breakage threshold, and the breakage position is determined, so as to realize the accurate and efficient detection of the breakage position of the rubber ring. The present invention aims to provide a machine detection method for realizing the breakage of the rubber ring in the automated production process, which is applied to the field of glue production, and the method realizes the automation of the detection of the breakage position, and realizes the improvement of the detection accuracy and efficiency; the technical scheme of the present invention has a significant effect on reducing labor costs and improving the glue production efficiency for production enterprises.Specifically, the present invention first captures a template image by shooting, selects an area containing a rubber ring on the template image as a template matching area, and then performs mask processing on the template matching area to remove the image background color or the influence of other materials around the rubber ring, so as to form a mask image with a black background and a white rubber ring; since both the mask image and the captured image to be tested can be represented by pixel coordinates, a normalized correlation matching method is used to move the mask image of the template image on the image to be tested in units of pixels along the horizontal and vertical directions one pixel at a time, and calculates the matching degree of the two images each time the movement is performed, and this cycle is repeated until the matching degrees corresponding to all moving points are calculated. The greater the matching degree, the closer the grayscale values ​​of the two images are. Therefore, the position corresponding to the value with the largest matching degree is taken as the superimposed position of the image to be tested and the template image, thereby realizing the position alignment of the image to be tested. In the subsequent calculation process, the position of the rubber ring on the image to be tested can be represented by the position of the rubber ring on the mask image of the template image (the coordinates of the positions of the rubber rings of the two are consistent), that is, the mask image of the rubber ring of the image to be tested (the pixel coordinate position of the rubber ring) is obtained. ; Then, perform image binarization processing in the rubber ring mask image to convert the rubber ring image into an edge binary image. The binary edge binary image only includes pixels of two grayscales, 0 and 255, so as to facilitate the subsequent counting of the number of pixels according to the grayscale value; after the rubber ring image of the image to be tested forms an edge binary image, take a starting line as the counting starting point (such as taking a horizontal right-pointing straight line on the image as the starting point) with the center of the rubber ring as the center, and rotate 360° clockwise or counterclockwise with a unit angle as each rotation angle, until it rotates around the rubber ring from the starting line for one circle, and During each rotation process, the rubber ring segments corresponding to the unit angle are counted, and after counting the number of pixel points within the unit angle, it is determined whether the rubber ring segment where the unit angle is located is a broken glue unit by matching it with the pixel threshold; after determining whether the rubber ring segments corresponding to all unit angles are broken glue, the number of broken glue units with continuous broken glue is counted, and the number of continuous broken glue is compared and matched with the broken glue threshold. When the number of continuous broken glue is greater than or equal to the broken glue threshold, it is determined that there is broken glue at the continuous broken glue position, and it is marked in the physical image of the image to be tested to complete the overall broken glue detection. Example 1

[0053] As an embodiment of the present invention, in the image matching and alignment process of step S5 of the present invention, the mask image of the template image is continuously slid on the image to be tested in the vertical and horizontal directions using the normalized correlation matching method formula, and the coordinate points of the mask image of the template image and the pixel points of the image to be tested are matched during the sliding process, and the matching degree R (x, y) of the coordinate points is calculated, and then the matching degree of the whole image is obtained by summing up through the normalized correlation matching method formula, and whether the two images are aligned is determined according to the matching degree of the whole image. If not, continue to slide until the two images are aligned; the normalized correlation matching method formula is:

[0054] ; Where R(x,y) is the matching degree of the mask image of the template image at the coordinates (x,y) of the image to be tested; T(x , ,y , ) is the template image at (x , ,y , ), I(x+x , ,y+y , ) is the graph to be matched at point (x+x , ,y+y , ) is the gray value at .

[0055] The maximum value of the matching degree R(x, y) calculated in step S5 is 1. The larger the R(x, y), the higher the overlap between the image to be tested and the mask image of the template image at the coordinate (x, y). , ,y , ) = 1, I (x + x , ,y+y , ) = 1, R(x,y) = 1, and the two images are aligned at this coordinate; when T(x , ,y , ) = 1, I (x + x , ,y+y , ) = 255, there is an offset between the two images at this coordinate.

[0056] After the image matching and alignment in step S5, the rubber ring position of the image to be tested is aligned with the rubber ring position on the mask image of the template image, that is, the coordinate points corresponding to the rubber rings of the two overlap, thereby obtaining the mask image of the image to be tested. Example 2

[0057] like Figure 5 As shown, as an embodiment of the present invention, in step S6 of the present invention, the image binarization calculation is performed on the rubber ring position of the mask image of the image to be tested after matching and alignment, and the pixel points included in the rubber ring of the mask image of the image to be tested are binarized; the binarization formula is:

[0058] ; Wherein, the P (x, y) is the gray value corresponding to the pixel point, and the T is the gray threshold.

[0059] The binarization calculation in step S6 is to take the grayscale values ​​of the pixels included in the rubber ring of the mask image of the image to be tested one by one, and then compare the grayscale value corresponding to the pixel with the grayscale threshold T. When the grayscale value is greater than the threshold T, the binarization value corresponding to the pixel is taken as 255, and when the grayscale value is less than or equal to the threshold T, the binarization value corresponding to the pixel is taken as 0.

[0060] Preferably, the grayscale threshold value is determined according to the background base color of the image to be tested; and the threshold T is 100. Example 3

[0061] like Figure 6 to Figure 7 As shown, as an embodiment of the present invention, the unit angle in step S7 of the present invention is 0.2°, and the pixel points are counted on the rubber ring segment corresponding to the angle every time the rotation is 0.2° during the counting process; the glue breaking threshold is 20, and when the number of pixel points counted on the rubber ring segment corresponding to 0.2° is less than 20, it is determined to be a glue breaking unit.

[0062] After determining the glue breaking unit in step S7, the number of continuous glue breaking locations is matched with the glue breaking threshold, and the glue breaking threshold is 3. When the number of continuous glue breaking locations is greater than or equal to 3, the continuous glue breaking locations are determined to be glue breaking defect locations.

[0063] The embodiments of the present invention are only to introduce its specific implementation methods and are not intended to limit its protection scope. The technicians in this industry can make some modifications inspired by this embodiment, so any equivalent changes or modifications made according to the scope of the patent of the present invention are within the scope of the patent claims of the present invention.

Claims

1. A method for detecting rubber ring breakage, characterized in that: The steps include: S1. Acquiring a template image: capturing a template image with a complete rubber ring by using a CCD camera; S2, selecting a template matching area: selecting a template matching area including an image of a position corresponding to the rubber ring in the template image in step S1; S3, forming a mask image of the template image: converting the template matching area image selected in step S2 into a mask image of the template rubber ring; S4, collecting the image to be tested: capturing the image to be tested including the rubber ring by using a CCD camera; S5, image matching and alignment: performing template matching on the image to be tested in step S4 and the mask image of the template rubber ring in step S3, finding the actual position of the rubber ring to be tested in the mask image area of ​​the template rubber ring, and obtaining the rubber ring mask image of the image to be tested; S6, forming an edge binary image: performing image binarization calculation processing in the rubber ring mask image of the image to be tested after matching in step S5, to obtain an edge binary image of the rubber ring; S7, unit angle rotation counting: in the circular rubber ring corresponding to the edge binary image obtained in step S6, 360° angle is equally divided into unit angles; and the center of the circular rubber ring is used as the rotation center, the radial extension line is used as the starting point, and the unit angle is used as the rotation angle for each time, and the pixel points of the corresponding rubber ring segment within each unit angle are counted; S8, determination of adhesive breakage within a unit angle: after calculating the pixel points corresponding to the adhesive ring segment of each unit angle one by one in step S7, the number of pixel points within each unit angle is compared with the pixel threshold, and the adhesive ring segment corresponding to the unit angle less than the pixel threshold is determined as the adhesive breakage unit; S9, determination of adhesive break defective parts: after calculating and determining the rubber ring segments corresponding to all unit angles in step S8, extract the rubber ring segments where adhesive break units appear continuously, and calculate the number of continuous rubber ring segments, and compare the number with the adhesive break threshold. When the number is greater than or equal to the adhesive break threshold, determine that the continuous rubber ring segment is an adhesive break defective part; S12, marking the adhesive break defective part: marking the position where the adhesive break defective part determined in step S9 is located at the actual position of the adhesive ring in the image to be tested in step S4.

2. The method for detecting rubber ring breakage according to claim 1, characterized in that: The template matching area selected in step S2 and / or the test matching area selected in step S5 are framed on the template image and / or the image to be tested using Qupath software; the Qupath software is open source software for biological image analysis.

3. The method for detecting rubber ring breakage according to claim 1, characterized in that: In the image matching and alignment process of step S5, the mask image of the template image is continuously slid on the image to be tested in the vertical and horizontal directions using the normalized correlation matching method formula, and the coordinate points of the mask image of the template image and the pixel points of the image to be tested are matched during the sliding process, and the matching degree R (x, y) of the coordinate points is calculated, and then the matching degree of the whole image is obtained by summing up the normalized correlation matching method formula, and whether the two images are aligned is determined according to the matching degree of the whole image. If not, continue to slide until the two images are aligned; the normalized correlation matching method formula is: ; Where R(x,y) is the matching degree of the mask image of the template image at the coordinates (x,y) of the image to be tested; T(x , ,y , ) is the template image at (x , ,y , ), I(x+x , ,y+y , ) is the graph to be matched at point (x+x , ,y+y , ) is the gray value at .

4. The method for detecting rubber ring breakage according to claim 3, characterized in that: The maximum value of the matching degree R(x, y) calculated in step S5 is 1. The larger the R(x, y), the higher the overlap between the image to be tested and the mask image of the template image at the coordinate (x, y). , ,y , ) = 1, I (x + x , ,y+y , ) = 1, R(x,y) = 1, and the two images are aligned at this coordinate; when T(x , ,y , ) = 1, I (x + x , ,y+y , ) = 255, there is an offset between the two images at this coordinate.

5. The method for detecting rubber ring breakage according to claim 4, characterized in that: After the image matching and alignment in step S5, the rubber ring position of the image to be tested is aligned with the rubber ring position on the mask image of the template image, that is, the coordinate points corresponding to the rubber rings of the two overlap, thereby obtaining the mask image of the image to be tested.

6. The method for detecting rubber ring breakage according to claim 1, characterized in that: In step S6, the image binarization calculation is performed on the rubber ring position of the mask image of the image to be tested after matching and alignment, and the pixel points included in the rubber ring of the mask image of the image to be tested are binarized; the binarization formula is: ; Wherein, the P (x, y) is the gray value corresponding to the pixel point, and T is the gray threshold.

7. The method for detecting rubber ring breakage according to claim 6, characterized in that: The binarization calculation in step S6 is to take the grayscale values ​​of the pixel points included in the rubber ring of the mask image of the image to be tested one by one, and then compare the grayscale value corresponding to the pixel point with the grayscale threshold T. When the grayscale value is greater than the threshold T, the binary value corresponding to the pixel point is taken as 255, and when the grayscale value is less than or equal to the threshold T, the binary value corresponding to the pixel point is taken as 0.

8. The method for detecting rubber ring breakage according to claim 7, characterized in that: The grayscale threshold value is determined according to the background base color of the image to be tested; the threshold T is 100.

9. The method for detecting rubber ring breakage according to claim 1, characterized in that: The unit angle in step S7 is 0.2°. During the counting process, the pixel points on the rubber ring segment corresponding to the angle are counted every time the angle is rotated by 0.2°. The rubber breaking threshold is 20. When the number of pixel points counted on the rubber ring segment corresponding to 0.2° is less than 20, it is determined to be a rubber breaking unit.

10. The method for detecting rubber ring breakage according to claim 9, characterized in that: After determining the glue breaking unit in step S7, the number of continuous glue breaking locations is matched with the glue breaking threshold value, and the glue breaking threshold value is 3. When the number of continuous glue breaking locations is greater than or equal to 3, the continuous glue breaking locations are determined to be glue breaking defect locations.

Citation Information

Patent Citations

  • Mura defect detection method for edge blurring in LCD (Liquid Crystal Display) screen

    CN114792310A

  • Screen printing defect detection method and device based on image analysis

    CN115439476A