Defect detection method, device, equipment and system

Through machine vision software, the transparent tape detection image is grayscaled and background correction is performed. The transparent tape area is extracted and defects are judged in combination with the area area. The problem of low detection efficiency of transparent tape is solved and efficient and reliable automated detection is achieved.

CN115731195BActive Publication Date: 2025-09-02SHENZHEN YANXIANG JINMA SOFTWARE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211471894.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-23
Publication Date
2025-09-02
Estimated Expiration
2042-11-23

AI Technical Summary

Technical Problem

In the prior art, the detection efficiency of transparent tape defects is low, and manual testing leads to high labor intensity, high cost and unreliable detection results.

Method used

Machine vision software is used to process the detected images, and the transparent tape area is extracted through grayscale, background mean and variance correction, and the area of ​​the transparent tape area is used to determine defects to achieve automated detection.

Benefits of technology

It improves the efficiency and accuracy of transparent tape defect detection, reduces labor costs, and meets modern production needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115731195B_ABST
    Figure CN115731195B_ABST
Patent Text Reader

Abstract

The embodiment of the present application relates to the field of detection technology and discloses a defect detection method, which processes a detection image to select an empty detection item area and a detection item area, then grayscales the empty detection item area and the detection item area to obtain a grayscale image, further calculates the background mean and background variance of the grayscale image of the empty detection item area, determines the local mean and local variance of the grayscale image of the detection item area from the background mean, then corrects the grayscale value of each pixel in the grayscale image of the detection item area based on the background mean, background variance, local mean, and local variance to extract the scotch tape area, and finally determines whether the scotch tape has a defect based on the area of ​​the scotch tape area. In this way, the embodiment of the present application solves the problem of low efficiency in scotch tape defect detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of detection technology, and specifically to a defect detection method, apparatus, device, and system. Background Art

[0002] In real life, products based on visual inspection technology are ubiquitous and widely used in manufacturing inspections. In recent years, with rising labor costs and the emergence of new processes and technologies, the need for production transformation and upgrades has become increasingly urgent for domestic manufacturing companies. For labor-intensive enterprises, the most critical transformation currently lies in achieving automation and intelligentization. Replacing manual production with automated equipment and intelligent factories is fundamental to this transformation and upgrade.

[0003] For aesthetic reasons and to reduce costs, TV manufacturers use transparent tape to secure the back panel wiring. Currently, during the TV back panel inspection process, transparent tape defect detection relies on manual visual inspection to control product quality. However, manual inspection requires constant attention and focus, and eyes are exposed to the inspection environment for extended periods, which can lead to fatigue over time. This results in low defect detection efficiency and high inspection costs. Summary of the Invention

[0004] In view of the above problems, the embodiments of the present application provide a defect detection method, device, equipment and system for solving the problem of low efficiency of transparent tape defect detection in the prior art.

[0005] According to one aspect of an embodiment of the present application, a defect detection method is provided, the method comprising:

[0006] Acquire a detection image of the product to be detected; determine a detection item area and a blank detection item area based on the detection image; determine a detection item area grayscale image and a blank detection item area grayscale image by gray-scaling the detection item area and the blank detection item area; determine the background mean and background variance of the blank detection item area grayscale image; divide the detection item area grayscale image into multiple local windows; determine the number of pixels in each local window; calculate the first difference between the grayscale value of each pixel in each local window and the background mean; determine the ratio of the sum of all the first differences in each local window to the number of pixels as the value for each local window The method comprises the following steps: calculating a local mean of the first difference and a second difference of each local mean; determining a local variance of each local window as a ratio of the sum of the squares of all the second differences in each local window to the number of pixels; correcting the grayscale value of each pixel in the grayscale image of the detection item area according to the background mean, the background variance, the local mean, and the local variance, so as to increase the difference between the grayscale value at the transparent tape and the grayscale value at the background in the grayscale image of the detection item area, and obtaining an initial result image; determining the transparent tape area according to the initial result image; and judging whether the product to be inspected has defects according to the area of ​​the transparent tape area.

[0007] The inspection image is processed to select the empty inspection item area and the inspection item area. Then, the empty inspection item area and the inspection item area are grayscaled to obtain a grayscale image. The background mean and background variance of the grayscale image of the empty inspection item area can be further calculated. The local mean and local variance of the grayscale image of the inspection item area are determined from the background mean. Then, the grayscale value of each pixel in the grayscale image of the inspection item area is corrected based on the background mean, background variance, local mean, and local variance. This increases the grayscale difference between the transparent tape and the background in the grayscale image of the inspection item area to extract the transparent tape area. Finally, the area of ​​the transparent tape area is used to determine whether the transparent tape has defects. In this way, defects in the transparent tape can be effectively detected, and the defects of the transparent tape can be accurately quantified. This solves the problem of low defect detection efficiency caused by manual inspection, improves defect detection efficiency, thereby improving production efficiency and saving production costs. Moreover, by correcting the grayscale image of the detection area by the background mean and background variance and then extracting the transparent tape area, the recognition accuracy of the transparent tape defect can be improved, the reliability and stability of the detection results can be improved, and thus the accuracy of defect detection can be improved.

[0008] In one optional method, acquiring an inspection image of the product to be inspected includes: receiving a trigger signal from a photoelectric sensor, the trigger signal being generated by the photoelectric sensor when the product to be inspected is in place; controlling a camera to photograph the product to be inspected based on the trigger signal; and receiving the inspection image of the product to be inspected from the camera. This method automates the acquisition of inspection images during defect detection, saving labor costs and improving the efficiency of acquiring inspection images of the product to be inspected, thereby improving the efficiency of defect detection.

[0009] In one optional method, determining the scotch tape area based on an initial result image includes: determining a minimum grayscale value in the initial result image; subtracting the minimum grayscale value from the grayscale value of each pixel in the initial result image to obtain a first result image; obtaining a magnification factor; calculating the product of the grayscale value of each pixel in the first result image and the magnification factor; determining a maximum grayscale value in the first result image; determining the grayscale value of each pixel in the first result image as the ratio of the product to the maximum grayscale value to obtain a second result image; and determining the scotch tape area based on the second result image. By transforming the grayscale value of each pixel in the initial result image, the grayscale difference between the scotch tape and the backboard background in the detection item area can be further increased, thereby enhancing the contrast between the scotch tape and the backboard background and making the scotch tape and the backboard background clearly distinguishable.

[0010] In one optional method, determining the scotch tape region based on the second result image includes performing threshold segmentation on the second result image to determine the scotch tape region. By performing threshold segmentation on the second result image, errors in extracting the scotch tape region can be reduced, improving the reliability and stability of defect detection results, thereby increasing defect detection efficiency and reducing detection costs.

[0011] In one optional method, determining whether a defect exists on the product under inspection based on the area of ​​the transparent tape region includes: determining the area of ​​the circumscribed polygon and the area of ​​the circumscribed rectangle of the transparent tape region; calculating a first ratio between the difference between the area of ​​the circumscribed polygon and the area of ​​the circumscribed rectangle and the area of ​​the circumscribed rectangle; and determining whether a warping defect exists on the product under inspection based on the first ratio. By using the areas of the circumscribed polygon and the circumscribed rectangle of the transparent tape region, warping defects on the transparent tape can be effectively detected and accurately quantified, thereby improving the efficiency of defect detection on the transparent tape.

[0012] In one optional method, determining whether a defect exists in a product to be inspected based on the area of ​​a transparent tape region includes: filling the transparent tape region; determining a first area of ​​the transparent tape region before filling and a second area after filling; calculating a second ratio between the difference between the first area and the second area and the second area; and determining whether an internal defect exists in the product to be inspected based on the second ratio. By using the area before and after filling with the transparent tape, internal defects in the transparent tape can be effectively detected and accurately quantified, thereby improving the efficiency of defect detection for the transparent tape.

[0013] In an optional method, determining whether a defect exists in the product to be inspected based on the area of ​​the transparent tape area includes: determining a wire area in the transparent tape area, the wire area dividing the transparent tape area into a first portion and a second portion; determining the area of ​​the first portion and the area of ​​the second portion; calculating the total area of ​​the first portion and the second portion; calculating a third ratio between the area of ​​the first portion or the area of ​​the second portion and the total area; and determining whether the product to be inspected has a defect in which the adhesive wire is not centered based on the third ratio. By separately calculating the areas of the two portions divided by the wire area and the total area, the defect in which the adhesive wire is not centered can be effectively detected, and the defect in which the adhesive wire is not centered can be accurately quantified, thereby improving the efficiency of defect detection for the transparent tape.

[0014] According to another aspect of an embodiment of the present application, a defect detection device is provided, comprising: an acquisition module for acquiring a detection image of a product to be detected; a first determination module for determining a detection item area and an empty detection item area based on the detection image; a second determination module for determining a detection item area grayscale image and an empty detection item area grayscale image by gray-scaling the detection item area and the empty detection item area; a third determination module for determining a background mean and background variance of the empty detection item area grayscale image; a division module for dividing the detection item area grayscale image into a plurality of local windows; a fourth determination module for determining the number of pixels in each local window; a first calculation module for calculating a first difference between the grayscale value of each pixel in each local window and the background mean; a fifth determination module for dividing the grayscale value of each pixel in each local window into a plurality of local windows ... The ratio of the sum of all the first differences in the mouth to the number of pixels is determined as the local mean of each local window; a third calculation module is used to calculate the second difference between the first difference and each local mean; a sixth determination module is used to determine the local variance of each local window by the ratio of the sum of the squares of all the second differences in each local window to the number of pixels; a correction module is used to correct the grayscale value of each pixel in the grayscale image of the detection item area according to the background mean, background variance, local mean and local variance, so that the difference between the grayscale value at the transparent tape in the grayscale image of the detection item area and the grayscale value at the background is increased to obtain an initial result image; a seventh determination module is used to determine the transparent tape area according to the initial result image; a judgment module is used to judge whether the product to be inspected has defects based on the area of ​​the transparent tape area.

[0015] According to another aspect of an embodiment of the present application, a defect detection device is provided, including: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other through the communication bus; the memory is used to store executable instructions, and the executable instructions enable the processor to perform the operation of the defect detection method of any one of the above embodiments.

[0016] According to another aspect of the embodiments of the present application, a defect detection system is provided, comprising: a conveyor belt, a strip light source, a line scan camera, a photoelectric sensor, and a defect detection device according to the above embodiment; the conveyor belt is used to convey the product to be detected; the photoelectric sensor is connected to the defect detection device and is used to send a trigger signal to the defect detection device, the trigger signal being generated by triggering the photoelectric sensor when the product to be detected is in place; the defect detection device is used to receive the trigger signal and control the line scan camera to photograph the product to be detected according to the trigger signal; the strip light source is used to illuminate the product to be detected, the illumination area of ​​the strip light source being perpendicular to the movement direction of the conveyor belt; the line scan camera is connected to the defect detection device, the line scan area of ​​the line scan camera being perpendicular to the movement direction of the conveyor belt, the line scan area being parallel to and overlapping with the illumination area, the line scan camera being used to photograph the product to be detected, obtaining a detection image, and sending the detection image to the defect detection device; the defect detection device is also used to receive the detection image and determine whether the product to be detected has a defect based on the detection image. Through the defect detection system, the automation of detection image acquisition can be achieved, the efficiency of acquiring detection images of the product to be detected can be improved, and thus the efficiency of defect detection can be improved. In addition, the line scan area of ​​the line scan camera is parallel to and overlaps with the illumination area of ​​the strip light source, which can avoid strong reflections in the detection image and improve the reliability of the defect detection results of the transparent tape.

[0017] The above description is only an overview of the technical solutions of the embodiments of the present application. In order to more clearly understand the technical means of the embodiments of the present application, they can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the embodiments of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The accompanying drawings are only used to illustrate the embodiments and are not to be considered as limiting the present application. In addition, the same reference symbols are used to represent the same components throughout the drawings. In the drawings:

[0019] Figure 1 A schematic diagram of a defect detection method according to an embodiment of the present invention is shown;

[0020] Figure 2 A schematic diagram of the structure of the detection item area provided in one embodiment of the present application is shown;

[0021] Figure 3 A schematic diagram of a defect detection method according to another embodiment of the present invention is shown;

[0022] Figure 4 A schematic diagram of a defect detection method according to another embodiment of the present invention is shown;

[0023] Figure 5A schematic diagram of a defect detection method according to another embodiment of the present invention is shown;

[0024] Figure 6 A schematic diagram showing a circumscribed polygon and a circumscribed rectangle of a transparent tape provided in one embodiment of the present application is shown;

[0025] Figure 7 A schematic diagram of a defect detection method according to another embodiment of the present invention is shown;

[0026] Figure 8 A schematic diagram showing the area before and after the transparent tape region is filled provided by an embodiment of the present application;

[0027] Figure 9 A schematic diagram of a defect detection method according to another embodiment of the present invention is shown;

[0028] Figure 10 A schematic diagram showing the area of ​​​​scotch tape on both sides of the wire provided by an embodiment of the present application;

[0029] Figure 11 A schematic structural diagram of a defect detection device provided in one embodiment of the present application is shown;

[0030] Figure 12 A structural schematic diagram of a defect detection device provided in one embodiment of the present application is shown.

[0031] Figure 13 A structural diagram of a defect detection system provided in one embodiment of the present application is shown.

[0032] Figure 14 A schematic diagram of the top view of the conveyor belt provided in one embodiment of the present application is shown.

[0033] Figure 15 A schematic diagram of the top view of another conveyor belt provided in one embodiment of the present application is shown. DETAILED DESCRIPTION

[0034] The exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present application are shown in the drawings, it should be understood that the present application can be implemented in various forms and should not be limited to the embodiments set forth herein.

[0035] In real life, products based on visual inspection technology are ubiquitous and widely used in manufacturing inspections. In recent years, with rising labor costs and the emergence of new processes and technologies, the need for production transformation and upgrades has become increasingly urgent for domestic manufacturing companies. For labor-intensive enterprises, the most critical transformation currently lies in achieving automation and intelligentization. Replacing manual production with automated equipment and intelligent factories is fundamental to this transformation and upgrade.

[0036] Scotch tape is a fiberglass tape with excellent light transmittance. For aesthetic reasons and to reduce costs, TV manufacturers use it to secure the wiring on TV back panels. Currently, due to a lack of relevant technology, TV manufacturing relies largely on manual inspection for defects in scotch tape. Quality inspectors stand on the assembly line, inspecting each TV back panel of varying sizes for defects. Acceptable products are released, while unqualified ones are re-trim.

[0037] In the TV back panel inspection process, the transparent tape defect detection process requires manual visual inspection to control the production quality of the product. Due to the good light transmittance of transparent tape, after being pasted on the back panel, it is very close to the background color of the back panel. Therefore, manual inspection requires constant attention and concentration, which is labor-intensive. In addition, the eyes are in the inspection environment for a long time, and long working hours can easily cause fatigue, resulting in low inspection efficiency and high inspection costs. In addition, the inspection results cannot be traced, and the inspection accuracy cannot be guaranteed. Therefore, the production efficiency of manual inspection methods can no longer meet the gradually increasing requirements of modern enterprise production.

[0038] In order to solve the above problems, the inventors of this application have proposed a defect detection method. The method processes the detection image through machine vision software to obtain an empty detection item area and a detection item area. Then, the grayscale value of each pixel in the grayscale image of the empty detection item area is corrected using the mean and variance of the grayscale value of the grayscale image of the detection item area, so that the grayscale difference between the transparent tape and the background in the grayscale image of the detection item area is increased to extract the transparent tape area. Finally, the transparent tape is detected for defects based on the area of ​​the transparent tape area. Through the above method, it is only necessary to obtain an image of the TV back panel and analyze and process the image through machine vision software to extract the transparent tape area. In this way, the transparent tape can be detected for defects and the transparent tape defects can be accurately quantified. This greatly improves the judgment speed of transparent tape defect detection on the TV back panel, saves labor costs, improves defect detection efficiency, and thus improves production efficiency.

[0039] The defect detection method provided in the embodiments of the present invention requires the use of machine vision software, which may include, but is not limited to, HALCON, OpenCV, VisionPro, EVision, Cogrex, MATLAB, and LabVIEW. The embodiments of this application illustrate HALCON machine vision software as an example and do not limit the scope of protection of this application. HALCON machine vision software is a comprehensive, standard machine vision algorithm package with a widely used machine vision integrated development environment. It reduces product costs and shortens the software development cycle. HALCON's flexible architecture facilitates the rapid development of machine vision, medical imaging, and image analysis applications.

[0040] In order to solve the problem of low efficiency of transparent tape defect detection caused by manual inspection, the embodiment of the present application provides a defect detection method, which uses machine vision software to detect the transparent tape on the back panel of the TV. Please refer to Figure 1 , Figure 1 A flow chart of a defect detection method provided by an embodiment of the present application is shown. As shown in the figure, the method includes the following steps:

[0041] Step 110: Acquire a detection image of the product to be detected.

[0042] Before inspecting the scotch tape, it is first necessary to obtain an inspection image of the scotch tape, that is, an image of the TV back panel. The acquisition method includes but is not limited to shooting with an industrial camera, shooting with an ordinary camera, and intercepting from a video.

[0043] Step 120: Determine a detection item region and a blank detection item region according to the detection image.

[0044] In order to solve the problem of reduced defect detection accuracy due to uneven image illumination, HALCON's equ_histo_image operator can be used to perform image equalization on the detection image, i.e., the TV back panel image. Then, the detection item area and the empty detection item area are selected from the detection image, thereby reducing the error in the defect detection process and improving the reliability of the defect detection results. Specifically, the formula of the image equalization processing method is as follows:

[0045]

[0046] Among them, S is the total number of pixels of the detection image, Z max is the maximum value of a pixel (255 for an 8-bit grayscale image), and h(i) is the total number of pixels in the detection image whose pixel value is i or less than i.

[0047] After image equalization, you can use the draw_rectangle1 operator to select the detection item area and the empty detection item area from the detection image. The detection item area includes the transparent tape and the backboard background. For details, please refer to Figure 2 , Figure 2 A schematic diagram of the detection area is shown. As shown in the figure, 10 represents the transparent tape, 20 represents the wire attached to the transparent tape, and 30 represents the backing background. An area occupying 5% to 10% of the transparent tape can be selected around the transparent tape as the backing background. The empty detection area only includes the backing background without the transparent tape attached. This can be selected from the same detection image or from other detection images captured in the same batch with the same parameters.

[0048] Step 130: Determine a grayscale image of the detection item region and a grayscale image of the empty detection item region by performing grayscale processing on the detection item region and the empty detection item region.

[0049] Grayscale the detection item area and the empty detection item area respectively to obtain the grayscale image Gray(i,j) of the detection item area and the grayscale image gray(i,j) of the empty detection item area. Grayscale the RGB image is to perform weighted averaging on the three RGB components of the image to obtain the final grayscale value. Grayscale methods include but are not limited to component method, maximum value method and weighted average method. From the perspective of human physiology, the human eye is most sensitive to green and least sensitive to blue. Therefore, in the embodiment of the present application, weighted averaging of the three RGB components can obtain the grayscale images of the detection item area and the empty detection item area. The calculation formula is as follows:

[0050] Gray(i,j)=0.299*R(i,j)+0.587*G(i,j)+0.114*B(i,j),

[0051] gray(i,j)=0.299*r(i,j)+0.587*g(i,j)+0.114*b(i,j),

[0052] Among them, R(i,j), G(i,j), B(i,j) represent the components of the pixel in the i-th row and j-th column of the detection item area image, and r(i,j), g(i,j), b(i,j) represent the components of the pixel in the i-th row and j-th column of the empty detection item area image.

[0053] Step 140: Determine the background mean and background variance of the grayscale image of the empty detection item region.

[0054] After obtaining the grayscale value of each pixel in the grayscale image of the empty detection item area, the background mean M of the grayscale image gray(i,j) of the empty detection item area can be calculated. The calculation formula is as follows:

[0055]

[0056] Where S is the total number of pixels in the grayscale image of the empty detection item area, and H(gray(i)) is the grayscale value of the i-th pixel in the grayscale image of the empty detection item area.

[0057] Then, based on the background mean M, the background variance Q of the grayscale image in the empty detection area can be calculated. The calculation formula is as follows:

[0058]

[0059] Step 150: Divide the grayscale image of the detection item area into multiple local windows.

[0060] By correcting the grayscale image of the empty detection area using the background mean M and background variance Q of the grayscale image, the difference between the transparent tape and the backing plate background can be enhanced. Dividing the grayscale image of the detection area into local windows and then correcting each local window can reduce errors and improve the accuracy of defect detection. Specifically, the size of the local window is first determined (2n+1)(2n+1), where n≥1 and the size of the local window is smaller than the size of the detection area. Then, the center point pixel of the local window is used as the reference to move one unit pixel to the right, from left to right and from top to bottom, until each pixel in the grayscale image of the detection area has a corresponding local window.

[0061] Step 160: Determine the number of pixels in each local window.

[0062] Furthermore, the number of pixels in each local window can be determined by the size of the local window. For example, when n=1, the number of pixels in each local window is (2×1+1)(2×1+1)=9, and when n=2, the number of pixels in each local window is (2×2+1)(2×2+1)=25.

[0063] Step 170: Calculate a first difference between the grayscale value of each pixel in each local window and the background mean.

[0064] After determining the pixels in each local window, the grayscale value of each pixel in each local window can be known, and the first difference value of each pixel in each local window can be obtained by subtracting the background mean M from the grayscale value of each pixel.

[0065] Step 180: Determine the ratio of the sum of all first difference values ​​in each local window to the number of pixels as the local mean of each local window.

[0066] Specifically, after all the first differences in each local window are accumulated and divided by the number of pixels in each local window, the local mean M of each local window can be obtained. x (i,j), the calculation formula is as follows:

[0067]

[0068] Where x represents the xth local window, and Gray(k,l) is the grayscale value of the pixel in the kth row and lth column of the detection item area image.

[0069] Step 190: Calculate a second difference between the first difference and each local mean.

[0070] Specifically, calculate each first difference in each local window and the local mean M of each local window x The second difference between (i, j).

[0071] Step 200: Determine the ratio of the sum of squares of all second differences in each local window to the number of pixels as the local variance of each local window.

[0072] Specifically, all the second difference squares in each local window are accumulated and divided by the number of pixels in each local window to obtain the local variance Q of each local window. x (i,j), the calculation formula is as follows:

[0073]

[0074] Step 210: Correct the grayscale value of each pixel in the grayscale image of the detection item area according to the background mean, background variance, local mean, and local variance, so that the difference between the grayscale value at the transparent tape and the grayscale value at the background in the grayscale image of the detection item area is increased, and an initial result image is obtained.

[0075] Specifically, the background mean M, background variance Q of the grayscale image of the empty detection item area and the local mean M of the detection item area are used to calculate the background mean M and background variance Q of the grayscale image of the empty detection item area. x (i, j), local variance Q x (i, j), correct the grayscale value of each pixel in the grayscale image of the detection item area to obtain the initial result image Mult(i, j). The correction formula is as follows:

[0076]

[0077] Wherein, t is the exponent, t>1, and is generally 2, 3, 4, 5, etc., a is the correction factor, and its range is [-255, 255], and b is the correction value, and its range is [-512, 512].

[0078] For example, when the grayscale value of the transparent tape is 120, the grayscale value of the backboard background is 119, the background mean M is 116, the background variance Q is 24, and the local mean M is 116. x (i,j) is 2, local variance Q x (i, j) is 25, t is 2, a is 120, and b is 200. Before correction, the grayscale value of the transparent tape (120) and the grayscale value of the background (119) were very close, making it difficult to distinguish the transparent tape from the background. After correction, the grayscale value of the transparent tape is 2043.97, and the grayscale value of the background is 1251.39, which is significantly different and easier to distinguish.

[0079] By correcting the grayscale image of the detection item area in this way, the difference between the grayscale value of the transparent tape and the grayscale value of the backboard background in the grayscale image of the detection item area is increased, and the transparent tape and the backboard background are effectively distinguished.

[0080] Step 220: Determine the transparent tape area according to the initial result image.

[0081] Specifically, use gen_contour_region_xld to extract the transparent tape region from the initial result image.

[0082] Step 230: Determine whether the product to be inspected has defects based on the area of ​​the transparent tape region.

[0083] Specifically, the outer shape of the transparent tape area can be fitted, and the area before and after fitting can be used to determine whether the transparent tape has a warped corner defect. Furthermore, the interior of the transparent tape area can be filled, and the area before and after filling can be used to determine whether the transparent tape has an internal defect. Furthermore, the area of ​​the two transparent tape areas divided by the wire can be used to determine whether the transparent tape has a defect where the adhesive wire is not centered.

[0084] The inspection image is processed to select the empty inspection item area and the inspection item area. Then, the empty inspection item area and the inspection item area are grayscaled to obtain a grayscale image. The background mean and background variance of the grayscale image of the empty inspection item area can be further calculated. The local mean and local variance of the grayscale image of the inspection item area are determined from the background mean. Then, the grayscale value of each pixel in the grayscale image of the inspection item area is corrected based on the background mean, background variance, local mean, and local variance. This increases the grayscale difference between the transparent tape and the background in the grayscale image of the inspection item area to extract the transparent tape area. Finally, the area of ​​the transparent tape area is used to determine whether the transparent tape has defects. In this way, defects in the transparent tape can be effectively detected, and the defects of the transparent tape can be accurately quantified. This solves the problem of low defect detection efficiency caused by manual inspection, improves defect detection efficiency, thereby improving production efficiency and saving production costs. Moreover, by correcting the grayscale image of the detection area by the background mean and background variance and then extracting the transparent tape area, the recognition accuracy of the transparent tape defect can be improved, the reliability and stability of the detection results can be improved, and thus the accuracy of defect detection can be improved.

[0085] To improve the efficiency of transparent tape defect detection, according to some embodiments of the present application, optionally, please refer to Figure 3 , Figure 3 A flowchart of sub-steps of step 100 of the present application is shown. As shown in the figure, step 100 includes the following steps:

[0086] Step 111: receiving a trigger signal sent by a photoelectric sensor, where the trigger signal is generated by the photoelectric sensor when the product to be detected is in place.

[0087] Step 112: Control the photographing device to photograph the product to be inspected according to the trigger signal.

[0088] Step 113: Receive the inspection image of the product to be inspected sent by the photographing device.

[0089] Before using machine vision software to inspect scotch tape for defects, an image of the TV backplane, including the scotch tape, must first be captured. Specifically, when the front of the TV backplane triggers a photoelectric sensor, it generates a trigger signal and sends it to an industrial computer (IPC) equipped with machine vision software. Upon receiving the trigger signal, the IPC's control software activates a camera to capture the TV backplane. This camera can be an industrial camera, such as an area scan camera or a line scan camera. Finally, the camera sends the captured image to the IPC, which then uses the machine vision software to analyze and process the image.

[0090] Through the above method, the automation of detection image acquisition in the defect detection link can be achieved, which saves labor costs and improves the efficiency of obtaining detection images of the product to be inspected, thereby improving the efficiency of defect detection.

[0091] In order to improve the contrast between the transparent tape and the backboard background, so that the transparent tape is more clearly separated from the backboard background, according to some embodiments of the present application, optionally, please refer to Figure 4 , Figure 4 A flowchart of the sub-steps of step 220 of the present application is shown. As shown in the figure, step 220 includes the following steps:

[0092] Step 221: Determine the minimum grayscale value of the initial result image.

[0093] Step 222: Subtract the minimum grayscale value from the grayscale value of each pixel in the initial result image to obtain a first result image.

[0094] Step 223: Obtain the magnification factor.

[0095] Step 224: Calculate the product of the grayscale value of each pixel in the first result image and the magnification factor.

[0096] Step 225: Determine the maximum grayscale value of the first result image.

[0097] Step 226: Determine the grayscale value of each pixel in the first result image as the ratio of the product to the maximum grayscale value to obtain a second result image.

[0098] Step 227: Determine the transparent tape area according to the second result image.

[0099] First, determine the minimum grayscale value in the initial result image Mult(i,j), and then subtract the minimum grayscale value from the grayscale value of each pixel in the initial result image Mult(i,j) to obtain the first result image Sub(i,j). The calculation formula is as follows:

[0100] Sub(i,j)=Mult(i,j)-Min(Mult(i,j)),

[0101] Among them, Min(Mult(i,j)) is the minimum grayscale value in the initial result image Mult(i,j).

[0102] In the process of correcting the detection item area, after the grayscale value of each pixel is converted, there is a situation where the grayscale value exceeds the range of [0, 255]. Therefore, it is necessary to compress the grayscale value of each pixel in the first result image Sub(i, j) to the range of [0, 255]. Specifically, the amplification factor is determined to be 255, and then the product of the grayscale value of each pixel in the first result image Sub(i, j) and the amplification factor is calculated. Then, the maximum grayscale value of the first result image Sub(i, j) is determined. Finally, the grayscale value of each pixel in the first result image Sub(i, j) is re-determined as the ratio of the above product and the maximum grayscale value to obtain the second result image Com(i, j). The calculation formula is as follows:

[0103]

[0104] Among them, Max(Sub(i,j)) is the maximum grayscale value in the first result image Sub(i,j).

[0105] By transforming the grayscale value of each pixel in the initial result image, the grayscale difference between the transparent tape and the backboard background in the detection item area can be further increased, thereby enhancing the contrast effect between the transparent tape and the backboard background and making the transparent tape and the backboard background clear.

[0106] In order to more accurately extract the scotch tape area, according to some embodiments of the present application, optionally, the above step 227 includes: performing threshold segmentation on the second result image to determine the scotch tape area.

[0107] During image processing, to eliminate errors and more accurately extract the scotch tape area, we use the threshold operator to perform threshold segmentation on the second result image Com(i,j). The threshold can be set to 0.5 times the maximum grayscale value of the second result image Com(i,j). After threshold segmentation, the portion with a grayscale value greater than 0.5*Max(Com(i,j)) is the scotch tape area, and the portion with a grayscale value less than or equal to 0.5*Max(Com(i,j)) is the backplane background.

[0108] By performing threshold segmentation on the second result image, the error in extracting the transparent tape area can be reduced, and the reliability and stability of the defect detection results can be improved, thereby improving the efficiency of defect detection and reducing detection costs.

[0109] In order to detect the warping defect of the transparent tape, according to some embodiments of the present application, optionally, please refer to Figure 5 , Figure 5 A further flow chart of the defect detection method provided by an embodiment of the present application is shown. As shown in the figure, step 230 includes the following steps:

[0110] Step 231: Determine the circumscribed polygon area and the circumscribed rectangle area of ​​the transparent tape area.

[0111] To fit the transparent tape area to a polygon or rectangle, refer to Figure 6 , Figure 6 A schematic diagram of the circumscribed polygon and circumscribed rectangle of the transparent tape is shown. As shown in the figure, the circumscribed polygon area A is the area of ​​the solid line part in the figure, and the circumscribed rectangle area B is the total area of ​​the solid line part and the dotted line part in the figure.

[0112] Step 232: Calculate a first ratio between the difference between the area of ​​the circumscribed polygon and the area of ​​the circumscribed rectangle and the circumscribed rectangle.

[0113] After calculating the difference between the circumscribed polygon area A and the circumscribed rectangle area B, the first ratio Ang of the difference and the circumscribed rectangle area B is calculated, that is, the relative error. The calculation formula is as follows:

[0114]

[0115] Step 233: Determine whether the product to be inspected has a warping defect based on the first ratio.

[0116] The size of the first ratio Ang is used to determine whether the transparent tape has a warping defect. When the first ratio Ang is greater than a preset threshold, such as 5%, the transparent tape has a warping defect. When the first ratio Ang is less than or equal to 5%, the transparent tape has a 95% confidence level that it does not have a warping defect.

[0117] By measuring the area of ​​the circumscribed polygon and the circumscribed rectangle of the transparent tape area, the warping defects of the transparent tape can be effectively detected, and the warping defects of the transparent tape can be accurately quantified, thereby improving the defect detection efficiency of the transparent tape.

[0118] In order to detect internal defects of the transparent tape, according to some embodiments of the present application, optionally, please refer to Figure 7 , Figure 7A further flow chart of the defect detection method provided by an embodiment of the present application is shown. As shown in the figure, step 230 further includes the following steps:

[0119] Step 234: Fill the transparent tape area.

[0120] Step 235: Determine a first area before the scotch tape area is filled and a first area after the scotch tape area is filled.

[0121] Step 236: Calculate a second ratio between the difference between the first area and the second area and the second area.

[0122] Step 237: Determine whether the product to be inspected has internal defects based on the second ratio.

[0123] Specifically, please refer to Figure 8 , Figure 8 A schematic diagram of the area before and after the transparent tape area is filled is shown in an embodiment of the present application. As shown in the figure, before the transparent tape area is filled using machine vision software, a first area C before the transparent tape is filled is first calculated, and then a second area D after the transparent tape is filled is calculated. Then, the difference between the first area C and the second area D is calculated. Finally, a second ratio Ner of the difference to the second area D is calculated, i.e., the relative error. The calculation formula is as follows:

[0124]

[0125] Furthermore, the size of the second ratio Ner is used to determine whether the transparent tape has internal defects. When the second ratio Ner is greater than a preset threshold, such as 5%, the transparent tape has internal defects. When the second ratio Ner is less than or equal to 5%, there is a 95% confidence level that the transparent tape has no internal defects.

[0126] By measuring the area before and after the transparent tape is filled, the internal defects of the transparent tape can be effectively detected and accurately quantified, thereby improving the defect detection efficiency of the transparent tape.

[0127] In order to detect the defect of the transparent tape with the wire not being centered, according to some embodiments of the present application, optionally, please refer to Figure 9 , Figure 9 A further flow chart of the defect detection method provided by an embodiment of the present application is shown. As shown in the figure, step 230 further includes the following steps:

[0128] Step 238: Determine a wire area in the transparent tape area, where the wire area divides the transparent tape area into a first portion and a second portion.

[0129] Step 239: Determine the area of ​​the first portion and the area of ​​the second portion.

[0130] Step 240: Calculate the total area of ​​the first portion and the second portion.

[0131] Step 241: Calculate a third ratio between the area of ​​the first portion or the area of ​​the second portion and the total area.

[0132] Step 242: Determine whether the product to be inspected has a non-centered pasting wire defect based on the third ratio.

[0133] Specifically, please refer to Figure 10 , Figure 10 A schematic diagram of the tape areas on both sides of the wire provided by an embodiment of the present application is shown. As shown in the figure, the wire area 20 divides the transparent tape area into two parts. Therefore, the position of the wire area 20 in the transparent tape area must first be determined. Then, with the wire area 20 as the boundary, the area E of the first part and the area F of the second part are calculated respectively. Then, the total area E+F of the two parts is calculated. Finally, the third ratio Cen of the area F of the first part or the area F of the second part to the total area E+F is calculated. The calculation formula is as follows:

[0134]

[0135] Furthermore, the third ratio Cen can be used to determine whether the scotch tape has a non-centered adhesive wire defect. A centering range for the adhesive wire can be manually set based on demand, such as [25%, 75%]. When the third ratio Cen value is within the range of [25%, 75%], it indicates that the scotch tape adheres to the centering requirement. Otherwise, it indicates that the scotch tape has a non-centered adhesive wire defect. For example, when the third ratio Cen is 50%, the scotch tape adheres to the center. When the third ratio Cen is 20%, the scotch tape adheres to the center.

[0136] By calculating the areas of the two parts of the wire area and the total area respectively, the non-centering defect of the transparent tape can be effectively detected, and the non-centering defect of the transparent tape can be accurately quantified, thereby improving the defect detection efficiency of the transparent tape.

[0137] Figure 11 A schematic diagram of the structure of a defect detection device provided in an embodiment of the present application is shown. As shown in the figure, the defect detection device 500 includes: an acquisition module 510, a first determination module 520, a second determination module 530, a third determination module 540, a division module 550, a fourth determination module 560, a first calculation module 570, a fifth determination module 580, a third calculation module 590, a sixth determination module 600, a correction module 610, a seventh determination module 620, and a judgment module 630.

[0138] An acquisition module 510 is configured to acquire a detection image of the product to be inspected; a first determination module 520 is configured to determine a detection item region and a blank detection item region based on the scotch tape detection image; a second determination module 530 is configured to determine a grayscale image of the scotch tape detection item region and a grayscale image of the scotch tape blank detection item region by grayscale processing the scotch tape detection item region and the scotch tape blank detection item region; and a third determination module 540 is configured to determine a background mean and background variance of the grayscale image of the scotch tape blank detection item region.

[0139] A division module 550 is configured to divide the grayscale image of the scotch tape detection item area into a plurality of local windows; a fourth determination module 560 is configured to determine the number of pixels in each scotch tape local window; a first calculation module 570 is configured to calculate a first difference between the grayscale value of each pixel in each scotch tape local window and the mean of the scotch tape background; a fifth determination module 580 is configured to determine the local mean of each scotch tape local window by the ratio of the sum of all scotch tape first differences in each scotch tape local window to the number of scotch tape pixels; a third calculation module 590 is configured to calculate a second difference between the first scotch tape difference and the local mean of each scotch tape; and a sixth determination module 600 is configured to determine the local variance of each scotch tape local window by the ratio of the sum of the squares of all scotch tape second differences in each scotch tape local window to the number of scotch tape pixels.

[0140] a correction module 610 for correcting the grayscale value of each pixel in the grayscale image of the scotch tape detection item area based on the scotch tape background mean, the scotch tape background variance, the scotch tape local mean, and the scotch tape local variance, so as to increase the difference between the grayscale value of the scotch tape and the grayscale value of the background in the grayscale image of the scotch tape detection item area, thereby obtaining an initial result image;

[0141] The seventh determination module 620 is used to determine the transparent tape area according to the transparent tape initial result image; the judgment module 630 is used to judge whether the product to be inspected has defects according to the area of ​​the transparent tape area.

[0142] In an optional manner, the acquisition module 510 is also used to receive a trigger signal sent by a photoelectric sensor, where the transparent tape trigger signal is generated by triggering the transparent tape photoelectric sensor when the transparent tape product to be inspected is in place; the shooting device is controlled to shoot the transparent tape product to be inspected according to the transparent tape trigger signal; and a transparent tape detection image of the transparent tape product to be inspected sent by the transparent tape shooting device is received.

[0143] In an optional manner, the seventh determination module 620 is also used to determine the minimum grayscale value of the transparent tape initial result image; subtract the minimum grayscale value of the transparent tape from the grayscale value of each pixel in the transparent tape initial result image to obtain a first result image; obtain the magnification coefficient; determine the maximum grayscale value of the transparent tape first result image; calculate the product of the grayscale value of each pixel in the transparent tape first result image and the transparent tape magnification coefficient; determine the grayscale value of each pixel in the transparent tape first result image as the ratio of the transparent tape product to the maximum grayscale value of the transparent tape to obtain a second result image; and determine the transparent tape area based on the second result image.

[0144] In an optional manner, the seventh determining module 620 is further configured to perform threshold segmentation on the second result image of the scotch tape to determine the scotch tape area.

[0145] In an optional manner, the judgment module 630 is also used to determine the circumscribed polygon area and the circumscribed rectangular area of ​​the transparent tape area; calculate the first ratio between the difference between the circumscribed polygon area of ​​the transparent tape and the circumscribed rectangular area of ​​the transparent tape and the circumscribed rectangular area of ​​the transparent tape; and judge whether the transparent tape product to be inspected has a warping defect based on the first ratio of the transparent tape.

[0146] In an optional manner, the judgment module 630 is also used to fill the transparent tape area; determine the first area before the transparent tape area is filled and the second area after the transparent tape is filled; calculate the second ratio between the difference between the first area of ​​the transparent tape and the second area of ​​the transparent tape and the second area of ​​the transparent tape; and judge whether the transparent tape product to be inspected has internal defects based on the second ratio of the transparent tape.

[0147] In an optional manner, the judgment module 630 is also used to determine the wire area in the transparent tape area, and the transparent tape wire area divides the transparent tape area into a first part and a second part; determine the area of ​​the first part of the transparent tape and the area of ​​the second part of the transparent tape; calculate the total area of ​​the first part of the transparent tape and the second part of the transparent tape; calculate the third ratio between the area of ​​the first part of the transparent tape or the area of ​​the second part of the transparent tape and the total area of ​​the transparent tape; and judge whether the transparent tape product to be inspected has a defect of non-centered adhesive wire based on the third ratio of the transparent tape.

[0148] The defect detection device 500 processes the detection image to select the empty detection item area and the detection item area, and then grayscales the empty detection item area and the detection item area to obtain a grayscale image. The background mean and background variance of the grayscale image of the empty detection item area can be further calculated, and the local mean and local variance of the grayscale image of the detection item area are determined by the background mean. Then, the grayscale value of each pixel in the grayscale image of the detection item area is corrected according to the background mean, background variance, local mean and local variance, so that the grayscale difference between the transparent tape and the background in the grayscale image of the detection item area is increased to extract the transparent tape area, and finally the area of ​​the transparent tape area is used to determine whether the transparent tape has defects. In this way, the transparent tape can be effectively detected for defects, the transparent tape defects can be accurately quantified, the problem of low defect detection efficiency caused by manual detection can be solved, the defect detection efficiency can be improved, thereby improving production efficiency and saving production costs. In addition, the defect detection device 500 corrects the grayscale image of the detection item area through the background mean and background variance and then extracts the transparent tape area, which can also improve the recognition accuracy of transparent tape defects, improve the reliability and stability of the detection results, and thus improve the accuracy of defect detection.

[0149] Figure 12 A structural diagram of a defect detection device provided in an embodiment of the present application is shown. The specific embodiment of the present application does not limit the specific implementation of the defect detection device.

[0150] like Figure 12 As shown, the defect detection device may include: a processor (processor) 702 , a communications interface (Communications Interface) 704 , a memory (memory) 706 , and a communication bus 708 .

[0151] Processor 702, communication interface 704, and memory 706 communicate with each other via communication bus 708. Communication interface 704 is used to communicate with other devices, such as clients or other server network elements. Processor 702 is used to execute program 710, which may specifically perform the steps described in the above-mentioned defect detection method embodiment.

[0152] Specifically, the program 710 may include a program code, which includes computer-executable instructions. The processor 702 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application. The one or more processors included in the defect detection device may be processors of the same type, such as one or more CPUs; or they may be processors of different types, such as one or more CPUs and one or more ASICs. The memory 706 is used to store the program 710. The memory 706 may include a high-speed RAM memory, and may also include a non-volatile memory, such as at least one disk memory.

[0153] Program 710 may be specifically called by processor 702 to cause the defect detection device to perform the following operations:

[0154] Acquire a detection image of the product to be detected; determine the detection item area and the empty detection item area according to the scotch tape detection image; determine the detection item area grayscale image and the empty detection item area grayscale image by graying the scotch tape detection item area and the scotch tape empty detection item area; determine the background mean and background variance of the scotch tape empty detection item area grayscale image; divide the scotch tape detection item area grayscale image into multiple local windows; determine the number of pixels in each scotch tape local window; calculate the first difference between the grayscale value of each pixel in each scotch tape local window and the scotch tape background mean; determine the ratio of the sum of all scotch tape first differences in each scotch tape local window to the number of scotch tape pixels as the local value of each scotch tape local window. local mean; calculate the second difference between the first difference of the scotch tape and the local mean of each scotch tape; determine the local variance of each scotch tape local window as the ratio of the sum of the squares of all the scotch tape second differences in each scotch tape local window to the number of scotch tape pixels; correct the grayscale value of each pixel in the grayscale image of the scotch tape detection item area according to the scotch tape background mean, scotch tape background variance, the local mean of the scotch tape and the local variance of the scotch tape, so that the difference between the grayscale value at the scotch tape and the grayscale value at the background in the grayscale image of the scotch tape detection item area is increased, and an initial result image is obtained; determine the scotch tape area according to the scotch tape initial result image; judge whether the product to be inspected has defects according to the area of ​​the scotch tape area.

[0155] In an optional manner, program 710 is called by processor 702 to enable the defect detection device to perform the following operations: receive a trigger signal sent by a photoelectric sensor, the transparent tape trigger signal is generated by triggering the transparent tape photoelectric sensor when the transparent tape product to be inspected is in place; control the shooting device to shoot the transparent tape product to be inspected according to the transparent tape trigger signal; receive a transparent tape detection image of the transparent tape product to be inspected sent by the transparent tape shooting device.

[0156] In an optional manner, program 710 is called by processor 702 to enable the defect detection device to perform the following operations: determine the minimum grayscale value of the initial result image of the transparent tape; subtract the minimum grayscale value of the transparent tape from the grayscale value of each pixel in the initial result image of the transparent tape to obtain a first result image; obtain a magnification coefficient; calculate the product of the grayscale value of each pixel in the first result image of the transparent tape and the magnification coefficient of the transparent tape; determine the maximum grayscale value of the first result image of the transparent tape; determine the grayscale value of each pixel in the first result image of the transparent tape as the ratio of the transparent tape product to the maximum grayscale value of the transparent tape to obtain a second result image; and determine the transparent tape area based on the second result image of the transparent tape.

[0157] In an optional manner, the program 710 is called by the processor 702 to enable the defect detection device to perform the following operations: perform threshold segmentation on the second result image of the transparent tape to determine the transparent tape area.

[0158] In an optional manner, program 710 is called by processor 702 to enable the defect detection device to perform the following operations: determine the circumscribed polygon area and the circumscribed rectangular area of ​​the transparent tape area; calculate a first ratio between the difference between the circumscribed polygon area of ​​the transparent tape and the circumscribed rectangular area of ​​the transparent tape and the circumscribed rectangular area of ​​the transparent tape; and determine whether the transparent tape product to be inspected has a warping defect based on the first ratio of the transparent tape.

[0159] In an optional manner, program 710 is called by processor 702 to enable the defect detection device to perform the following operations: fill the transparent tape area; determine the first area of ​​the transparent tape area before filling and the second area of ​​the transparent tape area after filling; calculate the second ratio between the difference between the first area of ​​the transparent tape and the second area of ​​the transparent tape and the second area of ​​the transparent tape; and determine whether the transparent tape product to be inspected has internal defects based on the second ratio of the transparent tape.

[0160] In an optional manner, program 710 is called by processor 702 to enable the defect detection device to perform the following operations: determine the wire area in the transparent tape area, the transparent tape wire area divides the transparent tape area into a first part and a second part; determine the area of ​​the first part of the transparent tape and the area of ​​the second part of the transparent tape; calculate the total area of ​​the first part of the transparent tape and the second part of the transparent tape; calculate the third ratio between the area of ​​the first part of the transparent tape or the area of ​​the second part of the transparent tape and the total area of ​​the transparent tape; and determine whether the transparent tape product to be inspected has a defect in which the adhesive wire is not centered based on the third ratio of the transparent tape.

[0161] The processor 702 of the defect detection device performs the above operations by calling the program 710, processing the detection image to select the empty detection item area and the detection item area, and then graying the empty detection item area and the detection item area to obtain a grayscale image. The background mean and background variance of the grayscale image of the empty detection item area can be further calculated, and the local mean and local variance of the grayscale image of the detection item area can be determined by the background mean. Then, the grayscale value of each pixel in the grayscale image of the detection item area is corrected according to the background mean, background variance, local mean and local variance, so that the grayscale difference between the transparent tape and the background in the grayscale image of the detection item area is increased to extract the transparent tape area, and finally the area of ​​the transparent tape area is used to determine whether the transparent tape has defects. In this way, the transparent tape can be effectively detected for defects, the transparent tape defects can be accurately quantified, the problem of low defect detection efficiency caused by manual detection can be solved, the defect detection efficiency can be improved, thereby improving production efficiency and saving production costs. Moreover, by correcting the grayscale image of the detection area by the background mean and background variance and then extracting the transparent tape area, the recognition accuracy of the transparent tape defect can be improved, the reliability and stability of the detection results can be improved, and thus the accuracy of defect detection can be improved.

[0162] According to some embodiments of the present application, Figure 13 As shown, Figure 13 A structural schematic diagram of a defect detection system provided in an embodiment of the present application is shown. As shown in the figure, the defect detection system 800 includes a conveyor belt 810, a strip light source 820, a line scan camera 830, a photoelectric sensor 840 and the defect detection device 850 in the above embodiment.

[0163] Conveyor belt 810 is used to transport products to be inspected. Photoelectric sensor 840 is connected to defect detection device 850 and is used to send a trigger signal to defect detection device 850. This trigger signal is generated by photoelectric sensor 840 when a product to be inspected is in place. Defect detection device 850 receives the trigger signal and controls line scan camera 830 to capture images of the product to be inspected.

[0164] Bar light source 820 is used to illuminate the product under inspection. Its illumination area 860 is perpendicular to the direction of motion of conveyor belt 810. Line scan camera 830 is connected to defect detection device 850. Its line scan area 870 is perpendicular to the direction of motion of conveyor belt 810 and parallel to and overlapping with illumination area 860. Line scan camera 830 is used to capture the product under inspection, generate an inspection image, and transmit the inspection image to defect detection device 850. Defect detection device 850 is also used to receive the inspection image and, based on the inspection image, determine whether the product under inspection has defects.

[0165] Specifically, the TV back panel is placed on the conveyor belt 810. As the conveyor belt 810 moves at a constant speed from left to right or from left to right, please combine Figure 14 , Figure 14 The schematic diagram of the top view of the conveyor belt provided by the embodiment of the present application is shown. As shown in the figure, the direction of the arrow is the movement direction of the conveyor belt 810. The conveyor belt 810 has a gap in the middle along the movement direction. The photoelectric sensor 840 is set just below the gap of the conveyor belt 810 and is connected to the defect detection device 850 through an electric wire. In addition, please combine Figure 15 , Figure 15 A schematic diagram of the top view of another conveyor belt provided in an embodiment of the present application is shown. As shown in the figure, the photoelectric sensor 840 can also be installed on the side of the TV back panel, and to avoid collision with the TV back panel, it is installed outside the conveyor belt 810.

[0166] When the front end of the TV back panel triggers the photoelectric sensor 840, the photoelectric sensor 840 generates a trigger signal and sends the trigger signal to the defect detection device 850. After receiving the trigger signal, the defect detection device 850 drives the line scan camera 830 through the control software to take a picture of the TV back panel.

[0167] To ensure uniform illumination of the TV back panel image, a strip light source 820 is used to illuminate the TV back panel to ensure the brightness of the TV back panel captured by the line scan camera 830. Figure 14 A strip light source 820 is mounted above the conveyor belt 810. Its illumination area 860 is strip-shaped and perpendicular to the direction of movement of the conveyor belt 810. A line scan camera 830 is mounted above the conveyor belt 810 and connected to the defect detection device 850 via a wire. Its scanning area 870 is perpendicular to the direction of movement of the conveyor belt 810 and must be parallel to and overlap with the illumination area 860 of the strip light source 820 to ensure adequate lighting conditions for filming.

[0168] Line scan camera 830 captures only one line at a time. As the TV backplane moves forward on conveyor belt 810, line scan camera 830 continuously captures the TV backplane, ultimately forming a single image. Line scan camera 830 then transmits this captured image to defect detection device 850. The combination of line scan camera 830 and strip light source 820 creates a more uniform image of the TV backplane, eliminating strong reflections. This facilitates subsequent defect detection of transparent tape and improves the reliability of the test results.

[0169] When the defect detection device 850 receives the TV back panel image sent by the line scan camera 830, it can use machine vision software to analyze and process the TV back panel image to detect defects in the transparent tape in the TV back panel image.

[0170] Defect detection system 800 automates the acquisition of inspection images, improving the efficiency of acquiring inspection images of the product being inspected, thereby enhancing defect detection efficiency. Furthermore, the parallel and overlapping scanning area 870 of line scan camera 830 and illumination area 860 of bar light source 820 prevent strong reflections in the inspection image, thereby improving the reliability of defect detection results for transparent tape.

[0171] An embodiment of the present application provides a computer-readable storage medium storing executable instructions. When the executable instructions are executed on a defect detection device, the defect detection device executes the defect detection method in any of the above method embodiments.

[0172] An embodiment of the present application provides a computer program that can be called by a processor to enable a defect detection device to execute the defect detection method in any of the above method embodiments.

[0173] The algorithm or demonstration provided here are not inherently relevant to any particular computer, virtual system or other equipment. Various general purpose systems can also be used together with the teachings based on this. According to the above description, it is obvious that the structure required for constructing this type of system. In addition, the present application embodiment is not directed to any specific programming language yet. It should be understood that various programming languages ​​can be utilized to realize the content of the present application described here, and the above description of specific languages ​​is for the purpose of disclosing the best mode of implementation of the present application.

[0174] In the description provided herein, a large number of specific details are described. However, it is understood that the embodiments of the present application can be practiced without these specific details. In some instances, well-known methods, structures, and techniques are not shown in detail so as not to obscure the understanding of this description.

[0175] Similarly, it should be understood that in order to streamline the present application and facilitate understanding of one or more of the various inventive aspects, in the above description of exemplary embodiments of the present application, various features of the embodiments of the present application are sometimes grouped together into a single embodiment, figure, or description thereof. However, this method of disclosure should not be interpreted as reflecting an intention that the claimed application requires more features than are expressly recited in each claim.

[0176] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and set in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed herein may be combined in any combination. Unless expressly stated otherwise, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.

[0177] It should be noted that the above embodiments illustrate rather than limit the present application, and that a person skilled in the art may devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between brackets should not be construed as limiting the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present application may be implemented by means of hardware comprising several different elements and by means of appropriately programmed computers. In a unit claim enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third etc. does not indicate any order. These words may be interpreted as names. The steps in the above embodiments should not be understood as limiting the order of execution unless otherwise specified.

Claims

1. A defect detection method, characterized in that: The defect detection method comprises: Acquire a detection image of the product to be inspected; determining a detection item area and a blank detection item area according to the detection image; Determine a detection item region grayscale image and a blank detection item region grayscale image by performing grayscale processing on the detection item region and the blank detection item region; Determine the background mean and background variance of the grayscale image of the empty detection item area; Dividing the grayscale image of the detection item area into multiple local windows; determining the number of pixels in each of the local windows; Calculating a first difference between the grayscale value of each pixel in each of the local windows and the background mean; Determine a ratio of the sum of all the first differences in each of the local windows to the number of pixels as a local mean of each of the local windows; Calculating a second difference between the first difference and each of the local means; determining a ratio of a sum of squares of all the second differences in each of the local windows to the number of pixels as a local variance of each of the local windows; Correcting the grayscale value of each pixel in the grayscale image of the detection item region according to the background mean, the background variance, the local mean, and the local variance, so as to increase the difference between the grayscale value at the transparent tape and the grayscale value at the background in the grayscale image of the detection item region, thereby obtaining an initial result image; determining a transparent tape area according to the initial result map; Determine whether the product to be inspected has defects based on the area of ​​the transparent tape area; specifically, the method includes: fitting the outer shape of the transparent tape area, and determining whether the transparent tape has a warping defect through the area before and after fitting; filling the interior of the transparent tape area, and determining whether the transparent tape has internal defects through the area before and after filling; and determining whether the transparent tape has a defect in which the pasted wire is not centered through the area of ​​the two parts of the transparent tape area divided by the wire.

2. The defect detection method according to claim 1, characterized in that: The step of obtaining a detection image of the product to be detected includes: receiving a trigger signal sent by a photoelectric sensor, wherein the trigger signal is generated by triggering the photoelectric sensor when the product to be detected is in place; Controlling a photographing device to photograph the product to be inspected according to the trigger signal; Receive the detection image of the product to be detected sent by the shooting device.

3. The defect detection method according to claim 1, wherein: Determining the transparent tape area according to the initial result image includes: Determining the minimum grayscale value of the initial result image; Subtract the minimum grayscale value from the grayscale value of each pixel in the initial result image to obtain a first result image; Get the magnification factor; Calculating the product of the grayscale value of each pixel in the first result image and the magnification coefficient; Determining a maximum grayscale value of the first result image; Determine the grayscale value of each pixel in the first result image as the ratio of the product to the maximum grayscale value, to obtain a second result image; The transparent tape area is determined according to the second result map.

4. The defect detection method according to claim 3, characterized in that: The determining the transparent tape area according to the second result graph includes: Perform threshold segmentation on the second result image to determine the transparent tape area.

5. The defect detection method according to claim 1, wherein: The determining whether the product to be inspected has a defect based on the area of ​​the transparent tape region includes: Determine the circumscribed polygon area and the circumscribed rectangle area of ​​the transparent tape area; Calculating a first ratio between the difference between the area of ​​the circumscribed polygon and the area of ​​the circumscribed rectangle and the area of ​​the circumscribed rectangle; According to the first ratio, it is determined whether the product to be inspected has a warping defect.

6. The defect detection method according to claim 1, wherein: The determining whether the product to be inspected has a defect based on the area of ​​the transparent tape region includes: Filling the transparent tape area; Determine a first area of ​​the transparent tape area before filling and a second area of ​​the transparent tape area after filling; calculating a second ratio between a difference between the first area and the second area and the second area; According to the second ratio, it is determined whether the product to be inspected has internal defects.

7. The defect detection method according to claim 1, characterized in that: The determining whether the product to be inspected has a defect based on the area of ​​the transparent tape region includes: determining a wire area in the transparent tape area, wherein the wire area divides the transparent tape area into a first portion and a second portion; determining an area of ​​the first portion and an area of ​​the second portion; calculating the total area of ​​the first portion and the second portion; calculating a third ratio between the area of ​​the first portion or the area of ​​the second portion and the total area; Based on the third ratio, it is determined whether the product to be inspected has a non-centered pasting wire defect.

8. A defect detection device, characterized in that: The defect detection device comprises: An acquisition module is used to acquire a detection image of the product to be detected; A first determining module, configured to determine a detection item region and a blank detection item region according to the detection image; A second determining module is configured to determine a grayscale image of the detection item region and a grayscale image of the empty detection item region by performing grayscale processing on the detection item region and the empty detection item region; A third determination module is used to determine the background mean and background variance of the grayscale image of the empty detection item area; A division module, used to divide the grayscale image of the detection item area into multiple local windows; a fourth determining module, configured to determine the number of pixels in each of the local windows; A first calculation module is used to calculate a first difference between the grayscale value of each pixel in each of the local windows and the background mean; A fifth determining module is configured to determine a ratio of a sum of all the first differences in each local window to the number of pixels as a local mean of each local window; a third calculation module, configured to calculate a second difference between the first difference and each of the local means; a sixth determining module, configured to determine a ratio of a sum of squares of all the second differences in each local window to the number of pixels as a local variance of each local window; a correction module, configured to correct the grayscale value of each pixel in the grayscale image of the detection item area according to the background mean, the background variance, the local mean, and the local variance, so as to increase the difference between the grayscale value at the transparent tape and the grayscale value at the background in the grayscale image of the detection item area, thereby obtaining an initial result image; a seventh determining module, configured to determine a transparent tape area according to the initial result image; The judgment module is used to judge whether the product to be inspected has defects based on the area of ​​the transparent tape area; specifically, it includes: fitting the outer shape of the transparent tape area, and determining whether the transparent tape has a warping defect through the area before and after fitting; filling the interior of the transparent tape area, and determining whether the transparent tape has internal defects through the area before and after filling; and determining whether the transparent tape has a defect in which the adhesive wire is not centered through the area of ​​the two parts of the transparent tape area divided by the wire.

9. A defect detection device, characterized in that: The device includes a processor, a memory, a communication interface and a communication bus, and the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store executable instructions, and the executable instructions enable the processor to perform the operation of the defect detection method according to any one of claims 1 to 7.

10. A defect detection system, characterized in that: The defect detection system comprises a conveyor belt, a bar light source, a line scan camera, a photoelectric sensor and the defect detection device according to claim 9; The conveyor belt is used to convey the product to be inspected; The photoelectric sensor is connected to the defect detection device and is used to send a trigger signal to the defect detection device. The trigger signal is generated by triggering the photoelectric sensor when the product to be detected is in place; The defect detection device is used to receive the trigger signal to control the line scan camera to shoot the product to be inspected according to the trigger signal; The strip light source is used to illuminate the inspection product, and the illumination area of ​​the strip light source is perpendicular to the movement direction of the conveyor belt; The line scan camera is connected to the defect detection device, the line scan area of ​​the line scan camera is perpendicular to the movement direction of the conveyor belt, the line scan area is parallel to and overlaps with the illumination area, and the line scan camera is used to photograph the product to be inspected to obtain the inspection image, and send the inspection image to the defect detection device; The defect detection device is further configured to receive the detection image and determine whether the detection product has a defect based on the detection image.

Citation Information

Patent Citations

  • Method and device for detecting defects

    CN108230321A

  • Mining adhesive tape damage detection method based on dual-band infrared image

    CN110211107A