A method, system and medium for detecting debonding based on vision technology
By segmenting, denoising and analyzing the opening detection diagram, the problem of opening detection in complex scenarios is solved, and the precise detection of the opening position and width of the opening is achieved, which improves the accuracy and practicality of the detection.
Patent Information
- Application Number
- CN202411273049.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-12
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2044-09-12
AI Technical Summary
The prior art is difficult to effectively detect the opening position and opening distance in complex scenarios, and there are few vision-based opening detection algorithms, and there are lack of effective technical solutions.
By collecting the glue opening detection map, segmenting the detection target binary map, denoising the noise connection domain, intercepting the minimum enclosure area, generating a hole map, analyzing the gap width, and finally outputting the maximum glue opening position and its width to avoid the influence of interferers.
The glue opening status detection of the entire glue coating area is realized, the position can be adjusted flexibly, and the position and width can be accurately positioned, which improves the accuracy and practicality of the detection.
Smart Images

Figure CN118781120B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of debonding detection technology, and more specifically, to a debonding detection method, system and medium based on visual technology. Background Art
[0002] The pasting process is very common in the production process of products. The common pasting process is to first apply glue evenly at the pasting position, and then squeeze the pasted object at the glue-coated position to achieve the purpose of sticking firmly.
[0003] However, glued products often come apart due to certain factors, such as failure of glue adhesion, external force, etc. The failure of glue may cause serious hidden dangers in product use, especially in some safety-related scenarios, and even lead to life consequences. However, product manufacturers or users cannot always keep an eye on whether glued products are coming apart. Therefore, a method for detecting glue coming apart is very necessary, which can replace the human eye to achieve long-term or frequent monitoring of the glued area, and can immediately remind personnel to deal with it once glue coming apart occurs.
[0004] There are many ways to detect debonding, and the most common ones are mechanical detection or sensor detection. Mechanical detection usually installs a mechanical detection device at the glue seam position. Once debonding occurs, the machine moves and an alarm is issued. However, the mechanical detection method is relatively non-reusable. For example, in the production process of the product, if a mechanical device is installed for each product, the cost will become uncontrollable. The sensor detection method uses a sensor to measure the glue seam spacing to achieve the purpose of detecting debonding, but the sensor detection method will be affected by the installation point. In the scene with a relatively large adhesive surface, it cannot cover the entire adhesive surface well, and it is difficult to achieve a relatively ideal monitoring. The vision-based detection method uses a camera to capture the entire glue coating position, which can effectively detect the debonding state of the entire glue coating area, and can flexibly adjust the position. It is more practical than the mechanical and sensor methods, but in complex shooting scenes, it is difficult to locate the debonding position and measure the debonding distance. However, there are relatively few vision-based debonding detection methods on the market, and there is no public vision-based debonding detection algorithm. For the above problems, effective technical solutions are urgently needed. Summary of the invention
[0005] The purpose of the embodiments of the present application is to provide a debonding detection method, system and medium based on visual technology, which calculates the gap width of each position by traversing the hole map, screens by the distance from the reference position, and outputs a maximum debonding position and its debonding width, which can effectively avoid the influence of interference on the measurement.
[0006] The present application also provides a method for detecting debonding based on visual technology, including:
[0007] Collect the debonding detection image, segment the detection target binary image based on the debonding detection image, denoise the detection target binary image according to the connected domain area, erase the connected domain whose area is smaller than the set area threshold, and obtain the detection target;
[0008] The upper and lower boundaries of the detection target are located according to the horizontal summation and projection, the left and right boundaries of the detection target are located according to the vertical summation and projection, and the minimum enclosing area of the detection target is intercepted according to the upper, lower, left and right boundaries obtained by the projection;
[0009] Collect images on both sides of the minimum enclosing area to obtain two side images, retrieve all white connected domains in the two side images, and record the coordinates of the upper and lower boundary points of the connected domains;
[0010] Draw straight lines according to the recorded coordinate points to obtain closed holes and generate a hole map;
[0011] Based on the hole diagram, the position and width value of the maximum gap width are analyzed, the position and width value of the maximum gap width are output, and the maximum debonding position and the maximum debonding width value are obtained.
[0012] Optionally, in the debonding detection method based on visual technology described in the embodiment of the present application, a debonding detection image is collected, a detection target binary image is segmented based on the debonding detection image, the detection target binary image is denoised according to the area of the connected domain, and the connected domain whose area is less than the set area threshold is erased, specifically including:
[0013] Obtain a debonding detection image, calibrate the adhesive position in the debonding detection image to be in a vertical or horizontal direction, and perform binarization processing on the debonding detection image to obtain a corrected image;
[0014] Acquire pixel values of the corrected image, and analyze white areas and black areas of the corrected image based on the pixel values of the corrected image;
[0015] The white area is removed, and the parameter information of the black area is analyzed, and the area of the connected domain is generated based on the parameter information of the black area;
[0016] Compare the area of the connected domain with the set area threshold;
[0017] If the area of the connected domain is greater than or equal to the set area threshold, a binary image of the detection target is generated. If the area of the connected domain is less than the set area threshold, the corresponding connected domain is erased.
[0018] Optionally, in the debonding detection method based on visual technology described in the embodiment of the present application, the upper and lower boundaries of the detection target are located according to the horizontal summation and projection, the left and right boundaries of the detection target are located according to the vertical summation and projection, and the minimum enclosing area of the detection target is intercepted according to the upper and lower left and right boundaries obtained by the projection, specifically including:
[0019] Obtain a binary image of the detection target, sum each row of pixels of the binary image of the detection target to form a separate column of images, and project the separate column of images to obtain a projection image;
[0020] Traverse the projection graph from top to bottom, and if the pixel value is greater than the first set threshold, the upper boundary is obtained; traverse the projection graph from bottom to top, and if the pixel value is greater than the second set threshold, the lower boundary is obtained;
[0021] Traverse the projection graph from left to right, and if the pixel value is greater than the third set threshold, obtain the left boundary; traverse the projection graph from right to left, and if the pixel value is greater than the fourth set threshold, obtain the right boundary;
[0022] The minimum enclosing area of the detected target is obtained based on the upper boundary, lower boundary, left boundary and right boundary.
[0023] Optionally, in the debonding detection method based on visual technology described in the embodiment of the present application, images on both sides of the minimum enclosing area are collected to obtain two side images, all white connected domains in the two side images are retrieved, and the coordinates of the upper and lower boundary points of the connected domains are recorded, specifically including:
[0024] Obtain the minimum package area of the detection target, obtain the minimum encirclement map, obtain the side image based on the minimum encirclement map, and obtain two side images;
[0025] Analyze pixel values based on the side image, generate a white area, obtain a white connected domain, and establish a coordinate system based on the white connected domain;
[0026] Generate the coordinates of the upper and lower boundary points based on the coordinate system.
[0027] Optionally, in the debonding detection method based on visual technology described in the embodiment of the present application, after drawing straight lines according to the recorded coordinate points to obtain closed holes and generate a hole map, the following steps are specifically performed:
[0028] Obtain a hole image, extract hole image features, determine whether the hole image features are within a preset feature interval, and determine the hole image features that exceed the preset feature interval as noise features;
[0029] The noise features are removed to obtain an optimized hole map, and the optimized hole map is summed and projected to obtain a projection map;
[0030] Obtain the pixel value of the projection image, and generate the reference position at the position with the largest pixel value in the projection image, and record the reference position as the pasting surface;
[0031] Traverse the optimized hole map by row or column, identify each group of continuous pixels that appear during the traversal, record the number of continuous pixels, and calculate the minimum distance between the continuous pixels and the reference position.
[0032] If the minimum distance is greater than the set distance value, the continuous pixels are removed and the traversal of all rows or columns is completed.
[0033] Optionally, in the debonding detection method based on visual technology described in the embodiment of the present application, the position and width value of the maximum gap width are analyzed based on the hole map, the position and width value of the maximum gap width are output, and the maximum debonding position and the maximum debonding width value are obtained, which specifically includes:
[0034] Obtain a hole map, and analyze the gap widths at different positions of different detection targets based on the hole map;
[0035] The gap widths at different positions of the detection target are compared to obtain the position and width value of the maximum gap width.
[0036] In a second aspect, an embodiment of the present application provides a debonding detection system based on visual technology, the system comprising: a memory and a processor, the memory comprising a program of a debonding detection method based on visual technology, and the program of the debonding detection method based on visual technology is executed by the processor to implement the following steps:
[0037] Collect the debonding detection image, segment the detection target binary image based on the debonding detection image, denoise the detection target binary image according to the connected domain area, erase the connected domain whose area is smaller than the set area threshold, and obtain the detection target;
[0038] The upper and lower boundaries of the detection target are located by horizontal summation and projection, and the left and right boundaries of the detection target are located by vertical summation and projection. The minimum enclosing area of the detection target is intercepted according to the upper, lower, left and right boundaries obtained by projection;
[0039] Collect images on both sides of the minimum enclosing area to obtain two side images, retrieve all white connected domains in the two side images, and record the coordinates of the upper and lower boundary points of the connected domains;
[0040] Draw straight lines according to the recorded coordinate points to obtain closed holes and generate a hole map;
[0041] Based on the hole diagram, the position and width value of the maximum gap width are analyzed, the position and width value of the maximum gap width are output, and the maximum debonding position and the maximum debonding width value are obtained.
[0042] Optionally, in the debonding detection system based on visual technology described in the embodiment of the present application, a debonding detection image is collected, a detection target binary image is segmented based on the debonding detection image, and the detection target binary image is denoised according to the area of the connected domain, and the connected domain whose area is less than the set area threshold is erased, specifically including:
[0043] Obtain a debonding detection image, calibrate the adhesive position in the debonding detection image to be in a vertical or horizontal direction, and perform binarization processing on the debonding detection image to obtain a corrected image;
[0044] Acquire pixel values of the corrected image, and analyze white areas and black areas of the corrected image based on the pixel values of the corrected image;
[0045] The white area is removed, and the parameter information of the black area is analyzed, and the area of the connected domain is generated based on the parameter information of the black area;
[0046] Compare the area of the connected domain with the set area threshold;
[0047] If the area of the connected domain is greater than or equal to the set area threshold, a binary image of the detection target is generated. If the area of the connected domain is less than the set area threshold, the corresponding connected domain is erased.
[0048] Optionally, in the debonding detection system based on visual technology described in the embodiment of the present application, the upper and lower boundaries of the detection target are located according to the horizontal summation and projection, the left and right boundaries of the detection target are located according to the vertical summation and projection, and the minimum enclosing area of the detection target is intercepted according to the upper and lower, left and right boundaries obtained by the projection, specifically including:
[0049] Obtain a binary image of the detection target, sum each row of pixels of the binary image of the detection target to form a separate column of images, and project the separate column of images to obtain a projection image;
[0050] Traverse the projection graph from top to bottom, and if the pixel value is greater than the first set threshold, the upper boundary is obtained; traverse the projection graph from bottom to top, and if the pixel value is greater than the second set threshold, the lower boundary is obtained;
[0051] Traverse the projection graph from left to right, and if the pixel value is greater than the third set threshold, obtain the left boundary; traverse the projection graph from right to left, and if the pixel value is greater than the fourth set threshold, obtain the right boundary;
[0052] The minimum enclosing area of the detected target is obtained based on the upper boundary, lower boundary, left boundary and right boundary.
[0053] In a third aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium includes a debonding detection method program based on visual technology. When the debonding detection method program based on visual technology is executed by a processor, the steps of the debonding detection method based on visual technology as described in any one of the above items are implemented.
[0054] As can be seen from the above, the embodiments of the present application provide a debonding detection method, system and medium based on visual technology, which acquires a debonding detection image, segments a detection target binary image based on the debonding detection image, denoises the detection target binary image according to the area of the connected domain, erases the connected domain whose area is less than the set area threshold, and obtains the detection target; locates the upper and lower boundaries of the detection target according to the horizontal summation and projection, locates the left and right boundaries of the detection target according to the vertical summation and projection, and intercepts the minimum enclosing area of the detection target according to the upper, lower, left and right boundaries obtained by projection; and acquires images on both sides of the minimum enclosing area. Image, get two side images, retrieve all the white connected domains in the two side images, and record the coordinates of the upper and lower boundary points of the connected domains; draw straight lines according to the recorded coordinate points to get closed holes and generate a hole map; analyze the position and width value of the largest gap width based on the hole map, output the position and width value of the maximum gap width, and get the maximum debonding position and the maximum debonding width value; calculate the gap width of each position by traversing the hole map, filter by the distance from the reference position, and output a maximum debonding position and its debonding width, which can effectively avoid the influence of interference on the measurement. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0056] Figure 1 A flow chart of a method for detecting debonding based on visual technology provided in an embodiment of the present application;
[0057] Figure 2 A flow chart of a connected domain erasing method of a debonding detection method based on visual technology provided in an embodiment of the present application;
[0058] Figure 3 A flow chart of a method for acquiring the minimum enclosing area of a detection target in a debonding detection method based on visual technology provided in an embodiment of the present application;
[0059] Figure 4 A debonding detection diagram of a debonding detection method based on visual technology provided in an embodiment of the present application;
[0060] Figure 5 A binary image of the detection target of the debonding detection method based on visual technology provided in an embodiment of the present application;
[0061] Figure 6 A binary image of a detection target after denoising in the debonding detection method based on visual technology provided in an embodiment of the present application;
[0062] Figure 7 A longitudinal summation projection diagram of the debonding detection method based on visual technology provided in an embodiment of the present application;
[0063] Figure 8 A lateral summation projection diagram of the debonding detection method based on visual technology provided in an embodiment of the present application;
[0064] Fig. 9 A diagram showing the results of a debonding detection method based on visual technology provided in an embodiment of the present application;
[0065] Fig.10 A block diagram of a debonding detection system based on visual technology provided in an embodiment of the present application. DETAILED DESCRIPTION
[0066] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0067] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0068] Please refer to Figure 1 , Figure 1 This is a flow chart of a method for detecting debonding based on vision technology in some embodiments of the present application. The method for detecting debonding based on vision technology is used in a terminal device, and the method for detecting debonding based on vision technology includes the following steps:
[0069] S101, collecting a debonding detection image, and segmenting a detection target binary image based on the debonding detection image (such as Figure 5 As shown in the figure), the binary image of the detection target is denoised according to the connected domain area, and the connected domains whose area is smaller than the set area threshold are erased to obtain the detection target;
[0070] S102, locating the upper and lower boundaries of the detection target according to the horizontal summation and projection, locating the left and right boundaries of the detection target according to the vertical summation and projection, and intercepting the minimum enclosing area of the detection target according to the upper, lower, left and right boundaries obtained by the projection;
[0071] S103, collecting images on both sides of the minimum enclosing area to obtain two side images, searching for all white connected domains in the two side images, and recording the coordinates of the upper and lower boundary points of the connected domains;
[0072] S104, drawing straight lines according to the recorded coordinate points to obtain closed holes and generate a hole map;
[0073] S105, analyzing the position and width value of the maximum gap width based on the hole map, outputting the position and width value of the maximum gap width, and obtaining the maximum debonding position and the maximum debonding width value.
[0074] It should be noted that by analyzing the debonding detection diagram (such as Figure 1 As shown in the figure), and project it to establish the minimum enclosing area of the projection matching, so as to analyze the holes that appear and obtain the debonding detection result diagram (as shown in the figure Fig. 9 As shown in the figure), the debonding detection result chart can accurately show and analyze the debonding width and location.
[0075] Please refer to Figure 2 , Figure 2 1 is a flowchart of a connected domain erasing method of a debonding detection method based on visual technology in some embodiments of the present application. According to an embodiment of the present invention, a debonding detection image is collected, a detection target binary image is segmented based on the debonding detection image, and the detection target binary image is denoised according to the connected domain area (the denoised detection target binary image is as shown in FIG. 1 ). Figure 6 As shown in the figure), the connected domains whose area is smaller than the set area threshold are erased, specifically including:
[0076] S201, obtaining a debonding detection image, correcting the adhesive position in the debonding detection image to be in the vertical or horizontal direction, and performing binarization processing on the debonding detection image to obtain a corrected image;
[0077] S202, obtaining pixel values of the corrected image, and analyzing white areas and black areas of the corrected image based on the pixel values of the corrected image;
[0078] S203, removing the white area, analyzing the black area parameter information, and generating the connected domain area based on the black area parameter information;
[0079] S204, comparing the area of the connected domain with a set area threshold;
[0080] S205, if the area of the connected domain is greater than or equal to the set area threshold, a detection target binary map is generated; if the area of the connected domain is less than the set area threshold, the corresponding connected domain is erased.
[0081] It should be noted that the connected domain area is obtained by analyzing the pixel values of the corrected image, the connected domain area is analyzed, and the connected domain is erased to improve the response accuracy of the debonding detection image.
[0082] Please refer to Figure 3 , Figure 3 This is a flow chart of a method for obtaining the minimum enclosing area of a detection target in a debonding detection method based on visual technology in some embodiments of the present application. According to an embodiment of the present invention, the upper and lower boundaries of the detection target are located according to the horizontal summation and projection, the left and right boundaries of the detection target are located according to the vertical summation and projection, and the minimum enclosing area of the detection target is intercepted according to the upper and lower left and right boundaries obtained by projection, which specifically includes:
[0083] S301, obtaining a binary image of a detection target, summing up pixels in each row of the binary image of the detection target to form a separate column of images, and projecting the separate column of images to obtain a projection image;
[0084] S302, traversing the projection graph from top to bottom, if the pixel value is greater than a first set threshold, obtaining the upper boundary, traversing the projection graph from bottom to top, if the pixel value is greater than a second set threshold, obtaining the lower boundary;
[0085] S303, traversing the projection graph from left to right, if the pixel value is greater than a third set threshold, obtaining the left boundary, and traversing the projection graph from right to left, if the pixel value is greater than a fourth set threshold, obtaining the right boundary;
[0086] S304, obtaining a minimum enclosing area of the detection target based on the upper boundary, the lower boundary, the left boundary and the right boundary.
[0087] It should be noted that the projection graph traversed from the top right to the bottom obtains the vertical summation projection graph (such as Figure 7 ), the projection diagram traversed from left to right is analyzed to obtain the horizontal summation projection diagram (such as Figure 8 As shown in the figure, by analyzing the binary image of the detection target and projecting the binary image, the pixel values are analyzed through the projection images in different directions to obtain different boundaries.
[0088] According to an embodiment of the present invention, images on both sides of the minimum enclosing area are collected to obtain two side images, all white connected domains in the two side images are retrieved, and the coordinates of the upper and lower boundary points of the connected domains are recorded, specifically including:
[0089] Obtain the minimum package area of the detection target, obtain the minimum encirclement map, obtain the side image based on the minimum encirclement map, and obtain two side images;
[0090] Analyze pixel values based on the side image, generate a white area, obtain a white connected domain, and establish a coordinate system based on the white connected domain;
[0091] Generate the coordinates of the upper and lower boundary points based on the coordinate system.
[0092] It should be noted that the pixel value of the white area is 1, and the pixel value of the black area is 0.
[0093] According to an embodiment of the present invention, after drawing straight lines according to the recorded coordinate points to obtain closed holes and generating a hole map, the following steps are specifically included:
[0094] Obtain a hole image, extract hole image features, determine whether the hole image features are within a preset feature interval, and determine the hole image features that exceed the preset feature interval as noise features;
[0095] The noise features are removed to obtain an optimized hole map, and the optimized hole map is summed and projected to obtain a projection map;
[0096] Obtain the pixel value of the projection image, and generate the reference position at the position with the largest pixel value in the projection image, and record the reference position as the pasting surface;
[0097] Traverse the optimized hole map by row or column, identify each group of continuous pixels that appear during the traversal, record the number of continuous pixels, and calculate the minimum distance between the continuous pixels and the reference position.
[0098] If the minimum distance is greater than the set distance value, the continuous pixels are removed and the traversal of all rows or columns is completed.
[0099] It should be noted that when pasting vertically, a horizontal straight line is drawn; when pasting horizontally, a vertical straight line is drawn. A closed hole refers to a black hole that is surrounded by white pixels to form a closed area.
[0100] According to an embodiment of the present invention, based on the hole map, the position and width value of the maximum gap width are analyzed, the position and width value of the maximum gap width are output, and the maximum debonding position and the maximum debonding width value are obtained, specifically including:
[0101] Obtain a hole map, and analyze the gap widths at different positions of different detection targets based on the hole map;
[0102] The gap widths at different positions of the detection target are compared to obtain the position and width value of the maximum gap width.
[0103] It should be noted that the position with the largest number of consecutive pixels is selected, and the minimum distance between the position and the reference position must not exceed the set value;
[0104] If pasting vertically, it will traverse each row; if pasting horizontally, it will traverse each column;
[0105] Continuous pixels refer to the connected white pixel areas in each row or column;
[0106] The method for calculating the minimum distance between the continuous pixel position and the reference position is as follows: if pasted vertically, the minimum distance between the continuous pixels and the reference position x is calculated (generally, one of the edge pixels will have the shortest distance from the reference position); if pasted horizontally, the minimum distance between the continuous pixels and the reference position y is calculated;
[0107] The distance from the reference position does not exceed the set value to prevent large interference objects in the external area from causing miscalculation. If the set value is reduced, the detection will be stricter, the suppression of interference objects will be strengthened, and it may also suppress the debonding area, causing inaccurate debonding measurement values; if the set value is increased, the detection will be looser, the suppression of interference objects will be weakened, and interference objects may be mistakenly detected as debonding. The set value needs to be adjusted to an appropriate value according to the actual scenario.
[0108] Please refer to Fig.10 , Fig.10 The block diagram of a debonding detection system based on visual technology in some embodiments of the present application. In the second aspect, the embodiments of the present application provide a debonding detection system based on visual technology, the system comprising: a memory and a processor, the memory comprising a program of a debonding detection method based on visual technology, and when the program of the debonding detection method based on visual technology is executed by the processor, the following steps are implemented:
[0109] Collect the debonding detection image, segment the detection target binary image based on the debonding detection image, denoise the detection target binary image according to the connected domain area, erase the connected domain whose area is smaller than the set area threshold, and obtain the detection target;
[0110] The upper and lower boundaries of the detection target are located by horizontal summation and projection, and the left and right boundaries of the detection target are located by vertical summation and projection. The minimum enclosing area of the detection target is intercepted according to the upper, lower, left and right boundaries obtained by projection;
[0111] Collect images on both sides of the minimum enclosing area to obtain two side images, retrieve all white connected domains in the two side images, and record the coordinates of the upper and lower boundary points of the connected domains;
[0112] Draw straight lines according to the recorded coordinate points to obtain closed holes and generate a hole map;
[0113] Based on the hole diagram, the position and width value of the maximum gap width are analyzed, the position and width value of the maximum gap width are output, and the maximum debonding position and the maximum debonding width value are obtained.
[0114] It should be noted that by analyzing the debonding detection image and projecting it, the minimum enclosing area of the projection matching is established, so as to analyze the holes that appear and accurately analyze the width and position of the debonding.
[0115] According to an embodiment of the present invention, a debonding detection image is collected, a detection target binary image is segmented based on the debonding detection image, and the detection target binary image is denoised according to the area of the connected domain, and the connected domain whose area is smaller than the set area threshold is erased, specifically including:
[0116] Obtain a debonding detection image, calibrate the adhesive position in the debonding detection image to be in a vertical or horizontal direction, and perform binarization processing on the debonding detection image to obtain a corrected image;
[0117] Acquire pixel values of the corrected image, and analyze white areas and black areas of the corrected image based on the pixel values of the corrected image;
[0118] The white area is removed, and the parameter information of the black area is analyzed, and the area of the connected domain is generated based on the parameter information of the black area;
[0119] Compare the area of the connected domain with the set area threshold;
[0120] If the area of the connected domain is greater than or equal to the set area threshold, a binary image of the detection target is generated. If the area of the connected domain is less than the set area threshold, the corresponding connected domain is erased.
[0121] It should be noted that the connected domain area is obtained by analyzing the pixel values of the corrected image, the connected domain area is analyzed, and the connected domain is erased to improve the response accuracy of the debonding detection image.
[0122] According to an embodiment of the present invention, the upper and lower boundaries of the detection target are located according to the horizontal summation and projection, the left and right boundaries of the detection target are located according to the vertical summation and projection, and the minimum enclosing area of the detection target is intercepted according to the upper and lower left and right boundaries obtained by the projection, specifically including:
[0123] Obtain a binary image of the detection target, sum each row of pixels of the binary image of the detection target to form a separate column of images, and project the separate column of images to obtain a projection image;
[0124] Traverse the projection graph from top to bottom, and if the pixel value is greater than the first set threshold, the upper boundary is obtained; traverse the projection graph from bottom to top, and if the pixel value is greater than the second set threshold, the lower boundary is obtained;
[0125] Traverse the projection graph from left to right, and if the pixel value is greater than the third set threshold, obtain the left boundary; traverse the projection graph from right to left, and if the pixel value is greater than the fourth set threshold, obtain the right boundary;
[0126] The minimum enclosing area of the detected target is obtained based on the upper boundary, lower boundary, left boundary and right boundary.
[0127] It should be noted that different boundaries are obtained by analyzing the binary image of the detection target, projecting the binary image, and analyzing pixel values through projection images in different directions.
[0128] According to an embodiment of the present invention, images on both sides of the minimum enclosing area are collected to obtain two side images, all white connected domains in the two side images are retrieved, and the coordinates of the upper and lower boundary points of the connected domains are recorded, specifically including:
[0129] Obtain the minimum package area of the detection target, obtain the minimum encirclement map, obtain the side image based on the minimum encirclement map, and obtain two side images;
[0130] Analyze pixel values based on the side image, generate a white area, obtain a white connected domain, and establish a coordinate system based on the white connected domain;
[0131] Generate the coordinates of the upper and lower boundary points based on the coordinate system.
[0132] It should be noted that the pixel value of the white area is 1, and the pixel value of the black area is 0.
[0133] According to an embodiment of the present invention, after drawing straight lines according to the recorded coordinate points to obtain closed holes and generating a hole map, the following steps are specifically included:
[0134] Obtain a hole image, extract hole image features, determine whether the hole image features are within a preset feature interval, and determine the hole image features that exceed the preset feature interval as noise features;
[0135] The noise features are removed to obtain an optimized hole map, and the optimized hole map is summed and projected to obtain a projection map;
[0136] Obtain the pixel value of the projection image, and generate the reference position at the position with the largest pixel value in the projection image, and record the reference position as the pasting surface;
[0137] Traverse the optimized hole map by row or column, identify each group of continuous pixels that appear during the traversal, record the number of continuous pixels, and calculate the minimum distance between the continuous pixels and the reference position.
[0138] If the minimum distance is greater than the set distance value, the continuous pixels are removed and the traversal of all rows or columns is completed.
[0139] It should be noted that when pasting vertically, a horizontal straight line is drawn; when pasting horizontally, a vertical straight line is drawn. A closed hole refers to a black hole that is surrounded by white pixels to form a closed area.
[0140] According to an embodiment of the present invention, based on the hole map, the position and width value of the maximum gap width are analyzed, the position and width value of the maximum gap width are output, and the maximum debonding position and the maximum debonding width value are obtained, specifically including:
[0141] Obtain a hole map, and analyze the gap widths at different positions of different detection targets based on the hole map;
[0142] The gap widths at different positions of the detection target are compared to obtain the position and width value of the maximum gap width.
[0143] It should be noted that the position with the largest number of consecutive pixels is selected, and the minimum distance between the position and the reference position must not exceed the set value;
[0144] If pasting vertically, it will traverse each row; if pasting horizontally, it will traverse each column;
[0145] Continuous pixels refer to the connected white pixel areas in each row or column;
[0146] The method for calculating the minimum distance between the continuous pixel position and the reference position is as follows: if pasted vertically, the minimum distance between the continuous pixels and the reference position x is calculated (generally, one of the edge pixels will have the shortest distance from the reference position); if pasted horizontally, the minimum distance between the continuous pixels and the reference position y is calculated;
[0147] The distance from the reference position does not exceed the set value to prevent large interference objects in the external area from causing miscalculation. If the set value is reduced, the detection will be stricter, the suppression of interference objects will be strengthened, and it may also suppress the debonding area, causing inaccurate debonding measurement values; if the set value is increased, the detection will be looser, the suppression of interference objects will be weakened, and interference objects may be mistakenly detected as debonding. The set value needs to be adjusted to an appropriate value according to the actual scenario.
[0148] The third aspect of the present invention provides a computer-readable storage medium, which includes a debonding detection method program based on visual technology. When the debonding detection method program based on visual technology is executed by a processor, the steps of the debonding detection method based on visual technology as described above are implemented.
[0149] The present invention discloses a debonding detection method, system and medium based on visual technology. The method comprises the following steps: collecting a debonding detection image, segmenting a detection target binary image based on the debonding detection image, denoising the detection target binary image according to the area of connected domains, erasing connected domains whose area is less than a set area threshold, and obtaining the detection target; locating the upper and lower boundaries of the detection target according to the horizontal summation and projection, locating the left and right boundaries of the detection target according to the vertical summation and projection, and intercepting the minimum enclosing area of the detection target according to the upper and lower left and right boundaries obtained by the projection; collecting images on both sides of the minimum enclosing area to obtain two side images, retrieving all white connected domains in the two side images, and recording the coordinates of the upper and lower boundary points of the connected domains; drawing straight lines according to the recorded coordinate points to obtain closed holes and generate a hole map; analyzing the position and width value of the maximum gap width based on the hole map, outputting the position and width value of the maximum gap width, and obtaining the maximum debonding position and the maximum debonding width value; calculating the gap width of each position by traversing the hole map, screening by the distance from the reference position, and outputting a maximum debonding position and its debonding width, which can effectively avoid the influence of interference on the measurement.
[0150] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0151] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0152] In addition, all functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0153] Those skilled in the art can understand that: all or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions, the aforementioned program can be stored in a readable storage medium, and when the program is executed, it executes the steps of the above method embodiments; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), disks or optical disks, and other media that can store program codes.
[0154] Alternatively, if the above-mentioned integrated unit of the present invention is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention can be essentially or partly reflected in the form of a software product that contributes to the prior art. The software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.
Claims
1. A method for detecting debonding based on visual technology, characterized in that: include: Collect the debonding detection image, segment the detection target binary image based on the debonding detection image, denoise the detection target binary image according to the connected domain area, erase the connected domain whose area is smaller than the set area threshold, and obtain the detection target; The upper and lower boundaries of the detection target are located according to the horizontal summation and projection, the left and right boundaries of the detection target are located according to the vertical summation and projection, and the minimum enclosing area of the detection target is intercepted according to the upper, lower, left and right boundaries obtained by the projection; Collect images on both sides of the minimum enclosing area to obtain two side images, retrieve all white connected domains in the two side images, and record the coordinates of the upper and lower boundary points of the connected domains; Draw straight lines according to the recorded coordinate points to obtain closed holes and generate a hole map; Based on the hole diagram, the position and width value of the maximum gap width are analyzed, the position and width value of the maximum gap width are output, and the maximum debonding position and the maximum debonding width value are obtained.
2. The debonding detection method based on visual technology according to claim 1 is characterized in that: Collect the debonding detection map, segment the detection target binary map based on the debonding detection map, denoise the detection target binary map according to the connected domain area, and erase the connected domains whose connected domain area is less than the set area threshold, specifically including: Obtain a debonding detection image, calibrate the adhesive position in the debonding detection image to be in a vertical or horizontal direction, and perform binarization processing on the debonding detection image to obtain a corrected image; Acquire pixel values of the corrected image, and analyze white areas and black areas of the corrected image based on the pixel values of the corrected image; The white area is removed, and the parameter information of the black area is analyzed, and the area of the connected domain is generated based on the parameter information of the black area; Compare the area of the connected domain with the set area threshold; If the area of the connected domain is greater than or equal to the set area threshold, a binary map of the detection target is generated. If the area of the connected domain is less than the set area threshold, the corresponding connected domain is erased.
3. The method for detecting debonding based on visual technology according to claim 2, characterized in that: The upper and lower boundaries of the detection target are located according to the horizontal summation and projection, the left and right boundaries of the detection target are located according to the vertical summation and projection, and the minimum enclosing area of the detection target is intercepted according to the upper, lower, left and right boundaries obtained by projection, including: Obtain a binary image of the detection target, sum each row of pixels of the binary image of the detection target to form a separate column of images, and project the separate column of images to obtain a projection image; Traverse the projection graph from top to bottom, and if the pixel value is greater than the first set threshold, the upper boundary is obtained; traverse the projection graph from bottom to top, and if the pixel value is greater than the second set threshold, the lower boundary is obtained; Traverse the projection graph from left to right, and if the pixel value is greater than the third set threshold, obtain the left boundary; traverse the projection graph from right to left, and if the pixel value is greater than the fourth set threshold, obtain the right boundary; The minimum enclosing area of the detected target is obtained based on the upper boundary, lower boundary, left boundary and right boundary.
4. The method for detecting debonding based on visual technology according to claim 3 is characterized in that: Collect images on both sides of the minimum enclosing area to obtain two side images, retrieve all white connected domains in the two side images, and record the coordinates of the upper and lower boundary points of the connected domains, including: Obtain the minimum package area of the detection target, obtain the minimum encirclement map, obtain the side image based on the minimum encirclement map, and obtain two side images; Analyze pixel values based on the side image, generate a white area, obtain a white connected domain, and establish a coordinate system based on the white connected domain; Generate the coordinates of the upper and lower boundary points based on the coordinate system.
5. The method for detecting debonding based on visual technology according to claim 4 is characterized in that: Draw straight lines according to the recorded coordinate points to obtain closed holes. After generating the hole map, the following steps are specifically performed: Obtain a hole image, extract hole image features, determine whether the hole image features are within a preset feature interval, and determine the hole image features that exceed the preset feature interval as noise features; The noise features are removed to obtain an optimized hole map, and the optimized hole map is summed and projected to obtain a projection map; Obtain the pixel value of the projection image, and generate the reference position at the position with the largest pixel value in the projection image, and record the reference position as the pasting surface; Traverse the optimized hole map by row or column, identify each group of continuous pixels that appear during the traversal process, record the number of continuous pixels, and calculate the minimum distance between the continuous pixels and the reference position. If the minimum distance is greater than the set distance value, the continuous pixels are removed and the traversal of all rows or columns is completed.
6. The method for detecting debonding based on visual technology according to claim 5, characterized in that: Based on the hole diagram, the position and width of the maximum gap width are analyzed, and the position and width of the maximum gap width are output to obtain the maximum debonding position and the maximum debonding width, including: Obtain a hole map, and analyze the gap widths at different positions of different detection targets based on the hole map; The gap widths at different positions of the detection target are compared to obtain the position and width value of the maximum gap width.
7. A debonding detection system based on visual technology, characterized in that: The system includes: a memory and a processor, wherein the memory includes a program of a debonding detection method based on visual technology, and when the program of the debonding detection method based on visual technology is executed by the processor, the following steps are implemented: Collect the debonding detection image, segment the detection target binary image based on the debonding detection image, denoise the detection target binary image according to the connected domain area, erase the connected domain whose area is smaller than the set area threshold, and obtain the detection target; The upper and lower boundaries of the detection target are located by horizontal summation and projection, and the left and right boundaries of the detection target are located by vertical summation and projection. The minimum enclosing area of the detection target is intercepted according to the upper, lower, left and right boundaries obtained by projection; Collect images on both sides of the minimum enclosing area to obtain two side images, retrieve all white connected domains in the two side images, and record the coordinates of the upper and lower boundary points of the connected domains; Draw straight lines according to the recorded coordinate points to obtain closed holes and generate a hole map; Based on the hole diagram, the position and width value of the maximum gap width are analyzed, the position and width value of the maximum gap width are output, and the maximum debonding position and the maximum debonding width value are obtained.
8. The debonding detection system based on vision technology according to claim 7 is characterized in that: Collect the debonding detection map, segment the detection target binary map based on the debonding detection map, denoise the detection target binary map according to the connected domain area, and erase the connected domains whose connected domain area is less than the set area threshold, specifically including: Obtain a debonding detection image, calibrate the adhesive position in the debonding detection image to be in a vertical or horizontal direction, and perform binarization processing on the debonding detection image to obtain a corrected image; Acquire pixel values of the corrected image, and analyze white areas and black areas of the corrected image based on the pixel values of the corrected image; The white area is removed, and the parameter information of the black area is analyzed, and the area of the connected domain is generated based on the parameter information of the black area; Compare the area of the connected domain with the set area threshold; If the area of the connected domain is greater than or equal to the set area threshold, a binary map of the detection target is generated. If the area of the connected domain is less than the set area threshold, the corresponding connected domain is erased.
9. The debonding detection system based on vision technology according to claim 8 is characterized in that: The upper and lower boundaries of the detection target are located according to the horizontal summation and projection, the left and right boundaries of the detection target are located according to the vertical summation and projection, and the minimum enclosing area of the detection target is intercepted according to the upper, lower, left and right boundaries obtained by projection, including: Obtain a binary image of the detection target, sum each row of pixels of the binary image of the detection target to form a separate column of images, and project the separate column of images to obtain a projection image; Traverse the projection graph from top to bottom, and if the pixel value is greater than the first set threshold, the upper boundary is obtained; traverse the projection graph from bottom to top, and if the pixel value is greater than the second set threshold, the lower boundary is obtained; Traverse the projection graph from left to right, and if the pixel value is greater than the third set threshold, obtain the left boundary; traverse the projection graph from right to left, and if the pixel value is greater than the fourth set threshold, obtain the right boundary; The minimum enclosing area of the detected target is obtained based on the upper boundary, lower boundary, left boundary and right boundary.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a debonding detection method program based on visual technology. When the debonding detection method program based on visual technology is executed by a processor, the steps of the debonding detection method based on visual technology as described in any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Method and system for precisely locating left and right boundaries of license plate
CN105354570A
Weld joint pore defect detection method based on image processing
CN113496483A