Glue application defect detection method and apparatus
By performing contour and edge detection on the glue-coated image, and combining the size, curvature, shape, and center point coordinates of the glue-coated object, glue-coating defects can be automatically identified. This solves the problems of low efficiency and inaccurate accuracy in existing glue-coating detection technologies, and achieves efficient and accurate glue-coating defect detection.
Patent Information
- Application Number
- CN202210870283.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-22
- Publication Date
- 2026-02-17
- Estimated Expiration
- 2042-07-22
AI Technical Summary
Existing adhesive coating inspection methods mainly rely on manual inspection, which suffers from low efficiency and accuracy issues due to subjective human factors.
By acquiring images of the glued object, performing contour and edge detection, and combining the size, curvature, shape, and center point coordinates of the glued object, the system automatically identifies glued defects, including those that are too wide or too narrow in diameter, have broken glue, or are offset.
It enables autonomous detection of adhesive coating defects, improving detection efficiency and accuracy while reducing the influence of human subjectivity.
Smart Images

Figure CN115187562B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image processing, in particular to a glue coating defect detection method and device. BACKGROUND
[0002] With the continuous development of manufacturing industry and the continuous improvement of product requirements, glue coating detection technology has been widely used in various manufacturing industries, and the quality of glue coating plays an important role in the performance and safety of products. As an important link in the production process of automobiles, glue coating needs to have high accuracy and high stability due to the harsh working environment and high strength. The traditional glue coating defect detection method mainly relies on manual detection, which has great disadvantages. The detection mainly depends on the experience and technical level of quality inspection personnel, and the precision is affected by human subjective factors, which has uncertainty. The existing technology has the problem of low glue coating defect detection efficiency. SUMMARY
[0003] The purpose of the present application is to provide a glue coating defect detection method and device to improve the problem of low glue coating defect detection efficiency in the prior art.
[0004] In order to achieve the above purpose, the technical scheme adopted by the embodiments of the present application is as follows:
[0005] In a first aspect, the embodiments of the present application provide a glue coating defect detection method, which comprises: acquiring a glue coating image containing a glue coating object; performing contour detection on the glue coating image to obtain a contour image; judging the size curvature form of the glue coating object according to the contour image; performing edge detection on the contour image to obtain an edge image; extracting an edge coordinate set according to the size curvature form of the glue coating object and the edge image; calculating a glue center point coordinate set according to the edge coordinate set; and determining a glue coating defect detection result according to the edge image and the glue center point coordinate set.
[0006] Further, the step of judging the size curvature form of the glue coating object according to the contour image comprises:
[0007] Traverse each row of the contour image, and count the number of pixels with a first preset pixel value in each row; compare the number of pixels with a preset number; when the number of pixels is greater than the preset number, determine that the glue coating object is of large curvature form; and when the number of pixels is less than or equal to the preset number, determine that the glue coating object is of small curvature form.
[0008] Further, the step of extracting the edge coordinate set according to the size and curvature of the object to be glued and the edge image comprises: when the object to be glued is in a large curvature mode, extracting the edge coordinate set according to the edge image according to a first preset rule; and when the object to be glued is in a small curvature mode, extracting the edge coordinate set according to the edge image according to a second preset rule.
[0009] Further, the step of extracting the edge coordinate set according to the edge image according to the first preset rule when the object to be glued is in the large curvature mode comprises: extracting the edge coordinates in the edge image by using an 8-neighborhood method to obtain the edge coordinate set.
[0010] Further, the step of extracting the edge coordinate set according to the edge image according to the second preset rule when the object to be glued is in the small curvature mode comprises: traversing each row of the edge image, and regarding each pixel point with a second preset pixel value in each row as an edge coordinate to obtain the edge coordinate set.
[0011] Further, the defect detection result comprises a diameter too wide defect, a diameter too narrow defect, a broken glue defect and a deviation defect, the object-to-be-glued center point coordinate set comprises a first center point coordinate and a second center point coordinate, and the interval between the first center point coordinate and the second center point coordinate is a preset interval value. The step of determining the defect detection result of the object to be glued according to the edge image and the object-to-be-glued center point coordinate set comprises: obtaining a normal vector of the first center point coordinate and the second center point coordinate; extracting an intersection point coordinate set of the normal vector and the edge image; judging whether the object to be glued has a diameter too wide defect, a diameter too narrow defect or a broken glue defect according to the intersection point coordinate set; and judging whether the object to be glued has a deviation defect according to the object-to-be-glued center point coordinate set and a preset standard center point coordinate set.
[0012] Further, the step of judging whether the object to be glued has a diameter too wide defect, a diameter too narrow defect or a broken glue defect according to the intersection point coordinate set comprises: calculating an object-to-be-glued diameter and an edge point distance according to the intersection point coordinate set; comparing the object-to-be-glued diameter with a preset diameter range, the preset diameter range being a first preset diameter value to a second preset diameter value, the second preset diameter value being greater than the first preset diameter value, and when the object-to-be-glued diameter is greater than the second preset diameter value, it is determined that the object to be glued has a diameter too wide defect, and when the object-to-be-glued diameter is less than the first preset diameter value, it is determined that the object to be glued has a diameter too narrow defect; and comparing the edge point distance with a preset distance value, and when the edge point distance is greater than the preset distance value, it is determined that the object to be glued has a broken glue defect.
[0013] Further, the intersection point coordinate set comprises a first intersection point coordinate, a second intersection point coordinate, a third intersection point coordinate and a fourth intersection point coordinate, the normal vector comprises a first normal vector passing through the first center point coordinate and a second normal vector passing through the second center point coordinate, the first normal vector intersects the edge image at the first intersection point coordinate and the second intersection point coordinate, the second normal vector intersects the edge image at the third intersection point coordinate and the fourth intersection point coordinate, the step of calculating the glue applying diameter and the edge point distance according to the intersection point coordinate set comprises: calculating the distance between the first intersection point coordinate and the second intersection point coordinate, or the distance between the third intersection point coordinate and the fourth intersection point coordinate, to obtain the glue applying diameter; and calculating the distance between the first intersection point coordinate and the third intersection point coordinate, or the distance between the second intersection point coordinate and the fourth intersection point coordinate, to obtain the edge point distance.
[0014] Further, the glue applying center point coordinates in the glue applying center point coordinate set and the standard center point coordinates in the standard center point coordinate set are one-to-one corresponding, the step of judging whether the glue applying has a deviation defect according to the glue applying center point coordinate set and the preset standard center point coordinate set comprises: calculating the distance between each glue applying center point coordinate and the corresponding standard center point coordinate to obtain a center point deviation value of each center point; calculating the average value of all center point deviation values to obtain a center point deviation average value; and comparing the center point deviation average value with a preset deviation value, and when the center point deviation average value is greater than the preset deviation value, it is determined that the glue applying has a deviation defect.
[0015] In the second aspect, an embodiment of the present application provides a glue applying defect detection device, which comprises: an image acquisition module configured to acquire a glue applying image containing a glue applying object; a contour detection module configured to perform contour detection on the glue applying image to obtain a contour image; a curvature judgment module configured to judge a size curvature shape of the glue applying object according to the contour image; an edge detection module configured to perform edge detection on the contour image to obtain an edge image; a coordinate extraction module configured to extract an edge coordinate set according to the size curvature shape of the glue applying object and the edge image; a center point calculation module configured to calculate a glue applying center point coordinate set according to the edge coordinate set; and a defect detection module configured to determine a glue applying defect detection result according to the edge image and the glue applying center point coordinate set.
[0016] Compared with the prior art, the embodiment of the present application has the following beneficial effects:
[0017] The embodiment of the present application provides a kind of gluing defect detection method and device, by obtaining the gluing image containing gluing object;The contour detection is carried out to gluing image, and the contour image is obtained;According to the contour image, the size curvature form of gluing object is judged;The edge detection is carried out to the contour image, and the edge image is obtained;According to the size curvature form of gluing object and the edge image, the edge coordinate set is extracted;According to the edge coordinate set, the gluing center point coordinate set is calculated;According to the edge image and the gluing center point coordinate set, the defect detection result of gluing is determined.Compared with prior art, by the edge detection of gluing image, in combination with the calculation of gluing center point coordinate set, the independent detection of gluing defect is realized, and the gluing defect detection efficiency is improved.
[0018] In order to make the above objects, features and advantages of the present application more obvious and easy to understand, the following preferred embodiments are described in detail below, and the accompanying drawings are described as follows. BRIEF DESCRIPTION OF DRAWINGS
[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments. It should be understood that the following drawings only show some embodiments of the present application, and therefore should not be regarded as a limitation on the scope. For ordinary skilled users in the art, other related drawings can also be obtained without creative labor on the basis of these drawings.
[0020] Figure 1 The block schematic diagram of the electronic device provided by the embodiment of the present application is shown.
[0021] Figure 2 The flow chart of the gluing defect detection method provided by the embodiment of the present application is shown.
[0022] Figure 3 The schematic diagram of the gluing image provided by the embodiment of the present application is shown.
[0023] Figure 4 The schematic diagram of the denoising area provided by the embodiment of the present application is shown.
[0024] Figure 5 The schematic diagram of the gluing object in large curvature form provided by the embodiment of the present application is shown.
[0025] Figure 6 The schematic diagram of the gluing object in small curvature form provided by the embodiment of the present application is shown.
[0026] Figure 7 For Figure 2 The sub-step flow chart of step S7 is shown.
[0027] Figure 8 For Figure 7 The sub-step flow chart of step S73 is shown.
[0028] Figure 9 For Figure 7 A sub-step flow chart of step S74 is shown;
[0029] Figure 10 A block schematic diagram of the glue defect detection device provided by the embodiment of the present application is shown;
[0030] Fig. 1 is a block schematic diagram of an electronic device according to an embodiment of the present application. The electronic device 100 comprises a processor 101, a memory 102, a bus 103, a communication interface 104, a display screen 105 and a camera 106. The processor 101, the memory 102, the communication interface 104, the display screen 105 and the camera 106 are connected through the bus 103. The processor 101 is configured to execute executable modules stored in the memory 102, such as computer programs. DETAILED DESCRIPTION
[0031] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments of the present application. The components of the embodiments of the present application described and shown in the drawings can be arranged and designed in various different configurations.
[0032] 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 claimed present application, but only represents 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 creative labor are within the scope of protection of the present application.
[0033] It should be noted that: similar reference numerals and letters represent similar items in the following drawings, therefore, once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. Meanwhile, in the description of the present application, the terms “first”, “second” and the like are only used to distinguish the description, and cannot be understood as indicating or implying relative importance.
[0034] The glue defect detection method provided by the embodiment of the present application is applied to an electronic device 100, please refer to Figure 1 , Figure 1 A block schematic diagram of the electronic device provided by the embodiment of the present application is shown. The electronic device 100 comprises a processor 101, a memory 102, a bus 103, a communication interface 104, a display screen 105 and a camera 106. The processor 101, the memory 102, the communication interface 104, the display screen 105 and the camera 106 are connected through the bus 103. The processor 101 is configured to execute executable modules stored in the memory 102, such as computer programs.
[0035] The processor 101 can be an integrated circuit chip with signal processing capability. In the implementation process, the steps of the glue defect detection method can be completed by the integrated logic circuit of the hardware in the processor 101 or the instructions in the form of software. The processor 101 described above can be a general-purpose processor 101, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a ready-to-program gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0036] The memory 102 can include a high-speed random access memory (RAM), and can also include a non-volatile memory, such as at least one disk memory.
[0037] The bus 103 can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. Figure 1 Only one bidirectional arrow is used to represent the bus 103, but it does not mean that there is only one bus 103 or only one type of bus 103.
[0038] The electronic device 100 realizes the communication connection with other devices outside through at least one communication interface 104 (which can be wired or wireless). The memory 102 is used to store programs, such as the glue defect detection device 200. The glue defect detection device 200 includes at least one software function module which can be stored in the form of software or firmware in the memory 102 or solidified in the operating system (OS) of the electronic device 100. The processor 101 executes the program to realize the glue defect detection method after receiving the execution instruction.
[0039] The display screen 105 is configured to display images, and the displayed content can be some processing results of the processor 101. The display screen 105 can be a touch display screen, a non-interactive display screen, or the like. The display screen 105 can display a gluing image, an edge image, a contour image, a gluing defect detection result, or the like.
[0040] The camera 106 is configured to capture a gluing image containing a gluing object and transmit the gluing image to the processor 101 for processing or to the memory 102 for storage through the bus 103.
[0041] First embodiment
[0042] Please refer to Figure 2 , Figure 2 A flowchart of a gluing defect detection method provided by an embodiment of the present application is shown. The gluing defect detection method comprises the following steps:
[0043] S1, obtaining a gluing image containing a gluing object.
[0044] In an embodiment of the present application, the camera 106 is arranged on the glue gun and can capture a real-time image of the gluing process of the glue gun to obtain a gluing image. Please refer to Figure 3 , Figure 3 A schematic diagram of a gluing image provided by an embodiment of the present application is shown. Specifically, three or more cameras 106 can be used to simultaneously capture images at a certain moment of gluing, and three images are analyzed simultaneously to determine an image containing more information of the glue strip as the gluing image. The step of obtaining a gluing image containing a gluing object can be understood as that the camera 106 captures a gluing image containing a gluing object and transmits the gluing image through the bus 103, or the gluing image can be directly obtained from the memory 102.
[0045] S2, performing contour detection on the gluing image to obtain a contour image.
[0046] In an embodiment of the present application, the gluing image is subjected to preprocessing such as original image inversion, grayscale, binarization, morphological processing, and contour search. Due to the influence of different environments and exposures, the preprocessed gluing image can have noise points or noise regions, and the influence of these parts needs to be excluded. The following methods can be used for noise removal:
[0047] 1. Calculate the connected domain of the image, and use the Seed-Filling algorithm. The algorithm flow is as follows:
[0048] (1) Scan the image until the current pixel point N(x, y) == 1:
[0049] a. Take N(x, y) as a seed (pixel position) and assign it a label, and then push all adjacent foreground pixels of the seed into the stack;
[0050] b. Pop the top pixel off the stack, assign it the same label, and then push all the foreground pixels adjacent to this top pixel back onto the stack;
[0051] c. Repeat step b until the stack is empty;
[0052] At this point, a connected region in the image has been found, and the pixels in this region have been labeled with the label;
[0053] (2) Repeat step (1) until the scan is complete.
[0054] After the scan is complete, all of the connected regions in the image have been found, and the contours with areas smaller than the threshold (area_threshold) can be discarded. At this point, single-pixel noise regions in the image background can be removed, but larger noise regions cannot be removed. The second method, which calculates the influence domain of the adhesive tape, is used.
[0055] 2. Calculate the rotating outer rectangle of the adhesive tape, remove large-area noise regions, and determine the broken adhesive contour.
[0056] If the contour areas after method 1 processing are all greater than the threshold (area_threshold) and the number of contours is greater than 1, it can be determined that either the environmental noise influence needs to be removed or the adhesive tape has already been broken. To ensure that the background noise can be completely removed and that all contours of the adhesive tape in the broken adhesive case are not lost, further processing is required. The algorithm flow of this solution is as follows:
[0057] (1) Determine the adhesive contour. The adhesive contour must pass through the calibrated glue gun region. Calculating whether the glue gun region contains the coordinates of the selected contour can determine which contour is the main adhesive contour.
[0058] (2) Remove background noise while searching for possible broken adhesive contours. Calculate the rotating outer rectangle of the adhesive, obtain the minimum two Y coordinate values of the rectangle (the glue gun is located at the top end of the picture and the center position), and the two points with the minimum Y coordinates are the bottom two points of the rectangle (leftx, lefty) and (rightx, righty). According to the coordinates of the adhesive tape centroid (C x ,C y ), determine the left region through the connection line between the centroid and the left endpoint, and determine the right region through the connection line between the centroid and the right endpoint. The intersection of the two lines with the lower edge of the image forms a triangular region. If there is a broken adhesive, the broken adhesive part must appear in this region. If it is not in this region, it must be noise and can be excluded. The schematic diagram is shown in Figure 4 .
[0059] S3, determine the size and curvature of the adhesive object based on the contour image.
[0060] In the embodiment of the present application, the step of judging the size and curvature form of the glued object according to the contour image can be understood as: traversing each row of the contour image, counting the number of pixels with the first preset pixel value in each row; comparing the number of pixels with the preset number; when the number of pixels is greater than the preset number, determining that the glued object is in a large curvature form; and when the number of pixels is less than or equal to the preset number, determining that the glued object is in a small curvature form. The contour image can be a binary image, the first preset pixel value can be a pixel value representing the glued object, and the preset number can be set according to the glue width. When the background in the contour image is white (pixel value 255) and the glued object is black (pixel value 0), the first preset pixel value is set to 0; when the background in the contour image is black and the glued object is white, the first preset pixel value is set to 255.
[0061] For example, find all contours in the contour image, draw them on a clean black background, and count the number of pixels with a value of 255 row by row and record them. The specific algorithm flow can be as follows:
[0062] 1. Start from the first row R0 to the last row R of the image width, traverse the pixels of each row pix, and set the initial value of num to 0. If pix = 255 is encountered, it is added once, that is, num = num + 1. After traversal, the num of each row is recorded, and a set Num {num0, num1, num2... num} is obtained. h i i i h theory i theory i theory
[0063] S4, edge detection is performed on the contour image to obtain an edge image.
[0064] In the embodiment of the present application, Canny operator, Laplacian operator or compass operator can be used to perform edge detection on the glued image to obtain an edge image containing edge information of the glued object.
[0065] The algorithm flow of the step of performing edge detection on the glued image to obtain an edge image can be as follows:
[0066] 1. Gradient calculation: use first derivative to calculate gradient, calculate the derivatives G x and Gy , and the gradient vector (G x , G y ) is obtained, and finally the gradient amplitude and phase angle of the pixel point are obtained:
[0067]
[0068] 2. Non-maximum suppression: the gradient value of the current pixel is compared with the gradient values of the neighboring pixels in the gradient direction, if the gradient value of the current pixel is the maximum value, it is retained, otherwise it is deleted or the pixel value is set to 0.
[0069] 3. Double-threshold edge detection and edge connection: two thresholds are set, generally the high threshold is 2.5 times the low threshold. Then, it is judged that the gradient greater than the high threshold is definitely an edge point, and the pixel value is set to 255; the gradient less than the threshold is definitely not an edge point, and the pixel value is set to 0; if the gradient is between the high and low thresholds, if the gradient values of the 8-neighborhood pixels around the pixel point are all less than the high threshold, it is not an edge point, and the pixel value is set to 0, otherwise it is set to 255.
[0070] S5, extracting the edge coordinate set according to the size, curvature form and edge image of the glued object.
[0071] In the embodiment of the present application, the step of extracting the edge coordinate set according to the size, curvature form and edge image of the glued object can be understood as follows: when the glued object is in a large curvature form, the edge coordinate set is extracted according to the edge image according to a first preset rule; when the glued object is in a small curvature form, the edge coordinate set is extracted according to the edge image according to a second preset rule. Please refer to Figure 5 and Figure 6 , Figure 5 Fig. 1 shows a schematic diagram of the glued object in a large curvature form provided by the embodiment of the present application, Figure 6 Fig. 2 shows a schematic diagram of the glued object in a small curvature form provided by the embodiment of the present application.
[0072] Specifically, when the glued object is in a large curvature form, the edge coordinates in the edge image are extracted by using the 8-neighborhood method to obtain the edge coordinate set. The first row of the edge image is traversed to determine the two edge points R left (0,j) and R right (0,j) in the first row. In the case of determining the edge points in the first row, it is determined whether the eight fields U(8) of the first edge point R left (0,j) contain coordinate points with pix=255, if yes, it indicates that the coordinate point R(i,j) and the current edge point belong to the same edge line, and then R(i,j) is taken as the center point to find whether other pix=255 points exist in the eight-neighborhood U(8) of R(i,j), and the calculation is repeated until no pix=255 point is found in the eight-neighborhood U(8) of R(i,j) to end the calculation; the second edge point Rright (0,j) is searched by the same method, and finally the edge coordinate set is obtained.
[0073] Specifically, when the coated object is in a small curvature form, each pixel point with a pixel value of a second preset pixel value in each row of the edge image is regarded as an edge coordinate, and the edge coordinate set is obtained. The second preset pixel value can be a pixel value representing the edge of the coated object. Starting from the first row R0 to the image width R h The last row ends, and the pixels pix in each row are traversed. If pix=255, the coordinates of the pixel point are recorded. Each row has at least two coordinate points, which are the left edge coordinate R left (i,j) and the right edge coordinate R right (i,j). If there are more than two coordinates, the adjacent coordinate points are clustered, and the mean value of the adjacent coordinates is taken to participate in the calculation. If there are less than two coordinates, the point is listed as an abnormal point and is no longer considered. In this way, the edge coordinate set is obtained.
[0074] S6, calculating the coated center point coordinate set according to the edge coordinate set.
[0075] In the embodiment of the present application, the edge coordinates in the edge coordinate set correspond one by one, for example, the left edge coordinate and the right edge coordinate correspond when the curvature is small, and the two edge points of the first row correspond when the curvature is large. The mean value of all corresponding edge point coordinates is calculated to obtain the center point coordinate set.
[0076] S7, determining the defect detection result of the coating according to the edge image and the coated center point coordinate set.
[0077] In the embodiment of the present application, the defect detection result can include a diameter too wide defect, a diameter too narrow defect, a broken glue defect, and a deviation defect. The coated center point coordinate set includes a first center point coordinate and a second center point coordinate, and the interval between the first center point coordinate and the second center point coordinate is a preset interval value. The first center point coordinate can be any coated center point coordinate in the coated center point coordinate set, and the second center point coordinate also belongs to the coated center point coordinate set and has a preset interval value from the first center point coordinate. The preset interval value can be set according to actual needs, for example, 5.
[0078] Referring to Figure 7 , step S7 can include the following substeps:
[0079] S71, obtaining the normal vector of the first center point coordinate and the second center point coordinate.
[0080] In the embodiment of the present application, a straight line is formed by the first center point coordinate and the second center point coordinate, and the normal vector is the normal vector of the straight line.
[0081] S72, extract the intersection point coordinate set of the normal vector and the edge image.
[0082] In the embodiment of the present application, the intersection point coordinate set represents the intersection point of the normal vector and the edge of the glued object in the edge image.
[0083] S73, determine whether the glue has the diameter too wide, diameter too narrow or broken defect according to the intersection point coordinate set.
[0084] Please refer to Figure 8 , step S73 can include the following sub-steps:
[0085] S731, calculate the glue diameter and edge point distance according to the intersection point coordinate set.
[0086] In the embodiment of the present application, the intersection point coordinate set includes the first intersection point coordinate, the second intersection point coordinate, the third intersection point coordinate and the fourth intersection point coordinate, the normal vector includes the first normal vector through the first center point coordinate and the second normal vector through the second center point coordinate, the intersection point coordinate of the first normal vector and the edge image is the first intersection point coordinate and the second intersection point coordinate, and the intersection point coordinate of the second normal vector and the edge image is the third intersection point coordinate and the fourth intersection point coordinate.
[0087] The distance between the first intersection point coordinate and the second intersection point coordinate, or the distance between the third intersection point coordinate and the fourth intersection point coordinate, is calculated to obtain the glue diameter, which can be understood as the distance between the first intersection point coordinate and the second intersection point coordinate, or the distance between the third intersection point coordinate and the fourth intersection point coordinate.
[0088] The distance between the first intersection point coordinate and the third intersection point coordinate, or the distance between the second intersection point coordinate and the fourth intersection point coordinate, is calculated to obtain the edge point distance, which can be understood as the distance between the first intersection point coordinate and the third intersection point coordinate, or the distance between the second intersection point coordinate and the fourth intersection point coordinate.
[0089] S732, compare the glue diameter with the preset diameter range, the preset diameter range is from the first preset diameter value to the second preset diameter value, the second preset diameter value is greater than the first preset diameter value, when the glue diameter is greater than the second preset diameter value, it is determined that the glue has the diameter too wide defect, and when the glue diameter is less than the first preset diameter value, it is determined that the glue has the diameter too narrow defect.
[0090] S733, compare the edge point distance with the preset distance value, when the edge point distance is greater than the preset distance value, it is determined that the glue has the broken defect.
[0091] S74, determine whether the glue has the offset defect according to the glue center point coordinate set and the preset standard center point coordinate set.
[0092] In the embodiment of the present application, the preset standard center point coordinate set is a pre-stored standard center point coordinate set. The glue application center point coordinates in the glue application center point coordinate set and the standard center point coordinates in the standard center point coordinate set are one-to-one corresponding.
[0093] Referring to Figure 9 , step S74 can include the following sub-steps:
[0094] S741, calculate the distance between each glue application center point coordinate and the corresponding standard center point coordinate to obtain each center point offset value.
[0095] In the embodiment of the present application, the center point offset value represents the distance between the glue application center point coordinate and the corresponding standard center point coordinate.
[0096] S742, calculate the mean value of all center point offset values to obtain the center point offset mean value.
[0097] In the embodiment of the present application, all center point offset values are accumulated, the sum is calculated, and then the sum is divided by the number of glue application center point coordinates participating in the calculation to obtain the center point offset mean value.
[0098] S743, compare the center point offset mean value with the preset offset value, and when the center point offset mean value is greater than the preset offset value, determine that the glue application has an offset defect.
[0099] In other embodiments of the present application, the glue application defect detection method can also include the step of returning the position coordinates of the defect and giving a warning when any kind of defect is detected.
[0100] Compared with the prior art, the embodiment of the present application has the following advantages:
[0101] Firstly, by edge detection of the glue application image and combining the calculation of the glue application center point coordinate set, the autonomous detection of the glue application defect is realized, and the glue application defect detection efficiency is improved.
[0102] Secondly, by pre-processing combined with denoising processing, the interference factors in the image processing process can be effectively excluded, and the accuracy of the glue application defect detection is improved.
[0103] Second embodiment
[0104] Referring to Figure 10 , Figure 10 The block schematic diagram of the glue application defect detection device provided by the embodiment of the present application is shown. The glue application defect detection device 200 includes an image acquisition module 210, a contour detection module 220, a curvature judgment module 230, an edge detection module 240, a coordinate extraction module 250, a center point calculation module 260, and a defect detection module 270.
[0105] The image acquisition module 210 is configured to acquire a gluing image of the gluing object.
[0106] It can be understood that the image acquisition module 210 can perform the step S1.
[0107] The contour detection module 220 is configured to perform contour detection on the gluing image to obtain a contour image.
[0108] It can be understood that the contour detection module 220 can perform the step S2.
[0109] The curvature judgment module 230 is configured to judge the curvature shape of the gluing object according to the contour image.
[0110] It can be understood that the curvature judgment module 230 can perform the step S3.
[0111] In the embodiment of the present application, the curvature judgment module 230 is specifically configured to traverse each row of the contour image, count the number of pixels with the first preset pixel value in each row, compare the number of pixels with the preset number, determine that the gluing object is in the large curvature shape when the number of pixels is greater than the preset number, and determine that the gluing object is in the small curvature shape when the number of pixels is less than or equal to the preset number.
[0112] The edge detection module 240 is configured to perform edge detection on the contour image to obtain an edge image.
[0113] It can be understood that the edge detection module 240 can perform the step S4.
[0114] The coordinate extraction module 250 is configured to extract an edge coordinate set according to the curvature shape of the gluing object and the edge image.
[0115] It can be understood that the coordinate extraction module 250 can perform the step S5.
[0116] In the embodiment of the present application, the coordinate extraction module 250 is specifically configured to extract the edge coordinate set according to the first preset rule based on the edge image when the gluing object is in the large curvature shape, and extract the edge coordinate set according to the second preset rule based on the edge image when the gluing object is in the small curvature shape.
[0117] In the embodiment of the present application, the coordinate extraction module 250 performs the step of extracting the edge coordinate set according to the first preset rule based on the edge image when the gluing object is in the large curvature shape, and is specifically configured to extract the edge coordinate in the edge image by using the 8-neighborhood method to obtain the edge coordinate set.
[0118] In the embodiment of the present application, the coordinate extraction module 250 performs the step of extracting the edge coordinate set according to the second preset rule from the edge image when the coated object is in a small curvature form, and specifically is configured to: traverse each row of the edge image, and take each pixel point with the second preset pixel value in each row as an edge coordinate to obtain the edge coordinate set.
[0119] The center point calculation module 260 is configured to calculate the coated center point coordinate set according to the edge coordinate set.
[0120] It can be understood that the center point calculation module 260 can perform the above step S6.
[0121] The defect detection module 270 is configured to determine the defect detection result of the coating according to the edge image and the coated center point coordinate set.
[0122] It can be understood that the defect detection module 270 can perform the above step S7.
[0123] In the embodiment of the present application, the defect detection result includes a diameter too wide defect, a diameter too narrow defect, a broken glue defect, and an offset defect, the coated center point coordinate set includes a first center point coordinate and a second center point coordinate, and the interval between the first center point coordinate and the second center point coordinate is a preset interval value, and the defect detection module 270 is specifically configured to: obtain the normal vector of the first center point coordinate and the second center point coordinate; extract the intersection coordinate set of the normal vector and the edge image; determine whether the coated object has a diameter too wide, a diameter too narrow, or a broken glue defect according to the intersection coordinate set; and determine whether the coated object has an offset defect according to the coated center point coordinate set and a preset standard center point coordinate set.
[0124] In the embodiment of the present application, the defect detection module 270 performs the step of determining whether the coated object has a diameter too wide, a diameter too narrow, or a broken glue defect according to the intersection coordinate set, and specifically is configured to: calculate the coated diameter and the edge point distance according to the intersection coordinate set; compare the coated diameter with a preset diameter range, the preset diameter range is a first preset diameter value to a second preset diameter value, the second preset diameter value is greater than the first preset diameter value, when the coated diameter is greater than the second preset diameter value, it is determined that the coated object has a diameter too wide defect, and when the coated diameter is less than the first preset diameter value, it is determined that the coated object has a diameter too narrow defect; and compare the edge point distance with a preset distance value, when the edge point distance is greater than the preset distance value, it is determined that the coated object has a broken glue defect.
[0125] In the embodiment of the present application, the intersection point coordinate set includes a first intersection point coordinate, a second intersection point coordinate, a third intersection point coordinate and a fourth intersection point coordinate, the normal vector includes a first normal vector passing through the first center point coordinate and a second normal vector passing through the second center point coordinate, the intersection point coordinates of the first normal vector and the edge image are the first intersection point coordinate and the second intersection point coordinate, the intersection point coordinates of the second normal vector and the edge image are the third intersection point coordinate and the fourth intersection point coordinate, the defect detection module 270 performs the step of calculating the glue application diameter and the edge point distance according to the intersection point coordinate set, and is specifically used for: calculating the distance between the first intersection point coordinate and the second intersection point coordinate, or the distance between the third intersection point coordinate and the fourth intersection point coordinate, to obtain the glue application diameter; and calculating the distance between the first intersection point coordinate and the third intersection point coordinate, or the distance between the second intersection point coordinate and the fourth intersection point coordinate, to obtain the edge point distance.
[0126] In the embodiment of the present application, the glue application center point coordinates in the glue application center point coordinate set and the standard center point coordinates in the standard center point coordinate set are one-to-one corresponding, the defect detection module 270 performs the step of judging whether the glue application exists the offset defect according to the glue application center point coordinate set and the preset standard center point coordinate set, and is specifically used for: calculating the distance between each glue application center point coordinate and the corresponding standard center point coordinate to obtain each center point offset value; calculating the average value of all center point offset values to obtain the center point offset average value; and comparing the center point offset average value with the preset offset value, and when the center point offset average value is greater than the preset offset value, it is determined that the glue application exists the offset defect.
[0127] In summary, the embodiment of the present application provides a glue application defect detection method and device, the method comprising: obtaining a glue application image containing a glue application object; performing contour detection on the glue application image to obtain a contour image; judging the size curvature form of the glue application object according to the contour image; performing edge detection on the contour image to obtain an edge image; extracting an edge coordinate set according to the size curvature form of the glue application object and the edge image; calculating a glue application center point coordinate set according to the edge coordinate set; and determining a defect detection result of the glue application according to the edge image and the glue application center point coordinate set. Compared with the prior art, the glue application defect detection method provided by the embodiment of the present application has the following advantages: first, through the edge detection of the glue application image and the calculation of the glue application center point coordinate set, the autonomous detection of the glue application defect is realized, and the glue application defect detection efficiency is improved; second, through the preprocessing and the denoising processing, the interference factors in the image processing process can be effectively excluded, and the accuracy of the glue application defect detection is improved.
[0128] In several embodiments provided in the present application, it should be understood that the disclosed apparatus and method can also be implemented by other manners. The apparatus embodiments described above are only illustrative, for example, the flow charts and block diagrams in the drawings show the possible implementation architecture, function and operation of the apparatus, method and computer program product according to the embodiments of the present application. In this regard, each block in the flow chart or block diagram can represent a module, program segment or part of code, which contains one or more executable instructions for implementing the specified logic function. It should also be noted that in some alternative implementation manners, the functions noted in the blocks can also occur in different order from that noted in the drawings. For example, two consecutive blocks can actually be executed substantially in parallel, and sometimes they can also be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flow chart, and the combination of blocks in the block diagram and / or flow chart, can be implemented by a dedicated hardware-based system performing the specified functions or actions, or can be implemented by a combination of special-purpose hardware and computer instructions.
[0129] In addition, each functional module in the embodiments of the present application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0130] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application or parts of the present application that essentially contribute to the prior art or parts of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various program code storage media. It should be noted that in this paper, relationship terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between the entities or operations. Moreover, the terms "include", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that the processes, methods, articles or devices that include a series of elements not only include those elements, but also include other elements not explicitly listed or inherent to such processes, methods, articles or devices. Without more limitations, the element defined by the statement "includes a" does not exclude the presence of other identical elements in the process, method, article or device that includes the element.
[0131] The above only describes the preferred embodiments of the present application and is not intended to limit the present application. For those skilled in the art, the present application can have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application. It should be noted that similar reference numbers 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.
Claims
1. A method of detecting a gluing defect, characterized by, The method comprises: acquiring a rubber coating image containing a rubber coating object; performing contour detection on the rubber coating image to obtain a contour image; judging the size and curvature form of the rubber coating object according to the contour image; performing edge detection on the contour image to obtain an edge image; extracting an edge coordinate set according to the size and curvature form of the rubber coating object and the edge image; calculating a rubber coating center point coordinate set according to the edge coordinate set; determining a rubber coating defect detection result according to the edge image and the rubber coating center point coordinate set, wherein the defect detection result comprises a diameter too wide defect, a diameter too narrow defect, a broken rubber defect and a deviation defect, the rubber coating center point coordinate set comprises a first center point coordinate and a second center point coordinate, the interval between the first center point coordinate and the second center point coordinate is a preset interval value, and the step of determining the rubber coating defect detection result according to the edge image and the rubber coating center point coordinate set comprises: obtaining a normal vector of the first center point coordinate and the second center point coordinate; extracting an intersection point coordinate set of the normal vector and the edge image; judging whether the rubber coating has a diameter too wide defect, a diameter too narrow defect or a broken rubber defect according to the intersection point coordinate set; the rubber coating center point coordinates in the rubber coating center point coordinate set and the standard center point coordinates in a standard center point coordinate set correspond to each other one by one; calculating the distance from each rubber coating center point coordinate to the corresponding standard center point coordinate to obtain a center point deviation value of each center point; calculating the average of all center point deviation values to obtain a center point deviation average; comparing the center point deviation average with a preset deviation value, and determining that the rubber coating has a deviation defect when the center point deviation average is greater than the preset deviation value.
2. The method of claim 1, wherein, The step of judging the size and curvature form of the rubber coating object according to the contour image comprises: traversing each row of the contour image to count the number of pixels with a first preset pixel value in each row; comparing the number of pixels with a preset number; determining that the rubber coating object is in a large curvature form when the number of pixels is greater than the preset number; determining that the rubber coating object is in a small curvature form when the number of pixels is less than or equal to the preset number.
3. The method of claim 2, wherein, The step of extracting an edge coordinate set according to the size and curvature form of the rubber coating object and the edge image comprises: extracting the edge coordinate set according to the edge image according to a first preset rule when the rubber coating object is in a large curvature form; extracting the edge coordinate set according to the edge image according to a second preset rule when the rubber coating object is in a small curvature form.
4. The method of claim 3, wherein, The step of extracting the edge coordinate set according to the edge image according to a first preset rule when the rubber coating object is in a large curvature form comprises: extracting the edge coordinates in the edge image to obtain an edge coordinate set by using an 8-neighborhood method.
5. The method of claim 3, wherein, The step of extracting the edge coordinate set according to the edge image according to a second preset rule when the rubber coating object is in a small curvature form comprises: traversing each row of the edge image, and regarding each pixel point with a second preset pixel value in each row as an edge coordinate to obtain an edge coordinate set.
6. The method of claim 1, wherein, The step of judging whether the glue coating has defects of too wide diameter, too narrow diameter or broken glue according to the intersection point coordinate set comprises: calculating the glue coating diameter and the edge point distance according to the intersection point coordinate set; comparing the glue coating diameter with a preset diameter range, the preset diameter range being from a first preset diameter value to a second preset diameter value, the second preset diameter value being greater than the first preset diameter value, when the glue coating diameter is greater than the second preset diameter value, it is determined that the glue coating has the defect of too wide diameter, and when the glue coating diameter is less than the first preset diameter value, it is determined that the glue coating has the defect of too narrow diameter; comparing the edge point distance with a preset distance value, when the edge point distance is greater than the preset distance value, it is determined that the glue coating has the defect of broken glue.
7. The method of claim 6, wherein, The intersection point coordinate set comprises a first intersection point coordinate, a second intersection point coordinate, a third intersection point coordinate and a fourth intersection point coordinate, the normal vector comprises a first normal vector passing through a first center point coordinate and a second normal vector passing through a second center point coordinate, the intersection point coordinates of the first normal vector and the edge image are the first intersection point coordinate and the second intersection point coordinate, the intersection point coordinates of the second normal vector and the edge image are the third intersection point coordinate and the fourth intersection point coordinate, the step of calculating the glue coating diameter and the edge point distance according to the intersection point coordinate set comprises: calculating the distance between the first intersection point coordinate and the second intersection point coordinate, or the distance between the third intersection point coordinate and the fourth intersection point coordinate, to obtain the glue coating diameter; calculating the distance between the first intersection point coordinate and the third intersection point coordinate, or the distance between the second intersection point coordinate and the fourth intersection point coordinate, to obtain the edge point distance.
8. A gluing defect detection apparatus characterized by comprising: The glue coating defect detection device comprises: an image acquisition module configured to acquire a glue coating image containing a glue coating object; a contour detection module configured to perform contour detection on the glue coating image to obtain a contour image; a curvature judgment module configured to judge the size curvature shape of the glue coating object according to the contour image; an edge detection module configured to perform edge detection on the contour image to obtain an edge image; a coordinate extraction module configured to extract an edge coordinate set according to the size curvature shape of the glue coating object and the edge image; a center point calculation module configured to calculate a glue coating center point coordinate set according to the edge coordinate set; a defect detection module configured to determine a defect detection result of the glue coating according to the edge image and the glue coating center point coordinate set, the defect detection result comprising defects of too wide diameter, too narrow diameter, broken glue and offset, the glue coating center point coordinate set comprising a first center point coordinate and a second center point coordinate, and the interval between the first center point coordinate and the second center point coordinate being a preset interval value, the step of determining the defect detection result of the glue coating according to the edge image and the glue coating center point coordinate set comprising: obtaining a normal vector of the first center point coordinate and the second center point coordinate; extracting an intersection point coordinate set of the normal vector and the edge image; judging whether the glue coating has defects of too wide diameter, too narrow diameter or broken glue according to the intersection point coordinate set. The glue center point coordinates in the glue center point coordinate set correspond one by one to the standard center point coordinates in the standard center point coordinate set; A distance from each glue center point coordinate to a corresponding standard center point coordinate is calculated to obtain a center point offset value of each glue center point coordinate; A mean value of all the center point offset values is calculated to obtain a center point offset mean value; The center point offset mean value is compared with a preset offset value, and when the center point offset mean value is greater than the preset offset value, it is determined that the glue has an offset defect.
Citation Information
Patent Citations
Artificial intelligence-based hot-rolled strip steel scabbing defect detection method and system
CN112712512A
Apparatus for inspecting of display panel and method thereof
KR1020140075042A