Light leakage detection method and system of LED light source, electronic equipment and storage medium

By automating the processing of LED light source images and calculating the contour roundness value, the problem of low accuracy in manual visual inspection is solved, achieving efficient and accurate light leakage detection.

CN121655844APending Publication Date: 2026-03-13LONGCHEER ELECTRONICS HUIZHOU
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511701609.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-19
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

In the current technology, the detection of light leakage of LED beads mainly relies on manual visual inspection, which is not very accurate, especially for slight light leakage.

Method used

An automated method is used to acquire the original light source image, perform grayscale processing and binarization, calculate the area and perimeter of the LED light-emitting contour image, and determine whether the contour roundness value is within the preset range, thereby achieving automatic light leakage detection.

Benefits of technology

It improves the accuracy and efficiency of LED light leakage detection, enabling quick and accurate determination of whether LED lights have light leakage problems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121655844A_ABST
    Figure CN121655844A_ABST
Patent Text Reader

Abstract

The invention relates to a light leakage detection method and system of an LED lamp bead, electronic equipment and a storage medium. The light leakage detection method of the LED lamp bead comprises the following steps: acquiring an original light source image, performing gray processing on the original light source image, and outputting a gray light source image; carrying out binarization processing on the gray light source image, and outputting a binarized foreground image and a binarized background image; carrying out calculation processing on the binarized foreground image and the binarized background image, and outputting an LED light-emitting contour image; carrying out calculation processing on the LED light-emitting contour image, and outputting a contour area value and a contour perimeter value; the contour area value and the contour perimeter value are calculated and processed, and a contour roundness value is output; and judging whether the contour roundness value is in a preset roundness value interval, and if so, outputting test data. According to the scheme provided by the invention, whether the LED lamp bead leaks light or not can be automatically detected, so that the detection accuracy is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of LED technology, and in particular to a method, system, electronic device, and storage medium for detecting light leakage of LED chips. Background Technology

[0002] In related technologies, LED chips are the main light-emitting components of LED products, capable of directly converting electrical energy into visible light. However, currently, most light leakage detection of LED chips relies on manual visual inspection, which is not very accurate, especially when slight light leakage is difficult to detect with the naked eye. Summary of the Invention

[0003] The purpose of this invention is to overcome the shortcomings of the prior art and provide a method, system, electronic device and storage medium for detecting light leakage of LED beads, which can automatically detect whether there is light leakage in LED beads, thereby improving the accuracy of detection.

[0004] The objective of this invention is achieved through the following technical solution: The first aspect of this application provides a method for detecting light leakage of LED beads, comprising: acquiring an original light source image; performing grayscale processing on the original light source image to output a grayscale light source image; performing binarization processing on the grayscale light source image to output a binarized foreground image and a binarized background image; performing calculation processing on the binarized foreground image and the binarized background image to output an LED luminous contour image; performing calculation processing on the LED luminous contour image to output a contour area value and a contour perimeter value; performing calculation processing on the contour area value and the contour perimeter value to output a contour roundness value; determining whether the contour roundness value is within a preset roundness value range, and if so, outputting test data.

[0005] The step of binarizing the grayscale light source image and outputting a binarized foreground image and a binarized background image includes: solving the grayscale light source image to generate an image grayscale histogram; analyzing the probability of each grayscale level appearing in the image grayscale histogram to obtain multiple probabilities P. i , where i is 256; based on the gray levels, output several gray ranges; combine the several gray ranges with the probabilities Pi corresponding to each gray level and perform traversal calculations using the first algorithm to output segmentation points; based on the segmentation points, obtain the binarized foreground image and the binarized background image.

[0006] The step of calculating and processing the binarized foreground image and the binarized background image to output an LED luminous contour image includes: performing erosion and dilation processing on the binarized foreground image and the binarized background image to output a first image to be processed and a second image to be processed; scanning the first image to be processed to obtain a first boundary starting point; scanning the second image to be processed to obtain a second boundary starting point; and generating the LED luminous contour image in response to a first tracking request starting from the first boundary starting point and a second tracking request starting from the second boundary starting point.

[0007] The step of calculating and processing the LED luminous contour image to output the contour area value and contour perimeter value includes: using a second algorithm to calculate the area of ​​the LED luminous contour image to obtain the contour area value; and using a third algorithm to calculate the perimeter of the LED luminous contour image to obtain the contour perimeter value.

[0008] A second aspect of this application provides a light leakage detection system for LED beads, comprising: a first image processing module for acquiring an original light source image, performing grayscale processing on the original light source image, and outputting a grayscale light source image; a second image processing module for binarizing the grayscale light source image and outputting a binarized foreground image and a binarized background image; a first calculation module for performing calculation processing on the binarized foreground image and the binarized background image and outputting an LED luminous contour image; a second calculation module for performing calculation processing on the LED luminous contour image and outputting a contour area value and a contour perimeter value; a third calculation module for performing calculation processing on the contour area value and the contour perimeter value and outputting a contour roundness value; and a comparison module for determining whether the contour roundness value is within a preset roundness value range, and if so, outputting test data.

[0009] The first calculation module is further configured to solve the grayscale light source image to generate an image grayscale histogram; analyze the probability of each grayscale level appearing in the image grayscale histogram to obtain multiple probabilities P. i , where i is 256; based on the gray levels, output several gray ranges; combine the several gray ranges with the probabilities Pi corresponding to each gray level and perform traversal calculations using the first algorithm to output segmentation points; based on the segmentation points, obtain the binarized foreground image and the binarized background image.

[0010] The second calculation module is further configured to perform erosion and dilation processing on the binarized foreground image and the binarized background image to output a first image to be processed and a second image to be processed; scan the first image to be processed to obtain a first boundary starting point; scan the second image to be processed to obtain a second boundary starting point; and generate the LED light emission contour image in response to a first tracking request starting from the first boundary starting point and a second tracking request starting from the second boundary starting point.

[0011] The third calculation module is also used to calculate the area of ​​the LED light-emitting contour image using the second algorithm to obtain the contour area value; and to calculate the perimeter of the LED light-emitting contour image using the third algorithm to obtain the contour perimeter value.

[0012] A third aspect of this application provides an electronic device, comprising: Processor; and A memory that stores executable code, which, when executed by the processor, causes the processor to perform the method described above.

[0013] A fourth aspect of this application provides a computer-readable storage medium having executable code stored thereon, which, when executed by a processor of an electronic device, causes the processor to perform the method described above.

[0014] Compared with the prior art, the present invention has at least the following advantages: This application uses an automated method to calculate the roundness value of the light-emitting area of ​​an LED bead. By comparing the roundness value with a preset acceptable threshold, it can automatically determine whether the LED bead has a light leakage problem. The entire process is efficient and highly accurate. Attached Figure Description

[0015] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly described below.

[0016] Figure 1 This is a flowchart of a method for detecting light leakage of LED beads according to an embodiment of the present invention; Figure 2 This is a flowchart illustrating another embodiment of the LED light leakage detection method according to one embodiment of the present invention. Figure 3 This is a functional block diagram of an LED light leakage detection system according to an embodiment of the present invention; Figure 4 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention. Detailed Implementation

[0017] Embodiments of this application will now be described in more detail with reference to the accompanying drawings. While embodiments of this application are shown in the drawings, it should be understood that this application may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided to make this application more thorough and complete, and to fully convey the scope of this application to those skilled in the art.

[0018] It should be understood that although the terms "first," "second," "third," etc., may be used in this application to describe various information, this information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.

[0019] Unless otherwise expressly specified and limited, the terms "installation," "connection," "linking," and "fixing," etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components. Those skilled in the art can understand the specific meaning of the above terms in this application according to the specific circumstances.

[0020] LED beads are the main light-emitting components of LED products, directly converting electrical energy into visible light. However, currently, most light leakage detection of LED beads relies on manual visual inspection, which is not very accurate, especially when slight light leakage is difficult to detect with the naked eye.

[0021] To address the aforementioned issues, this application provides a method, system, electronic device, and storage medium for detecting light leakage in LED beads, which can automatically detect whether LED beads leak light, thereby improving the accuracy of the detection.

[0022] The technical solutions of the embodiments of this application are described in detail below with reference to the accompanying drawings.

[0023] Figure 1 This is a schematic flowchart illustrating a method for detecting light leakage of LED beads according to an embodiment of this application.

[0024] See Figure 1 A method for detecting light leakage of LED beads, comprising: Step S101: Obtain the original light source image, perform grayscale processing on the original light source image, and output a grayscale light source image.

[0025] It should be noted that the product under test is placed in a designated fixture, then powered on to illuminate the LED beads. A single LED bead is then photographed to obtain the original light source image. This original image is typically in color. Since subsequent processing requires highlighting the highlights, the original image needs to be converted to grayscale, i.e., a grayscale light source image. This color-to-grayscale conversion can employ, but is not limited to, a weighted average method. This method simulates the differences in human eye sensitivity to different RGB channels, thereby improving the accuracy of the conversion.

[0026] Step S102: Binarize the grayscale light source image to output a binarized foreground image and a binarized background image.

[0027] It should be noted that this step is used to find the optimal binarization threshold, thereby segmenting the foreground and background images to preserve more image details.

[0028] Step S103: Perform calculations on the binarized foreground image and the binarized background image to output the LED luminous contour image.

[0029] It should be noted that the binarized foreground image represents the luminous portion, while the binarized background image represents the black background. By performing optimization calculations on the binarized foreground and background images, a complete LED luminous contour image is obtained.

[0030] Step S104: Calculate and process the LED light-emitting contour image, and output the contour area value and contour perimeter value.

[0031] Step S105: Calculate and process the contour area value and contour perimeter value, and output the contour roundness value.

[0032] It should be noted that the roundness value of the contour can be obtained by using the formula: roundness r = 4π * contour area / (contour perimeter * contour perimeter) based on the calculated contour area and contour perimeter values.

[0033] Step S106: Determine whether the contour roundness value is within the preset roundness value range. If so, output the test data.

[0034] It should be noted that the preset roundness value range is between 0.86 and 1. If the outline roundness value is within this range, it indicates that the LED beads do not have light leakage. The test data will also be exported locally.

[0035] See Figure 2 , Figure 2 for Figure 1 A more detailed implementation method for detecting light leakage in LED chips includes: Step S201: Obtain the original light source image, perform grayscale processing on the original light source image, and output a grayscale light source image.

[0036] The description here can be found in step S101, and will not be repeated here.

[0037] Step S202: Solve the grayscale light source image to generate an image grayscale histogram; Analyze the probability of each gray level appearing in the gray-level histogram of the image to obtain multiple probabilities P. i , where i is 256; Based on several gray levels, output several gray ranges; The first algorithm is used to iterate and calculate the segmentation points by combining several gray-level intervals with the probability Pi corresponding to each gray level; Based on the segmentation points, a binarized foreground image and a binarized background image are obtained.

[0038] It should be noted that the core of this step is to find the optimal binarization threshold to segment the foreground and background images. Compared to conventional binarization which sets a fixed value between 0 and 255 to segment images, this step is more suitable for preserving images with greater grayscale value variations. It can completely identify the weaker parts of the grayscale image and retain more image details.

[0039] Furthermore, we first calculate the image grayscale histogram from the grayscale light source image, and then analyze the probability P of each grayscale level appearing in the image grayscale histogram. i Where i = 0, 1, 2, ..., L-1, and L is the gray level, with a maximum of 256. Then, based on the gray level, multiple gray ranges are obtained, and this application has two gray ranges. Specifically, all possible thresholds K are traversed within the (0, L-1) range, and this K value is used as a segmentation point to divide the image pixels into two regions, foreground and background. It is assumed that foreground pixel C1 is in the [0, K] range with a probability p1, and background pixel C2 is in the [K, L-1] range with a probability p2. Then, the first algorithm is used: p1 + p2 = 1; C1*p1+C2*p2=CG; m 2 =p1*(C1-CG)+p2*(C2-CG) It can be simplified to: m 2 =p1*p2*(C1-C2)² Where CG is the global mean of the pixels, m 2 To incorporate weighted bias, the first algorithm can obtain the K value, or segmentation point, from 0 to 255 gray levels. This allows for the segmentation of the foreground and background images.

[0040] Step S203: Perform erosion and dilation processing on the binarized foreground image and the binarized background image to output the first image to be processed and the second image to be processed. Scan the first image to be processed to obtain the first boundary starting point; Scan the second image to be processed to obtain the second boundary starting point; In response to a first tracing request starting from a first boundary starting point and a second tracing request starting from a second boundary starting point, an LED luminous contour image is generated.

[0041] It should be noted that this step is to eliminate noise generated in the binarized image, as well as to remove image artifacts and other small contour regions that affect judgment. This application predefines a structuring element to generate a 3x3 elliptical structure matrix kernel. This elliptical kernel determines the geometry and computational range of neighboring pixels; for example, a defined circular kernel can better handle objects with smooth edges. Next, the image is first subjected to erosion processing. Erosion eliminates isolated points smaller than the structuring element and breaks narrow connected regions. After erosion, the contour area is proportionally reduced, and then proportionally enlarged through dilation, ensuring the original contour size remains unchanged.

[0042] It should also be noted that after the erosion and expansion, the image is scanned sequentially from the top left to the bottom right, using a specific kernel template to detect boundary starting points. The first boundary starting point is the outer boundary of the geometry, and the second boundary starting point is the boundary of the internal cavity of the geometry. In simpler terms, the outer edge of the geometry belongs to the black background image, and the boundary of the internal cavity belongs to the luminous white area. After identifying the boundary starting points, a boundary tracing process begins. The outer boundary is traced counter-clockwise, and the inner boundary is traced clockwise. During tracing, the presence of foreground pixels within the eight neighbors of the current point is checked cyclically. Boundary continuity is determined by the starting point, center point, and new neighbor. This process yields a clear and complete LED luminous contour image.

[0043] Step S204: Calculate the area of ​​the LED light-emitting contour image using the second algorithm to obtain the contour area value; calculate the perimeter of the LED light-emitting contour image using the third algorithm to obtain the contour perimeter value.

[0044] It should be noted that the second algorithm is based on Green's theorem and the cross product of vectors. Specifically, the area of ​​the entire luminous region contour is calculated by integrating the coordinates of each contour point tracked in step S203. Starting from the first point of the contour that is identified, three adjacent points [P] are obtained sequentially. a ,P (a+1) ,P (a+2) ], calculate the cross product of these three points: Cr=[X a *Y (a+1) -X (a+1)*Y a ], where X a Y is the x-axis. a The vertical coordinate is denoted as y. Then, all contour points are calculated using the cross product and summed. The absolute value of this sum is multiplied by 0.5, and the resulting area is the contour area value.

[0045] It should also be noted that, since the extracted object contours are irregular regions, the total length of the curve can be estimated by accumulating the Euclidean distances between adjacent points. The third algorithm can be: Among them, X a Y is the x-axis. a Using the ordinate as the vertical axis, the above formula iterates through all contour points, calculates the Euclidean distance between adjacent points, and accumulates the results, where n is the total number of points on the contour. When contour points overlap, the first and last points can be considered connected. In this case, the distance between the first and last points is calculated separately and added to the previously accumulated value. Therefore, the contour perimeter value can be obtained at this point.

[0046] Step S205: Calculate and process the contour area value and contour perimeter value, and output the contour roundness value.

[0047] The description of this step can be found in step S105, and will not be repeated here.

[0048] Step S206: Determine whether the contour roundness value is within the preset roundness value range. If so, output the test data.

[0049] This step can be described in step S106, and will not be repeated here.

[0050] Corresponding to the aforementioned application function implementation method embodiments, this application also provides an LED light leakage detection system, electronic device, and corresponding embodiments.

[0051] Figure 3 This is a functional block diagram of an LED light leakage detection system shown in an embodiment of this application.

[0052] See Figure 3A light leakage detection system for LED beads includes a first image processing module 100, a second image processing module 200, a first calculation module 300, a second calculation module 400, a third calculation module 500, and a comparison module 600. The first image processing module 100 acquires an original light source image, performs grayscale processing on the original light source image, and outputs a grayscale light source image. The second image processing module 200 performs binarization processing on the grayscale light source image and outputs a binarized foreground image and a binarized background image. The first calculation module 300 performs calculation processing on the binarized foreground image and the binarized background image and outputs an LED light-emitting contour image. The second calculation module 400 performs calculation processing on the LED light-emitting contour image and outputs a contour area value and a contour perimeter value. The third calculation module 500 performs calculation processing on the contour area value and the contour perimeter value and outputs a contour roundness value. The comparison module 600 determines whether the contour roundness value is within a preset roundness value range; if so, it outputs test data.

[0053] See Figure 3 In one embodiment, the first calculation module 300 is further configured to process the grayscale light source image to generate an image grayscale histogram; analyze the probability of each grayscale level appearing in the image grayscale histogram to obtain multiple probabilities P. i , where i is 256; based on several gray levels, output several gray ranges; combine the several gray ranges with the probability Pi corresponding to each gray level and use the first algorithm to perform traversal calculations to output segmentation points; based on the segmentation points, obtain the binarized foreground image and the binarized background image.

[0054] See Figure 3 In one embodiment, the second calculation module 400 is further configured to perform erosion and dilation processing on the binarized foreground image and the binarized background image, and output a first image to be processed and a second image to be processed; scan the first image to be processed to obtain a first boundary starting point; scan the second image to be processed to obtain a second boundary starting point; and generate an LED light-emitting contour image in response to a first tracking request starting from the first boundary starting point and a second tracking request starting from the second boundary starting point.

[0055] See Figure 3 In one embodiment, the third calculation module 500 is further configured to calculate the area of ​​the LED light-emitting contour image using the second algorithm to obtain the contour area value; and to calculate the perimeter of the LED light-emitting contour image using the third algorithm to obtain the contour perimeter value.

[0056] Regarding the system in the above embodiments, the specific ways in which each module performs operations have been described in detail in the embodiments related to the method, and will not be elaborated further here.

[0057] Figure 4This is a schematic diagram of the structure of an electronic device shown in an embodiment of this application.

[0058] See Figure 4 The electronic device 1000 includes a memory 1010 and a processor 1020.

[0059] The processor 1020 can be a central processing unit (CPU), or it can be an integrated circuit composed of other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be any conventional processor that can run the Linux kernel.

[0060] Memory 1010 may include various types of storage units, such as system memory, read-only memory (ROM), and permanent storage devices. ROM may store static data or instructions required by processor 1020 or other modules of the computer. Permanent storage devices may be read-write storage devices. Permanent storage devices may be non-volatile storage devices that retain stored instructions and data even when the computer is powered off. In some embodiments, permanent storage devices use mass storage devices (e.g., magnetic or optical disks, flash memory) as permanent storage devices. In other embodiments, permanent storage devices may be removable storage devices (e.g., floppy disks, optical drives). System memory may be a read-write storage device or a volatile read-write storage device, such as dynamic random access memory. System memory may store some or all of the instructions and data required by the processor during operation. Furthermore, memory 1010 may include any combination of computer-readable storage media, including various types of semiconductor memory chips (e.g., DRAM, SRAM, SDRAM, flash memory, programmable read-only memory), and disks and / or optical disks may also be used. In some embodiments, the memory 1010 may include a removable storage device that is readable and / or writable, such as a laser disc (CD), a read-only digital multifunction optical disc (e.g., DVD-ROM, dual-layer DVD-ROM), a read-only Blu-ray disc, an ultra-high density optical disc, a flash memory card (e.g., SD card, mini SD card, Micro-SD card, etc.), a magnetic floppy disk, etc. Computer-readable storage media do not contain carrier waves or transient electronic signals transmitted wirelessly or via wired connections.

[0061] The memory 1010 stores executable code, which, when processed by the processor 1020, can cause the processor 1020 to execute part or all of the methods described above.

[0062] Furthermore, the method according to this application can also be implemented as a computer program or computer program product, which includes computer program code instructions for performing some or all of the steps in the method described above.

[0063] Alternatively, this application may be implemented as a computer-readable storage medium (or a non-transitory machine-readable storage medium or a machine-readable storage medium) storing executable code (or computer program or computer instruction code) thereon, which, when executed by a processor of an electronic device (or server, etc.), causes the processor to perform part or all of the steps of the methods described above according to this application.

[0064] The solution of this application has been described in detail above with reference to the accompanying drawings. In the above embodiments, the descriptions of each embodiment have different focuses; for parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments. Those skilled in the art should also understand that the actions and modules involved in the specification are not necessarily essential to this application. Furthermore, it is understood that the steps in the method of this application embodiment can be adjusted, combined, and deleted according to actual needs, and the modules in the device of this application embodiment can be combined, divided, and deleted according to actual needs. The various embodiments of this application have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or improvement of the technology in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.

Claims

1. A method for detecting light leakage of LED beads, characterized in that, include: Acquire the original light source image, perform grayscale processing on the original light source image, and output a grayscale light source image; The grayscale light source image is binarized to output a binarized foreground image and a binarized background image; The binarized foreground image and the binarized background image are processed to output the LED luminous contour image; The LED light-emitting contour image is processed to calculate and output the contour area value and contour perimeter value. The contour area value and the contour perimeter value are calculated and processed to output the contour roundness value; Determine whether the outline roundness value is within the preset roundness value range. If so, output the test data.

2. The LED light leakage detection method according to claim 1, characterized in that, The step of binarizing the grayscale light source image to output a binarized foreground image and a binarized background image includes: The grayscale light source image is processed to generate an image grayscale histogram; Analyze the probability of each gray level appearing in the gray-level histogram of the image to obtain multiple probabilities P. i , where i is 256; Based on the aforementioned gray levels, output several gray level ranges; The first algorithm is used to iterate and calculate the segmentation points by combining the probability Pi corresponding to each gray level with the gray ranges and then outputting the segmentation points. Based on the segmentation points, the binarized foreground image and the binarized background image are obtained.

3. The LED light leakage detection method according to claim 1, characterized in that, The step of calculating and processing the binarized foreground image and the binarized background image to output the LED luminous contour image includes: The binarized foreground image and the binarized background image are subjected to erosion and dilation processing to output a first image to be processed and a second image to be processed. Scan the first image to be processed to obtain the first boundary starting point; Scan the second image to be processed to obtain the second boundary starting point; In response to a first tracking request starting from the first boundary and a second tracking request starting from the second boundary, the LED luminous contour image is generated.

4. The method for detecting light leakage of LED beads according to claim 1, characterized in that, The step of calculating and processing the LED light-emitting contour image to output the contour area value and contour perimeter value includes: The area of ​​the LED light-emitting contour image is calculated using the second algorithm to obtain the contour area value; The perimeter of the LED luminous contour image is calculated using a third algorithm to obtain the contour perimeter value.

5. A light leakage detection system for LED beads, characterized in that, include: The first image processing module is used to acquire the original light source image, perform grayscale processing on the original light source image, and output a grayscale light source image. The second image processing module is used to binarize the grayscale light source image and output a binarized foreground image and a binarized background image. The first calculation module is used to perform calculation processing on the binarized foreground image and the binarized background image, and output the LED luminous contour image; The second calculation module is used to calculate and process the LED light-emitting contour image and output the contour area value and contour perimeter value. The third calculation module is used to calculate and process the contour area value and the contour perimeter value, and output the contour roundness value. The comparison module is used to determine whether the contour roundness value is within the preset roundness value range. If so, it outputs test data.

6. The LED light leakage detection system according to claim 5, characterized in that, The first calculation module is also used to solve the grayscale light source image and generate an image grayscale histogram; Analyze the probability of each gray level appearing in the gray-level histogram of the image to obtain multiple probabilities P. i , where i is 256; Based on the aforementioned gray levels, output several gray level ranges; The first algorithm is used to iterate and calculate the segmentation points by combining the probability Pi corresponding to each gray level with the gray ranges and then outputting the segmentation points. Based on the segmentation points, the binarized foreground image and the binarized background image are obtained.

7. The LED light leakage detection system according to claim 5, characterized in that, The second calculation module is also used to perform erosion and dilation processing on the binarized foreground image and the binarized background image, and output a first image to be processed and a second image to be processed; Scan the first image to be processed to obtain the first boundary starting point; Scan the second image to be processed to obtain the second boundary starting point; In response to a first tracking request starting from the first boundary and a second tracking request starting from the second boundary, the LED luminous contour image is generated.

8. The LED light leakage detection system according to claim 5, characterized in that, The third calculation module is also used to calculate the area of ​​the LED light-emitting contour image using the second algorithm to obtain the contour area value; The perimeter of the LED luminous contour image is calculated using a third algorithm to obtain the contour perimeter value.

9. An electronic device, characterized in that, include: processor; as well as A memory having executable code stored thereon, which, when executed by the processor, causes the processor to perform the method as described in any one of claims 1-4.

10. A computer-readable storage medium having executable code stored thereon, which, when executed by a processor of an electronic device, causes the processor to perform the method as described in any one of claims 1-4.