LED lamp bead defect detection method and system
By pre-processing and feature analysis of the surface image of LED lamp beads, combined with region growth algorithm and grating stripe analysis, the problems of incomplete detection of LED lamp bead defects in the existing technology are solved, and the accuracy of multiple defect features is achieved is achieved, which improves the degree of refinement and accuracy of detection.
Patent Information
- Application Number
- CN202510435526.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-09
- Publication Date
- 2025-05-09
- Estimated Expiration
- 2045-04-09
AI Technical Summary
The prior art is difficult to accurately capture a variety of defect characteristics in LED lamp bead defect detection, especially in crack detection, it is difficult to distinguish background noise from crack paths. Small areas of dark spots are easily missed in dark spot detection, and surface deformation cannot be accurately identified, resulting in incomplete detection results and insufficient accuracy.
By preprocessing the surface image of LED lamp beads, the gradient direction of pixel points is analyzed, the crack direction distribution characteristics are constructed, and the crack path is dynamically expanded in combination with the region growth algorithm. At the same time, the dark spot area is marked by the grayscale entropy value calculated by partial blocks of the image, and the surface depression features are analyzed using grating stripes, and finally these features are integrated to generate a multi-feature defect distribution map.
Accurate identification of complex crack morphology is achieved, the phenomenon of incomplete crack path identification is reduced, the accuracy and consistency of dark spot detection is improved, the shape and location of micro-depressed areas are accurately captured, and the degree of refinement of detection is improved.
Smart Images

Figure CN119963547A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of lamp bead image processing, and in particular to a method and system for detecting defects in LED lamp beads. Background Art
[0002] The LED lamp bead defect detection method refers to a technology that automatically detects defects on the surface of LED lamp beads through specific image acquisition and processing methods. It mainly targets surface defects such as cracks, bubbles, dark spots, color difference, etc. that may appear in the production of lamp beads. It uses high-resolution camera equipment to collect lamp bead surface images, and uses image segmentation, feature extraction and pattern recognition to locate and classify defective areas, and make a judgment on whether the lamp beads meet the quality requirements.
[0003] Although the existing technology can detect defects on the surface of LED lamp beads through image acquisition and segmentation, it is difficult to accurately capture multiple defect features and integrate complex features. In crack detection, the existing technology mostly relies on simple grayscale change analysis, which makes it difficult to distinguish between background noise and crack paths, especially when the crack paths are crossed or bent, which can easily lead to incomplete crack detection results. In dark spot detection, the existing technology mostly marks through simple statistics of pixel values, but it is easy to miss smaller dark spot areas for subtle grayscale differences in block areas, or misjudge high-contrast backgrounds as defects, affecting detection accuracy. In terms of sag detection, the existing technology lacks quantitative analysis methods for lamp bead surface deformation, and cannot accurately identify the distribution of sags in small areas, resulting in large deviations in the judgment of surface deformation, especially in lamp beads with uneven surfaces, which are prone to identification blind spots, resulting in significant limitations in the accuracy and completeness of the detection results. Summary of the invention
[0004] The purpose of the present invention is to solve the shortcomings existing in the prior art and to propose a method and system for detecting defects in LED lamp beads.
[0005] In order to achieve the above object, the present invention adopts the following technical solution: a method for detecting defects of LED lamp beads, comprising the following steps: S1: Collect the original image of the LED lamp bead surface and preprocess it to obtain the preprocessed LED lamp bead surface image, analyze the gradient direction of each pixel point according to the grayscale change of each pixel point in the horizontal and vertical directions in the preprocessed LED lamp bead surface image, obtain the area with continuous gradient direction, and generate the distribution characteristics of the crack direction of the LED lamp bead; S2: Starting from the gradient direction continuous region in the crack direction distribution characteristics of the LED lamp bead, gradually expand the adjacent regions of the gradient direction continuous region and dynamically adjust the expansion conditions during the expansion process, and generate the crack path of the LED lamp bead according to the expansion result; S3: locally segmenting the pre-processed LED lamp bead surface image into a plurality of fixed-size block areas, calculating the grayscale entropy values of the block areas, marking the suspected dark spot areas in each block area after local segmentation with reference to the grayscale entropy values, and generating LED lamp bead dark spot features; S4: Project grating stripes onto the surface of LED lamp beads, analyze the bending and spacing changes of the grating stripes, calibrate the concave deformation area of the grating stripes, and generate the concave features of the LED lamp bead surface; S5: Integrate the crack path of the LED lamp bead, the dark spot characteristics of the LED lamp bead, and the depression characteristics on the surface of the LED lamp bead and display them in a visual manner to generate a multi-feature defect distribution map of the LED lamp bead.
[0006] As a further solution of the present invention, the steps for obtaining the crack direction distribution characteristics of the LED lamp bead are specifically as follows: S101: collecting the original image of the LED lamp bead surface and preprocessing it, including using Gaussian filtering to remove random noise in the original image, enhancing the overall grayscale of the original image through histogram equalization, and generating a preprocessed LED lamp bead surface image; S102: using the Sobel operator to calculate the grayscale variation of each pixel in the preprocessed LED lamp bead surface image in the horizontal direction and the vertical direction respectively, analyzing the gradient direction of each pixel according to the grayscale variation, and constructing a grayscale gradient direction distribution map according to the gradient direction; S103: Compare the gradient direction of each pixel in the grayscale gradient direction distribution map with the gradient direction of adjacent pixels and a preset continuity threshold one by one, mark the area of continuous pixels according to the comparison result, and generate the LED lamp bead crack direction distribution feature according to the area of continuous pixels.
[0007] As a further solution of the present invention, the steps for obtaining the crack path of the LED lamp bead are specifically as follows: S201: Starting from the gradient direction continuous region in the crack direction distribution characteristics of the LED lamp bead, a regional growth algorithm is used to gradually expand the adjacent regions of the gradient direction continuous region and dynamically adjust the expansion conditions during the expansion process, using the formula: ; Calculate the continuity threshold after dynamic expansion , through the continuity threshold after dynamic expansion Dynamically adjust the expansion conditions during the expansion process to identify continuous paths, cross paths, and curved paths in the expansion path to generate a complete expansion area; in, is the continuity threshold, It is used to control The adjustment factor is set according to the expansion range. It represents the total number of pixels obtained by gradually expanding the gradient direction continuous area extracted from the crack direction distribution characteristics of the LED lamp bead as the initial area; S202: Based on the complete extended area, by comparing the gradient direction of each pixel point with the average direction of the current extended area, if the gradient direction of the target pixel point deviates from the average direction of the current area and the deviation value exceeds the continuity threshold after dynamic expansion, the target pixel point is marked as a noise point, and the noise point is eliminated to generate the crack path of the LED lamp bead.
[0008] As a further solution of the present invention, the step of calculating the grayscale entropy value of the block area is specifically: S301: locally segmenting the pre-processed LED lamp bead surface image into a plurality of fixed-size block regions, each of which contains the same number of pixels, and generating a locally segmented block image data set according to the segmentation result; S302: Based on the local segmented block image data set, the formula is used: ; Calculate the grayscale entropy value of the block area after local segmentation of the LED lamp bead surface image after preprocessing ; in, It is the grayscale used to identify the grayscale value range in the pre-processed LED lamp bead surface image. is the total number of gray levels in the block area of the LED lamp bead surface image after preprocessing, is a weighting factor used to adjust the grayscale contribution setting, Is grayscale The probability in the corresponding pre-processed LED lamp bead surface image block area, is the gray level probability The logarithmic value of .
[0009] As a further solution of the present invention, the steps for obtaining the dark spot characteristics of the LED lamp beads are specifically as follows: S311: by comparing the grayscale entropy value of each block area with a preset grayscale threshold one by one, marking the area with a grayscale entropy value lower than the grayscale threshold as a suspected dark spot area, and generating a preliminary marking result; S312: Based on the preliminary marking result, check the neighborhood of each suspected dark spot area, remove isolated points in the suspected dark spot area according to the inspection result, integrate the remaining area, and generate LED lamp bead dark spot features.
[0010] As a further solution of the present invention, the steps for obtaining the concave features on the surface of the LED lamp bead are specifically as follows: S401: Projecting grating stripes onto the surface of the LED lamp bead, collecting grating stripe images and scanning the center position of the grating stripes by adjusting the projection angle and intensity of the grating stripe light source, analyzing the bending and spacing changes of adjacent grating stripes at the center position, and generating grating stripe change analysis results; S402: Based on the grating stripe change analysis result, the positions where the bending and spacing changes of the grating stripes exceed the preset change threshold are screened, and the corresponding concave deformation areas are calibrated according to the screening results to generate the concave features of the LED lamp bead surface.
[0011] As a further solution of the present invention, the steps for obtaining the multi-feature defect distribution map of the LED lamp bead are specifically as follows: S501: Integrate the crack path, dark spot features and surface depression features of the LED lamp beads, perform spatial mapping and alignment with the original LED lamp bead surface image, and generate an integrated marked image by extracting and superimposing each type of defect area through boundaries; S502: Based on the integrated marked image, the attributes of each type of defect area are classified and counted, wherein the attributes of each type of defect area include quantity, area and distribution range data, and a multi-feature defect distribution map of LED lamp beads is generated in combination with the statistical results.
[0012] A LED lamp bead defect detection system, the system comprising: The image preprocessing module collects the original image of the LED lamp bead surface and preprocesses it to obtain the preprocessed LED lamp bead surface image. According to the grayscale change of each pixel point in the horizontal and vertical directions in the preprocessed LED lamp bead surface image, the gradient direction of each pixel point is analyzed, the area with continuous gradient direction is obtained, and the distribution characteristics of the crack direction of the LED lamp bead are generated; The crack path generation module starts from the gradient direction continuous area in the crack direction distribution characteristics of the LED lamp bead, gradually expands the adjacent areas of the gradient direction continuous area and dynamically adjusts the expansion conditions during the expansion process, and generates the crack path of the LED lamp bead according to the expansion results; The dark spot feature extraction module locally divides the pre-processed LED lamp bead surface image into a plurality of fixed-size block areas, calculates the grayscale entropy value of the block area, marks the area suspected of dark spots in each block area after local segmentation with reference to the grayscale entropy value, and generates the LED lamp bead dark spot feature; The surface depression analysis module projects grating stripes onto the surface of LED lamp beads, analyzes the bending and spacing changes of the grating stripes, calibrates the concave deformation area of the grating stripes, and generates the surface depression features of the LED lamp beads; The defect distribution visualization module integrates the crack path of the LED lamp bead, the dark spot characteristics of the LED lamp bead and the depression characteristics of the LED lamp bead surface and displays them in a visual manner to generate a multi-feature defect distribution map of the LED lamp bead.
[0013] Compared with the prior art, the advantages and positive effects of the present invention are: In the present invention, by preprocessing the surface image of the LED lamp bead, Gaussian filtering is used to eliminate random noise and histogram equalization is used to enhance the overall grayscale distribution of the image, which significantly improves the image quality and lays a foundation for subsequent feature extraction. In crack detection, the crack distribution feature is constructed by analyzing the continuity of the pixel gradient direction, and the continuous region in the gradient direction is dynamically expanded in combination with the regional growth algorithm, while eliminating noise interference, effectively capturing the complex morphology in the crack path, including the extension, intersection and bending of the crack. Accurately identifying the complex crack morphology avoids the phenomenon of incomplete crack path identification, making the crack detection result more comprehensive. In dark spot detection, the grayscale entropy value is calculated and compared one by one after the image is partially blocked, and isolated points are eliminated in combination with the neighborhood check to achieve high-precision marking of the dark spot area, significantly reducing the phenomenon of misjudgment and missed detection. This process has a higher sensitivity to the subtle grayscale differences in the block area, effectively solves the problem of missing dark spots in small areas and interference from high background contrast during dark spot detection, and ensures the accuracy and consistency of dark spot marking. In surface depression detection, combined with the analysis of the bending and spacing change characteristics of the grating stripes, the shape and position of tiny depression areas can be accurately captured through the calibration of the deformation area, which effectively solves the problem that the existing technology cannot accurately identify subtle surface deformations and improves the refinement of depression detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 It is a schematic diagram of the workflow of the present invention; Figure 2 This is a flow chart of obtaining the crack direction distribution characteristics of LED lamp beads in the present invention; Figure 3 A flow chart of obtaining a crack path of an LED lamp bead according to the present invention; Figure 4 A flow chart of calculating the grayscale entropy value of the block area in the present invention; Figure 5 This is a flow chart of the present invention for obtaining the dark spot characteristics of LED lamp beads; Figure 6 This is a flow chart of the present invention for obtaining the concave features on the surface of an LED lamp bead; Figure 7 The present invention is a flow chart for obtaining a multi-feature defect distribution diagram of an LED lamp bead. DETAILED DESCRIPTION
[0015] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0016] In the description of the present invention, it should be understood that the terms "length", "width", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, in the description of the present invention, "multiple" means two or more, unless otherwise clearly and specifically defined.
[0017] See also Figure 1 The present invention provides a technical solution: a method for detecting defects in LED lamp beads, comprising the following steps: S1: Collect the original image of the LED lamp bead surface and preprocess it to obtain the preprocessed LED lamp bead surface image, analyze the gradient direction of each pixel point according to the grayscale change of each pixel point in the horizontal and vertical directions in the preprocessed LED lamp bead surface image, obtain the area with continuous gradient direction, and generate the distribution characteristics of the crack direction of the LED lamp bead; S2: Starting from the gradient direction continuous area in the crack direction distribution characteristics of the LED lamp bead, the adjacent areas of the gradient direction continuous area are gradually expanded and the expansion conditions in the expansion process are dynamically adjusted, and the crack path of the LED lamp bead is generated according to the expansion results; S3: Locally segment the pre-processed LED lamp bead surface image into multiple fixed-size block areas, calculate the grayscale entropy value of the block area, and mark the suspected dark spot area in each block area after local segmentation with reference to the grayscale entropy value to generate the LED lamp bead dark spot feature; S4: Project grating stripes onto the surface of LED lamp beads, analyze the bending and spacing changes of the grating stripes, calibrate the concave deformation area of the grating stripes, and generate the concave features of the LED lamp bead surface; S5: Integrate the crack path of the LED lamp bead, the dark spot characteristics of the LED lamp bead, and the depression characteristics of the LED lamp bead surface and display them in a visual way to generate a multi-feature defect distribution map of the LED lamp bead.
[0018] See also Figure 2 , the specific steps for obtaining the crack direction distribution characteristics of LED lamp beads are: S101: collecting the original image of the LED lamp bead surface and preprocessing it, including using Gaussian filtering to remove random noise in the original image, enhancing the overall grayscale of the original image through histogram equalization, and generating a preprocessed LED lamp bead surface image; First, a 3×3 Gaussian filter template is selected. The template parameter setting is based on the experimental analysis of image noise. By comparing the denoising effect and image edge clarity with different filtering intensities, the appropriate filtering range is determined. For example, a standard template is selected for the experiment, and images with different noise levels are input. The filtering intensity is adjusted, and finally the best template with a balance between noise reduction and edge clarity is selected. Then, the filtering function in the image processing software (such as OpenCV or MATLAB) is used for processing. The specific operation is to input the image into the Gaussian filtering function, specify the filter size (such as a 3×3 window) and filtering parameters when calling the filtering function, and perform weighted averaging on each pixel of the image through convolution operations, so as to finally achieve image smoothing and effectively remove random noise. Next, the filter is The image after wave is histogram equalization operation, and the grayscale value distribution of the image is counted through the grayscale histogram analysis tool in the software (such as the calcHist function of OpenCV). The tool will traverse all the pixels of the image and record the number of pixels at each grayscale level, generate a distribution histogram of grayscale value and pixel number, calculate the cumulative distribution function (CDF) based on the generated histogram, and redistribute the image grayscale value through normalization operation to cover the complete grayscale range. The stretched grayscale histogram shows a more uniform distribution. For example, when the grayscale values in the original image are concentrated in the low grayscale segment, the grayscale range of the image after equalization processing is expanded to 0 to 255, thereby enhancing the overall grayscale balance, and finally the pre-processed LED lamp bead surface image is obtained.
[0019] S102: using the Sobel operator to calculate the grayscale variation of each pixel in the preprocessed LED lamp bead surface image in the horizontal and vertical directions, analyzing the gradient direction of each pixel according to the grayscale variation, and constructing a grayscale gradient direction distribution map according to the gradient direction; To calculate the grayscale change of each pixel in the horizontal and vertical directions of the preprocessed LED lamp bead surface image, the formula is used: ; ; Get the grayscale change of the pixel points in the horizontal direction of the LED lamp bead surface image after preprocessing , the grayscale change of the pixel points in the vertical direction of the LED lamp bead surface image after preprocessing ; in, and The unit is gray value / pixel, which is obtained by convolving the gray value matrix of the preprocessed LED lamp bead surface image with the horizontal and vertical templates of the Sobel operator. and They are the templates of the Sobel operator in the horizontal and vertical directions, respectively, and are used to calculate the grayscale change of each pixel in the surface image of the LED lamp bead after preprocessing. For example, the template is in the following form: horizontal template: The horizontal template is designed to respond to the sensitive area of the horizontal grayscale change in the image. The first column (-1, -2, -1) in the template corresponds to the left side of the image, and the third column (1, 2, 1) corresponds to the right side of the image. The increase in weight value (such as -1 to -2) is to enhance the detection ability of horizontal edges and emphasize the grayscale gradient between adjacent pixels. The vertical template: , the vertical template is designed to respond to the sensitive area of the vertical grayscale change in the image. The first row (-1, -2, -1) in the template corresponds to the top of the image, and the third row (1, 2, 1) corresponds to the bottom of the image. Similarly, by increasing the weight value (such as -1 to -2), the edge detection effect in the vertical direction is enhanced. The two templates have been verified by experiments and can adapt to the edge detection requirements in image processing. The weight value is determined by classical image processing theory. The template size is 3×3 in order to balance the fineness and computational complexity of edge detection in the calculation. Larger templates may increase the computational complexity, but the detection effect of detail changes is limited; smaller templates may be more sensitive to noise. Indicates the LED lamp bead surface image after preprocessing, located at coordinates The grayscale value of the pixel at , in grayscale values (0-255). For example, suppose , the coordinates of a neighborhood pixel are , its grayscale value can be directly obtained by reading the value of the 49th row and 51st column of the image grayscale matrix, such as the grayscale value is 120. It can be obtained by directly reading the image grayscale matrix (for example, using tools such as OpenCV or NumPy). and Respectively represent the horizontal and vertical coordinates of the pixel points in the preprocessed LED lamp bead surface image, in pixels. Directly obtain through the image pixel coordinates. and Respectively represent the horizontal and vertical coordinates of the pixel point relative to the center The neighborhood offset in the horizontal and vertical directions, the value range is , corresponds to the relative position in the 3×3 neighborhood of the template, 1 and -1 are the weight values in the Sobel operator, which are used for convolution operations. In the horizontal template: 1 means that the grayscale change weight of the image at this position is positive, which will increase the impact on the result; -1 means that the grayscale change weight of the image at this position is negative, which will reduce the impact on the result. In the vertical template: 1 and -1 have the same meaning, but are used to detect grayscale gradient changes in the vertical direction.
[0020] According to the grayscale change of the pixel points in the horizontal direction of the LED lamp bead surface image after preprocessing , the grayscale change of the pixel points in the vertical direction of the LED lamp bead surface image after preprocessing , using the formula: ; Calculate the gradient direction of each pixel in the preprocessed LED lamp bead surface image , the unit is degree, and the range of gradient direction is arrive ; in, It is an inverse tangent function, which is used to calculate the gradient direction of each pixel in the surface image of the LED lamp bead after preprocessing. Its function is to calculate the horizontal grayscale change. And the vertical grayscale change The gradient direction angle of the pixel is calculated by the ratio of
[0021] The Sobel operator templates are clear, namely the horizontal template and vertical templates : ; Neighborhood gray value matrix is a pixel in the sampled grayscale image The grayscale value of the 3×3 neighborhood is assumed to be distributed as follows (the value range is 0-255): ; Calculate the grayscale change rate in the horizontal direction : ; Calculate the vertical grayscale change rate : ; Calculate the gradient direction : ; The results show that the grayscale change rate in the horizontal direction , vertical grayscale change rate , gradient direction . Finally, each pixel value in the image is matched with its calculated gradient direction to generate a gradient direction matrix of the same size as the original image, and each element in the matrix represents the gradient direction angle of the pixel. Subsequently, the gradient direction matrix is partitioned, and a continuity threshold is set according to the similarity of the direction angle (such as the direction difference is less than 10°), and the pixels whose adjacent pixel direction differences are within the threshold range are divided into a continuous region. Next, these continuous regions are marked using a region marking algorithm (such as the FloodFill algorithm), and the marking results form multiple gradient region maps with continuous directions. The above process can be implemented through an image processing library (such as the OpenCV library in Python), using the matrix operations and image markings provided by it to construct a grayscale gradient direction distribution map. The final grayscale gradient direction distribution map visualizes the gradient direction in each region in the form of color or grayscale value.
[0022] S103: comparing the gradient direction of each pixel in the grayscale gradient direction distribution map with the gradient direction of the adjacent pixel and a preset continuity threshold one by one, marking the area of continuous pixel points according to the comparison result, and generating the distribution feature of the crack direction of the LED lamp bead according to the area of continuous pixel points; First, the calculation results are used as the basis. , and the gradient direction The gradient direction distribution map is obtained by traversing the gradient directions of all pixels in the image. The generated two-dimensional array has the value of each pixel in the array as its gradient direction angle. For example, the value of all gradient directions in a certain area is , select the threshold of gradient direction continuity , compare the gradient direction of each pixel with the gradient direction of its adjacent pixels, if the difference is less than or equal to , then mark the pixel and its adjacent pixels as a continuous region, otherwise disconnect the continuity, and then use the region marking algorithm to group all adjacent and directional continuous pixels into an independent region through depth-first search or breadth-first search, and finally record the coordinate range of these continuous regions. For example, if the gradient direction distribution of a region in the input image is: , with the center point As the starting point, check whether the gradient direction difference of adjacent points is within the continuity threshold one by one If the conditions are met, they are classified into the same area, otherwise they are excluded or grouped separately. Finally, the pixel coordinate set of the continuous area is marked. Through this process, the crack direction distribution characteristics are generated and recorded in the form of matrix or image.
[0023] See also Figure 3 , the specific steps for obtaining the crack path of the LED lamp bead are: S201: Starting from the gradient direction continuous region in the crack direction distribution characteristics of the LED lamp beads, the region growing algorithm is used to gradually expand the adjacent regions of the gradient direction continuous region and dynamically adjust the expansion conditions during the expansion process. The formula is used to dynamically adjust the expansion conditions during the expansion process through the continuity threshold after dynamic expansion to identify the continuous path, the cross path and the curved path in the expansion path, and generate a complete expansion area; First, a dynamic extension judgment criterion is introduced in the extension process to further optimize the boundary recognition of the crack area. The starting point of the extension is the boundary pixel point of the gradient direction continuous area extracted in the previous step. For each boundary pixel point, the extension judgment criterion not only includes the difference with the seed point gradient direction, but also comprehensively considers the morphology and direction consistency of the entire area during the extension process. For example, the newly added pixel point must meet the following conditions at the same time: 1) The difference between the gradient direction and the current seed point gradient direction is less than the set (e.g. 5°); 2) The difference between the gradient direction and the overall average direction of the extended area is lower than the dynamically adjusted threshold ,in It will gradually decrease as the size of the extended area increases, using the formula: ; Calculate the continuity threshold after dynamic expansion ; in, is the continuity threshold, It is used to control The adjustment coefficient is set as the expansion range changes. The unit is dimensionless. Its setting needs to be analyzed in combination with the crack morphology characteristics, expansion accuracy requirements, and the gradient direction characteristics of the image. Crack morphology characteristics: For crack areas with relatively linear and strong directional continuity, the requirements for directional consistency during the expansion process are higher. Should be set to a larger value to make the dynamic threshold It decreases rapidly with the increase of the expansion range to prevent the expansion area from deviating from the crack direction. For crack areas with more complex shapes and more branches, It should be set to a smaller value to allow a larger dynamic threshold range and ensure that the expansion algorithm can cover the complex morphology of cracks. Expansion accuracy requirements: In high-precision crack expansion scenarios (such as needing to detect smaller crack details), The value should be large to strictly control the directional consistency of the expansion area. In scenarios where the expansion speed is prioritized (such as rapid detection of large-area cracks), The value should be small to appropriately relax the extension judgment conditions and improve the efficiency of the algorithm. Image gradient direction characteristics: For crack detection tasks with large image noise, It should be appropriately increased according to the influence of noise distribution to eliminate the direction fluctuation points affected by noise as much as possible and reduce the error expansion. In images with low noise and clear gradient direction distribution, It can be appropriately reduced to ensure the integrity of the crack morphology. is the number of pixels in the current expansion area, which means the total number of pixels obtained by gradually expanding the gradient direction continuous area extracted from the crack direction distribution characteristics of the LED lamp bead as the initial seed area. The unit is dimensionless. During the expansion process, each additional pixel point is Increase by 1. is a constant term used to ensure the initial stage of expansion The value is not less than , while limiting Not because and Due to excessive changes, it approaches zero and is directly introduced as a fixed constant.
[0024] Assume that the initial continuous region in the crack direction of the image contains 10 pixels. , adjustment coefficient During the expansion process, the total number of pixels in the current area , calculate the dynamic threshold during the expansion process .
[0025] Substitute the parameters into the formula: ; The results show that at the 20th pixel of the expansion, the dynamic threshold From the initial Reduced to about , which means that the extension judgment conditions are more stringent, and the deviation of the extension path from the main direction of the crack can be more accurately limited to avoid the interference of noise points. This dynamic adjustment makes the extension path more in line with the actual crack area morphology, ensuring the reliability and accuracy of the extension results. In addition, in the case of crack intersection, the extension may enter multiple directions at the same time. At this time, it is necessary to judge the direction of the branch of the extension path. According to the average gradient direction of the current extension area and the direction change trend of the newly added pixel points, the path closest to the extension direction is selected for continued expansion. For example, when expanding to the intersection, if the average direction of the current extension path is -45°, and there are two branch areas with directions of -50° and -10° around the intersection, the -50° direction closest to the current direction is preferentially selected for expansion. Specific judgment basis By comparing the direction deviation of the newly added points, the direction with the smallest deviation value is selected as the main path for continued expansion. In addition, in order to prevent the omission of other branches, the directions that deviate from the main path can be recorded, and after the main path extension is completed, these recorded directions are used as new seed points to start independent expansion, so as to fully cover all directions of the intersection path. When the crack bends, the average direction of the expansion area will gradually deviate from the original seed direction. At this time, it is necessary to dynamically adjust the reference direction of the expansion to avoid interruption of expansion due to over-reliance on the initial direction. The specific processing method is to continuously monitor the directional fluctuations of the newly added pixels. For example, when the directional deviations of 5 consecutive newly added points are all less than the set continuity threshold after dynamic expansion, , the current direction is updated to the reference direction of the expansion area. For example, if the expansion path gradually bends from the initial direction of -45°, the directions of the newly added five pixels are -44°, -43°, -42°, -41°, and -40°, respectively. Since the direction deviations are all less than the current dynamic threshold, , the average direction of the expansion area is updated to -40°, and subsequent expansion will continue along the bending direction based on this.
[0026] S202: Based on the complete extended area, by comparing the gradient direction of each pixel with the average direction of the current extended area, if the gradient direction of the target pixel deviates from the average direction of the current area and the deviation value exceeds the continuity threshold after dynamic expansion, the target pixel is marked as a noise point, and the noise point is removed to generate the crack path of the LED lamp bead; First, during the expansion process, the gradient direction of each newly added pixel is compared with the average direction of the expanded area. The average direction of the expanded area is obtained by counting the gradient direction values of all pixels in the expanded area and calculating the average of these directions. The specific operation is to accumulate the gradient direction of each pixel in the current expanded area and divide it by the total number of pixels in the area. If the gradient direction of a point deviates from the average direction of the current area by more than the set continuity threshold after dynamic expansion (i.e. ), then the point is marked as a noise point and removed from the current extension area. Taking a crack extension area as an example, the average gradient direction of the extension area is -45°, the gradient direction of the newly added pixel is -30°, and the deviation of the point from the average direction is 15°. If this deviation exceeds the currently set continuity threshold after dynamic extension (such as 1.67°), the point is removed and no longer included in the extension area. For the area where the extension is completed, the final result needs to be checked globally. By counting the direction distribution of all pixels in the area, the areas with abnormal distribution are identified, and these areas are corrected or removed. For example, a crack extension area should present a relatively continuous gradient direction distribution, but the gradient direction of a sub-area presents a random distribution or large fluctuations (such as a large number of points whose direction deviation exceeds the continuity threshold after dynamic extension), then the sub-area is determined to be a noise area and removed from the extension result. After removing the noise points, the coordinates of all qualified pixel points in the extension area are recorded, and the preliminary crack extension path is generated according to the spatial coherence of these coordinates. For example, a crack region starts from the initial seed point and gradually expands to form a path with a length of 50 pixels. By analyzing the arrangement of these points in space, a continuous crack direction path can be extracted. The final generated preliminary expansion path is output in the form of a list of coordinate points.
[0027] See also Figure 4 , the specific steps for calculating the grayscale entropy value of the block area are: S301: locally segmenting the pre-processed LED lamp bead surface image into a plurality of fixed-size block regions, each of which contains the same number of pixels, and generating a locally segmented block image data set according to the segmentation result; Firstly, the preprocessed LED lamp bead surface image is divided into multiple fixed-size block areas, each of which contains a certain number of pixels. The image data is read block by block and its grayscale value is stored separately. Then, the pixel data of each area is recorded in array form according to the block result, and finally a set of block image data is generated after local segmentation.
[0028] S302: Based on the block image data set after local segmentation, the formula is used: ; Calculate the grayscale entropy value of the block area after local segmentation of the LED lamp bead surface image after preprocessing ; in, It is used to measure the complexity of the grayscale distribution of each block area after local segmentation in the pre-processed LED lamp bead surface image. The higher the entropy value, the more uniform the grayscale distribution in the block area, and the lower the entropy value, the grayscale in the block area is concentrated in certain specific values. It is used to identify the grayscale value range of the pre-processed LED lamp bead surface image. It is usually an integer value range of 0 to 255. It is directly obtained by counting the histogram of the pre-processed LED lamp bead surface image. For example, in a certain block area, the grayscale value Those points representing pixels with a brightness of 50 are recorded and used to calculate, It is the total number of gray levels in the block area of the LED lamp bead surface image after preprocessing, indicating the number of gray levels contained in a block area in the LED lamp bead surface image after preprocessing. It is usually equal to the gray level range of the LED lamp bead surface image after preprocessing (such as 256). It is determined by analyzing the histogram of the block area. If the gray value of the block area does not cover all the gray ranges, then is equal to the actual number of gray levels. For example, if a block area only contains pixels with gray values between 30 and 80, then , is a weighting factor used to adjust the grayscale contribution setting. The setting is based on the grayscale The importance of distinguishing dark spots from normal areas is as follows: The lower the gray value, the greater the weight: Since dark spots on the surface of LED lamp beads usually appear in areas with low gray values, the contribution of low gray level pixels in entropy calculation needs to be increased. For example, when the gray value When less than 50, the weight The setting range is 1.2 to 1.5 to highlight the importance of low grayscale areas. The higher the grayscale value, the smaller the weight: In normal areas, high grayscale values tend to be evenly distributed and have little variation, and have a lower impact on defect detection. Therefore, the weight corresponding to high grayscale values will be reduced. For example, when the grayscale value When it is greater than 200, the weight The setting range is from 0.8 to 1.0 to reduce its impact on the entropy calculation. The weight is gradually adjusted: for medium gray values (such as between 50 and 200), the weight The gray value can be gradually reduced according to the proximity of the gray value to the low gray area. It can be adjusted by linear reduction or piecewise function, for example: Between 50 and 100, the weight The setting range is 1.1 to 1.2; gray value Between 100 and 200, the weight The setting range is 1.0 to 1.1, and the weight The specific value of is determined after verification by experimental data. Multiple images of the surface of LED lamp beads are collected, and the entropy value calculation results of different weighting schemes are compared. The weight distribution scheme that can more effectively distinguish the dark spot area from the normal area is selected. The setting range is: low gray value ( ): Weight Between 1.2 and 1.5; medium gray values ( ): Weight Between 1.0 and 1.2; high gray values ( ): Weight Between 0.8 and 1.0, Is grayscale The probability of the LED lamp bead surface image block area after preprocessing, indicating the current gray level The ratio of the number of pixels that appear to the total number of pixels in the block area is obtained by counting the grayscale levels in the grayscale histogram of each block area after local segmentation in the LED lamp bead surface image after preprocessing. Number of pixels , and combined with the total number of pixels in the block area The calculation formula is: , is the gray level probability The logarithm of is used to quantify the contribution of the current gray level. The base of the logarithm is chosen to be 2 to unify the unit of measurement of entropy (bit).
[0029] Assume that the total number of pixels in the block area of the LED lamp bead surface image after preprocessing is (the block size is 100×100 pixels), the gray level probability is , , , the weights are , , .
[0030] According to the formula, the grayscale entropy value is calculated as: ; The results show that the grayscale entropy value of the local segmented block area in the LED lamp bead surface image after preprocessing .
[0031] The method of continuously calculating the grayscale entropy value through sliding window is to divide the preprocessed LED lamp bead surface image into window areas of fixed size, and calculate its grayscale entropy value in units of windows each time, and the window moves on the image according to a certain step length. The specific process is as follows: 1. Determine the window size and step length, for example, set the window size to pixels, the step size is set to Pixels, that is, the window moves 50 pixels each time to cover a new area. 2. Starting from the upper left corner of the image, extract the pixel area within the window, count the number of pixels that appear at each gray level in the window, and calculate the corresponding gray level probability 3. Based on the calculated grayscale probability and formula, calculate the grayscale entropy value of the current window . 4. Move the window to the right according to the set step size, and repeat steps 2 and 3 until the line cannot completely cover the window. 5. After completing a line, move the window down by one step size, and repeat steps 2 to 4 until the entire image is covered. The continuous calculation method of the sliding window can obtain the grayscale entropy value of each window area one by one, forming the distribution data of the local grayscale features of the image. These data can be further used to mark suspected dark spot areas, and combined with specific thresholds for regional identification and processing.
[0032] See also Figure 5 , the specific steps for obtaining the dark spot characteristics of LED lamp beads are: S311: by comparing the grayscale entropy value of each block area with a preset grayscale threshold one by one, marking the area with a grayscale entropy value lower than the grayscale threshold as a suspected dark spot area, and generating a preliminary marking result; First, the grayscale entropy threshold is set by statistical analysis of the surface area of normal LED lamp beads. , for example As the boundary between the normal area and the suspected dark spot area, the block areas corresponding to each sliding window are judged one by one. When the area is marked as a suspected dark spot, if , it is marked as a normal area, and a binary marking map is generated by pixel-by-pixel comparison, and all areas that meet the suspected dark spot conditions are stored as preliminary results.
[0033] S312: Based on the preliminary marking results, check the neighborhood of each suspected dark spot area, remove isolated points in the suspected dark spot area according to the inspection results, integrate the remaining areas, and generate LED lamp bead dark spot features; First, the number of neighborhood markers for each suspected dark spot pixel is calculated. For example, a 3×3 window is used to count the number of suspected dark spot pixels around each pixel. If the number of neighborhood markers for a pixel is less than the set threshold (such as fewer than 2 suspected dark spot pixels in the neighborhood), the pixel is marked as an isolated point and removed. The pixels that are not removed in the neighborhood analysis are retained as the final dark spot area, and the results after elimination are stored as dark spot features for subsequent analysis and statistics, and finally the dark spot features on the surface of the LED lamp beads are generated.
[0034] See also Figure 6 , the specific steps for obtaining the concave features on the surface of LED lamp beads are: S401: Projecting grating stripes onto the surface of the LED lamp bead, collecting grating stripe images and scanning the center position of the grating stripes by adjusting the projection angle and intensity of the grating stripe light source, analyzing the bending and spacing changes of adjacent grating stripes at the center position, and generating grating stripe change analysis results; The grating stripes are projected onto the solid surface of the LED lamp bead. The ImageProcessingToolbox in the MATLAB software is combined with a CCD camera to collect the image after the grating stripes are projected on the solid surface of the LED lamp bead. Then, the edge function of MATLAB is used to detect the edge of the image. The collected grating stripe image is scanned line by line, and the center coordinate position of each grating stripe is extracted. The grating stripe spacing is calculated using the pixel difference between the center positions of adjacent grating stripes. For example, if the center positions of a pair of grating stripes are measured as the 100th pixel and the 120th pixel respectively, the grating stripe spacing is 20 pixels. According to this method, the spacing of all grating stripes is measured one by one, and the spacing value of each pair of grating stripes is recorded. When the grating stripe spacing is less than the set threshold (such as 20 pixels), the area is marked as an area where deformation may occur. Then, the grating stripe curvature is calculated using the CurveFittingToolbox in MATLAB. For example, in the marked area, the curvature change of the grating stripe fitting curve is 0.08, which exceeds the preset curvature threshold (such as 0.05), and the grating stripe area is marked as a curved area. Finally, the measurement results of the grating fringe spacing and curvature changes are stored as an Excel file.
[0035] S402: Based on the grating stripe change analysis result, the positions where the bending and spacing changes of the grating stripes exceed the preset change threshold are screened, and the corresponding concave deformation areas are calibrated according to the screening results to generate the concave features of the LED lamp bead surface; According to the measurement results of grating stripe bending and spacing change, the bwconncomp function in MATLAB is used to extract the distribution of grating stripe deformation area, read the previously stored grating stripe spacing and curvature measurement data, and compare and analyze the results of each grating stripe spacing and curvature change. It is assumed that when the grating stripe spacing is less than 20 pixels and the curvature change is greater than the change threshold of 0.05, the grating stripe can be marked as a deformation area. For the deformation area that meets the conditions, the bwboundaries function of MATLAB is used to extract the regional boundaries. For example, in the marked area, the pixel coordinates of the deformation area boundary are (100, 50), (120, 60), (140, 55), etc. These coordinates are used to generate the contour map of the closed area. The area of the calibrated deformation area is further calculated, and the regionprops function in MATLAB is used to count the regional pixels. For example, the area contains 500 pixels, corresponding to the actual physical area of 0.05mm². The calculation results are recorded in the Excel file to generate the complete surface depression features of the LED lamp beads.
[0036] See also Figure 7 ,The specific steps for obtaining the multi-feature defect distribution map of LED lamp beads are: S501: Integrate the crack path of the LED lamp bead, the dark spot characteristics of the LED lamp bead, and the concave characteristics of the LED lamp bead surface, perform spatial mapping and alignment with the original LED lamp bead surface image, and mark each type of defect area by boundary extraction and superposition to generate an integrated marked image; Read the Excel files of each feature, including the extension path file of LED lamp bead crack refinement, dark spot feature file and concave feature file, and import the spatial coordinates and corresponding feature information of each type of feature through MATLAB's xlsread function. For example, the crack feature file contains the starting and ending coordinates of the path point, the dark spot feature file records the center point and area data of each dark spot area, and the concave feature file contains the boundary coordinates of the deformation area. Then use MATLAB's image processing toolbox to import the original LED lamp bead surface image into the workspace, and superimpose the spatial information of each type of feature on the original image through the coordinate mapping method. Use MATLAB's plot function to visually mark the boundaries of different features, such as the crack feature uses a red solid line to mark the path, the dark spot feature uses a yellow circle to mark the center point and fill the area, and the concave feature uses a blue dotted line to mark the deformation boundary, and finally generate the original image with all feature marks.
[0037] S502: Based on the integrated marked image, the attributes of each type of defect area are classified and counted, wherein the attributes of each type of defect area include quantity, area and distribution range data, and a multi-feature defect distribution map of LED lamp beads is generated in combination with the statistical results; Perform distribution statistics for each type of defect area, and use MATLAB's regionprops function to read the attribute information of each type of defect area in the marked feature image, including area, perimeter, center point coordinates, etc., and classify and summarize the statistical results. At the same time, combined with the coordinate information of the defect area, analyze its distribution range. For example, crack features are mainly concentrated in the edge area of the lamp bead, dark spot features are concentrated in the central area, and concave features are distributed in the lower half. After the statistics are completed, use the drawing function in MATLAB (such as the bar function to generate a bar chart and the heatmap function to generate a heat map) to visualize the distribution statistics results, superimpose the distribution statistics of different defect features on the surface image of the LED lamp bead, and finally generate a multi-feature defect distribution map of the LED lamp bead for evaluating and analyzing the defect distribution characteristics.
[0038] An LED lamp bead defect detection system, comprising: The image preprocessing module collects the original image of the LED lamp bead surface and preprocesses it to obtain the preprocessed LED lamp bead surface image. According to the grayscale change of each pixel point in the horizontal and vertical directions in the preprocessed LED lamp bead surface image, the gradient direction of each pixel point is analyzed, the area with continuous gradient direction is obtained, and the distribution characteristics of the crack direction of the LED lamp bead are generated; The crack path generation module starts from the gradient direction continuous area in the crack direction distribution characteristics of the LED lamp bead, gradually expands the adjacent areas of the gradient direction continuous area and dynamically adjusts the expansion conditions during the expansion process, and generates the crack path of the LED lamp bead according to the expansion results; The dark spot feature extraction module locally divides the pre-processed LED lamp bead surface image into multiple fixed-size block areas, calculates the grayscale entropy value of the block area, and marks the suspected dark spot area in each block area after local segmentation with reference to the grayscale entropy value to generate the LED lamp bead dark spot feature; The surface depression analysis module projects grating stripes onto the surface of LED lamp beads, analyzes the bending and spacing changes of the grating stripes, calibrates the concave deformation area of the grating stripes, and generates the surface depression features of the LED lamp beads; The defect distribution visualization module integrates the crack path, dark spot characteristics and surface depression characteristics of LED lamp beads and displays them in a visual way to generate a multi-feature defect distribution map of LED lamp beads.
[0039] The above are only preferred embodiments of the present invention and are not intended to limit the present invention in other forms. Any technician familiar with the profession may use the technical contents disclosed above to change or modify them into equivalent embodiments with equivalent changes and apply them to other fields. However, any simple modification, equivalent change and modification made to the above embodiments based on the technical essence of the present invention without departing from the technical solution of the present invention still falls within the protection scope of the technical solution of the present invention.
Claims
1. A method for detecting defects in LED lamp beads, characterized in that: The following steps are involved: S1: Collect the original image of the LED lamp bead surface and preprocess it to obtain the preprocessed LED lamp bead surface image, analyze the gradient direction of each pixel point according to the grayscale change of each pixel point in the horizontal and vertical directions in the preprocessed LED lamp bead surface image, obtain the area with continuous gradient direction, and generate the distribution characteristics of the crack direction of the LED lamp bead; S2: Starting from the gradient direction continuous region in the crack direction distribution characteristics of the LED lamp bead, gradually expand the adjacent regions of the gradient direction continuous region and dynamically adjust the expansion conditions during the expansion process, and generate the crack path of the LED lamp bead according to the expansion result; S3: locally segmenting the pre-processed LED lamp bead surface image into a plurality of fixed-size block areas, calculating the grayscale entropy values of the block areas, marking the suspected dark spot areas in each block area after local segmentation with reference to the grayscale entropy values, and generating LED lamp bead dark spot features; S4: Project grating stripes onto the surface of LED lamp beads, analyze the bending and spacing changes of the grating stripes, calibrate the concave deformation area of the grating stripes, and generate the concave features of the LED lamp bead surface; S5: Integrate the crack path of the LED lamp bead, the dark spot characteristics of the LED lamp bead, and the depression characteristics on the surface of the LED lamp bead and display them in a visual manner to generate a multi-feature defect distribution map of the LED lamp bead.
2. The LED lamp bead defect detection method according to claim 1, characterized in that: The steps for obtaining the crack direction distribution characteristics of the LED lamp bead are specifically as follows: S101: collecting the original image of the LED lamp bead surface and preprocessing it, including using Gaussian filtering to remove random noise in the original image, enhancing the overall grayscale of the original image through histogram equalization, and generating a preprocessed LED lamp bead surface image; S102: using the Sobel operator to calculate the grayscale variation of each pixel in the preprocessed LED lamp bead surface image in the horizontal direction and the vertical direction respectively, analyzing the gradient direction of each pixel according to the grayscale variation, and constructing a grayscale gradient direction distribution map according to the gradient direction; S103: Compare the gradient direction of each pixel in the grayscale gradient direction distribution map with the gradient direction of adjacent pixels and a preset continuity threshold one by one, mark the area of continuous pixels according to the comparison result, and generate the LED lamp bead crack direction distribution feature according to the area of continuous pixels.
3. The LED lamp bead defect detection method according to claim 2, characterized in that: The steps for obtaining the crack path of the LED lamp bead are specifically as follows: S201: Starting from the gradient direction continuous region in the crack direction distribution characteristics of the LED lamp bead, a regional growth algorithm is used to gradually expand the adjacent regions of the gradient direction continuous region and dynamically adjust the expansion conditions during the expansion process, using the formula: ; Calculate the continuity threshold after dynamic expansion , through the continuity threshold after dynamic expansion Dynamically adjust the expansion conditions during the expansion process to identify continuous paths, cross paths, and curved paths in the expansion path to generate a complete expansion area; in, is the continuity threshold, It is used to control The adjustment factor is set according to the expansion range. It represents the total number of pixels obtained by gradually expanding the gradient direction continuous area extracted from the crack direction distribution characteristics of the LED lamp bead as the initial area; S202: Based on the complete extended area, by comparing the gradient direction of each pixel point with the average direction of the current extended area, if the gradient direction of the target pixel point deviates from the average direction of the current area and the deviation value exceeds the continuity threshold after dynamic expansion, the target pixel point is marked as a noise point, and the noise point is eliminated to generate the crack path of the LED lamp bead.
4. The LED lamp bead defect detection method according to claim 1, characterized in that: The step of calculating the grayscale entropy value of the block area is specifically as follows: S301: locally segmenting the pre-processed LED lamp bead surface image into a plurality of fixed-size block regions, each of which contains the same number of pixels, and generating a locally segmented block image data set according to the segmentation result; S302: Based on the local segmented block image data set, the formula is used: ; Calculate the grayscale entropy value of the block area after local segmentation of the LED lamp bead surface image after preprocessing ; in, It is the grayscale used to identify the grayscale value range in the pre-processed LED lamp bead surface image. is the total number of gray levels in the block area of the LED lamp bead surface image after preprocessing, is a weighting factor used to adjust the grayscale contribution setting, Is grayscale The probability in the corresponding pre-processed LED lamp bead surface image block area, is the gray level probability The logarithmic value of .
5. The LED lamp bead defect detection method according to claim 4, characterized in that: The steps for obtaining the dark spot characteristics of the LED lamp beads are specifically as follows: S311: by comparing the grayscale entropy value of each block area with a preset grayscale threshold one by one, marking the area with a grayscale entropy value lower than the grayscale threshold as a suspected dark spot area, and generating a preliminary marking result; S312: Based on the preliminary marking result, check the neighborhood of each suspected dark spot area, remove isolated points in the suspected dark spot area according to the inspection result, integrate the remaining area, and generate LED lamp bead dark spot features.
6. The LED lamp bead defect detection method according to claim 1, characterized in that: The steps for obtaining the concave features on the surface of the LED lamp bead are specifically as follows: S401: Projecting grating stripes onto the surface of the LED lamp bead, collecting grating stripe images and scanning the center position of the grating stripes by adjusting the projection angle and intensity of the grating stripe light source, analyzing the bending and spacing changes of adjacent grating stripes at the center position, and generating grating stripe change analysis results; S402: Based on the grating stripe change analysis result, the positions where the bending and spacing changes of the grating stripes exceed the preset change threshold are screened, and the corresponding concave deformation areas are calibrated according to the screening results to generate the concave features of the LED lamp bead surface.
7. The LED lamp bead defect detection method according to claim 1, characterized in that: The steps for obtaining the multi-feature defect distribution map of the LED lamp bead are specifically as follows: S501: Integrate the crack path, dark spot features and surface depression features of the LED lamp beads, perform spatial mapping and alignment with the original LED lamp bead surface image, and generate an integrated marked image by extracting and superimposing each type of defect area through boundaries; S502: Based on the integrated marked image, the attributes of each type of defect area are classified and counted, wherein the attributes of each type of defect area include quantity, area and distribution range data, and a multi-feature defect distribution map of LED lamp beads is generated in combination with the statistical results.
8. An LED lamp bead defect detection system, used to implement the LED lamp bead defect detection method according to any one of claims 1 to 7, characterized in that: The system comprises: The image preprocessing module collects the original image of the LED lamp bead surface and preprocesses it to obtain the preprocessed LED lamp bead surface image. According to the grayscale change of each pixel point in the horizontal and vertical directions in the preprocessed LED lamp bead surface image, the gradient direction of each pixel point is analyzed, the area with continuous gradient direction is obtained, and the distribution characteristics of the crack direction of the LED lamp bead are generated; The crack path generation module starts from the gradient direction continuous area in the crack direction distribution characteristics of the LED lamp bead, gradually expands the adjacent areas of the gradient direction continuous area and dynamically adjusts the expansion conditions during the expansion process, and generates the crack path of the LED lamp bead according to the expansion results; The dark spot feature extraction module locally divides the pre-processed LED lamp bead surface image into a plurality of fixed-size block areas, calculates the grayscale entropy value of the block area, marks the area suspected of dark spots in each block area after local segmentation with reference to the grayscale entropy value, and generates the LED lamp bead dark spot feature; The surface depression analysis module projects grating stripes onto the surface of LED lamp beads, analyzes the bending and spacing changes of the grating stripes, calibrates the concave deformation area of the grating stripes, and generates the surface depression features of the LED lamp beads; The defect distribution visualization module integrates the crack path of the LED lamp bead, the dark spot characteristics of the LED lamp bead and the depression characteristics of the LED lamp bead surface and displays them in a visual manner to generate a multi-feature defect distribution map of the LED lamp bead.
Citation Information
Patent Citations
Underwater structure surface crack detection device and method based on compound-eye bionic vision
CN105954292A
LED lamp bead detection method and device, equipment and storage medium
CN118470030A
Stepwise-refinement pavement crack detection method
WO2016172827A1
Cited By
Water film online detection method, system and equipment
CN120490118A
Furniture surface paint spraying defect detection method based on vision
CN120543521A
Vision-based method for detecting defects in the painting of furniture surfaces
CN120543521B
Surface mine three-dimensional modeling calibration method based on unmanned aerial vehicle oblique photography
CN121053028A