LED lamp bead detection method, device, equipment and storage medium
Through the combination of Laplace pyramid algorithm and convolutional neural network, combined with the multi-view dual support vector machine model, the problems of low efficiency and low accuracy of LED lamp bead detection in the existing technology are solved, and more efficient and stable Test results.
Patent Information
- Application Number
- CN202410943735.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-15
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2044-07-15
AI Technical Summary
When the existing LED lamp bead detection method deals with complex background and multi-scale features, the detection efficiency is low and the accuracy is not high, making it difficult to effectively capture image details and structural information, resulting in instability and reliability of the detection results.
Multi-scale segmentation is performed using Laplace pyramid algorithm, combining convolutional neural network to extract details and structural feature information, and weighted fusion of regional brightness and contrast significance, using multi-view dual support vector machine model to make defect classification decisions to reduce noise and the possibility of false detection.
It significantly improves the accuracy and stability of LED lamp bead detection, enhances feature extraction accuracy, reduces false detection rate, and improves detection accuracy.
Smart Images

Figure CN118470030B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a method, device, equipment and storage medium for detecting LED lamp beads. Background Art
[0002] LED lamp beads are widely used in lighting, display screens, decoration and other fields. However, LED lamp beads are prone to various defects during the production process, such as uneven brightness, color deviation and surface defects, which will seriously affect the quality and service life of the product. Therefore, efficient and accurate detection of LED lamp beads has become an important link to ensure product quality. At present, traditional detection methods mainly rely on manual detection and simple image processing technology, which have the problems of low detection efficiency, low accuracy, and high missed detection and false detection rates.
[0003] With the development of machine learning and computer vision technology, automatic detection methods based on image processing and deep learning have gradually become a research hotspot. These methods can improve detection efficiency and accuracy to a certain extent by extracting image features and using classification algorithms to identify defects. However, existing automatic detection methods still have many shortcomings when dealing with complex backgrounds and multi-scale features. For example, traditional feature extraction methods are difficult to effectively capture the details and structural information in images, and simple classification models cannot fully utilize multi-view information for decision-making, resulting in unstable and unreliable detection results. Summary of the invention
[0004] The present application provides a method, device, equipment and storage medium for detecting LED lamp beads, which are used to improve the detection accuracy of LED lamp beads.
[0005] In a first aspect, the present application provides a method for detecting an LED lamp bead, the method comprising:
[0006] Capturing images of LED lamp beads to obtain original lamp bead images, and performing denoising, grayscale conversion, and contrast enhancement on the original lamp bead images to obtain target lamp bead images;
[0007] The target lamp bead image is segmented at multiple scales using a Laplacian pyramid algorithm to obtain a multi-layer feature map and a background layer;
[0008] Using a convolutional neural network to extract features from the multiple layers of feature maps, respectively, to obtain detail feature information and structural feature information of each layer of feature maps;
[0009] Performing weighted fusion of regional brightness and contrast significance on each layer of feature maps according to the detail feature information and the structural feature information to obtain sub-feature detection results of each layer of feature maps;
[0010] The background layer is subjected to noise and false target elimination processing to obtain a pure background layer result, and the pure background layer result is subjected to logical operation and integration with the sub-feature detection result of each layer of feature map to obtain a result integration vector;
[0011] The result integration vector is input into a preset multi-view dual support vector machine model to perform lamp bead defect classification decision, so as to obtain the defect classification decision result of the LED lamp bead.
[0012] In a second aspect, the present application provides a detection device for an LED lamp bead, the detection device for an LED lamp bead comprising:
[0013] The acquisition module is used to acquire images of LED lamp beads to obtain original lamp bead images, and to perform denoising, grayscale conversion and contrast enhancement on the original lamp bead images to obtain target lamp bead images;
[0014] A segmentation module, used to perform multi-scale segmentation on the target lamp bead image using a Laplace pyramid algorithm to obtain a multi-layer feature map and a background layer;
[0015] An extraction module, used to extract features from the multi-layer feature maps using a convolutional neural network to obtain detail feature information and structural feature information of each layer of feature maps;
[0016] A fusion module, used to perform weighted fusion of regional brightness and contrast significance on each layer of feature maps according to the detail feature information and the structural feature information, to obtain sub-feature detection results of each layer of feature maps;
[0017] A processing module is used to perform noise and false target elimination processing on the background layer to obtain a pure background layer result, and perform logical operations and integration on the pure background layer result and the sub-feature detection results of each layer of feature map to obtain a result integration vector;
[0018] The decision module is used to input the result integration vector into a preset multi-view dual support vector machine model to perform lamp bead defect classification decision to obtain the defect classification decision result of the LED lamp bead.
[0019] The third aspect of the present application provides an LED lamp bead detection device, comprising: a memory and at least one processor, wherein the memory stores instructions; the at least one processor calls the instructions in the memory so that the LED lamp bead detection device executes the above-mentioned LED lamp bead detection method.
[0020] A fourth aspect of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores instructions, which, when executed on a computer, enable the computer to execute the above-mentioned LED lamp bead detection method.
[0021] In the technical solution provided by the present application, the quality and detail clarity of the image are significantly improved by denoising, grayscale conversion and contrast enhancement of the original lamp bead image. The Laplace pyramid algorithm is used for multi-scale segmentation, which can effectively separate feature maps and background layers of different scales to ensure the comprehensive capture of details and structural information. By constructing a dual-channel convolutional neural network model, detail feature information and structural feature information are extracted respectively, ensuring the comprehensive capture of local details and global structures in the LED lamp bead image. The combination of detail feature channel and structural feature channel is weighted by attention mechanism to improve the accuracy of feature extraction. The regional brightness and contrast significance weighted fusion is performed on each layer of feature map, and the image is refined by calculating the significance of detail features and structural features. The weighted fusion of significance not only improves the accuracy of sub-feature detection results, but also effectively suppresses the influence of noise and irrelevant background in the fusion process. By eliminating noise and pseudo-targets from the background layer, a pure background layer result is obtained. The purity of the background layer is ensured by wavelet transform and soft threshold denoising, so that only real and effective target information is retained during logical operations and integration, greatly reducing the possibility of false detection. Using the multi-view dual support vector machine model to classify the result integration vector, the feature information under different viewpoints can be considered more comprehensively, significantly improving the accuracy and stability of defect classification. Multi-view learning combined with principal component analysis and kernel skill mapping not only enhances the generalization ability of the model, but also effectively avoids the overfitting problem, thereby improving the detection accuracy of LED lamp beads. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0023] Figure 1 This is a schematic diagram of an embodiment of a method for detecting LED lamp beads in an embodiment of the present application;
[0024] Figure 2 This is a schematic diagram of an embodiment of a detection device for LED lamp beads in an embodiment of the present application. DETAILED DESCRIPTION
[0025] The embodiments of the present application provide a detection method, device, equipment and storage medium for LED lamp beads. The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" or "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0026] For ease of understanding, the specific process of the embodiment of the present application is described below. Figure 1 , an embodiment of the method for detecting LED lamp beads in the embodiment of the present application includes:
[0027] Step S101, collecting images of LED lamp beads to obtain original lamp bead images, and performing denoising, grayscale conversion and contrast enhancement on the original lamp bead images to obtain target lamp bead images;
[0028] It is understandable that the execution subject of the present application may be a detection device for LED lamp beads, or a terminal or a server, which is not limited here. The present application embodiment is described by taking a server as the execution subject as an example.
[0029] Specifically, an image of an LED lamp bead is collected to obtain an original lamp bead image. A bilateral filtering denoising process is performed on the original lamp bead image to obtain a preliminary denoising image. A global histogram is calculated based on the preliminary denoising image and an optimal threshold is determined. The preliminary denoising image is threshold segmented to obtain a binary image. The binary image is divided into a foreground and a background by threshold segmentation. Holes are filled in the binary image to remove small holes and obtain a binary image without holes. A morphological opening operation is performed on the binary image without holes to remove noise spots and obtain an opening operation result image. Morphological opening operation is an image processing method for removing small spots and noise, which can effectively improve the quality and accuracy of the image. A linear stretching transformation is performed based on the grayscale statistical information of the opening operation result image to obtain a grayscale stretching image. The linear stretching transformation improves the contrast of the image by adjusting the grayscale range of the image to make the details clearer. An adaptive histogram equalization algorithm is used for the grayscale stretching image to enhance the image contrast and obtain a contrast enhanced image. The adaptive histogram equalization algorithm can dynamically adjust the contrast according to the local grayscale distribution, so that the brightness and contrast of the image are significantly improved. Edge detection is performed on the contrast-enhanced image to obtain the edge detection result image. Edge detection helps to identify the contour of the target area. Small area connected domain analysis is performed on the edge detection result image to obtain a connected domain marker image. Connected domain analysis helps to identify and extract the target area by marking the connected areas in the image. The effective target area is extracted according to the connected domain features of the connected domain marker image to obtain the target area image. The target area image is corrected by geometric correction to eliminate the deformation or deviation that may exist during the image acquisition process, and finally the target lamp bead image is obtained.
[0030] Step S102, using the Laplace pyramid algorithm to perform multi-scale segmentation on the target lamp bead image to obtain a multi-layer feature map and a background layer;
[0031] Specifically, the target lamp bead image is subjected to Gaussian smoothing filtering to obtain a smoothed image. Gaussian smoothing filtering smoothes the image by reducing noise and details in the image. A Gaussian pyramid is constructed based on the smoothed image to obtain a Gaussian hierarchical image set of different scales. Gaussian pyramid is a multi-scale representation method that generates a series of images with decreasing resolution by downsampling and Gaussian filtering layer by layer, so that the features of the image at different scales can be expressed. The Gaussian hierarchical image set is upsampled to obtain an extended Gaussian hierarchical image set. Upsampling is to enlarge the image to the original resolution by interpolation method, thereby generating a series of extended images. Adjacent layer images of the extended Gaussian hierarchical image set are pixel-differentiated to obtain a Laplacian hierarchical image set. The pixel difference operation captures the high-frequency details of the image by calculating the difference between adjacent layer images to generate Laplacian hierarchical images, which contain image features at different scales. The lowest resolution layer is selected from the Laplacian hierarchical image set as the background layer. The lowest resolution layer usually contains the overall structural information of the image but does not contain detailed features. The remaining layers except the background layer are selected from the Laplacian hierarchical image set as the feature layer set. Non-maximum suppression is performed on each layer of the feature layer set to obtain a multi-layer feature map. Non-maximum suppression is an edge detection method that highlights edges and features by suppressing non-local maxima, ensuring that each feature layer only retains the features of the local maximum.
[0032] Step S103: using a convolutional neural network to extract features from multiple layers of feature maps, respectively, to obtain detail feature information and structural feature information of each layer of feature maps;
[0033] Specifically, a dual-channel convolutional neural network model is constructed, which includes a detail feature extraction channel and a structural feature extraction channel. Multiple layers of feature maps are input into the dual-channel convolutional neural network model. In the detail feature extraction channel, a convolution operation is performed on each layer of the input feature map to extract local detail features. The convolution operation can capture subtle features in the image, such as edges and textures, by applying multiple convolution kernels to slide on the image. At the same time, in the structural feature extraction channel, global pooling is performed on each layer of the input feature map to capture global structural information. Global pooling extracts the overall features of the image, such as shape and layout, by performing a pooling operation on the image. The output feature map of the detail feature extraction channel is weighted by a channel attention mechanism to highlight important feature information and obtain a weighted detail feature map. Similarly, the output feature map of the structural feature extraction channel is weighted by a channel attention mechanism to obtain a weighted structural feature map. The weighted detail feature map and the weighted structural feature map are feature fused to form a comprehensive feature representation. After obtaining the fused feature map, an upsampling operation is performed on it to restore it to the original resolution. Upsampling uses methods such as interpolation or deconvolution to enlarge the feature map back to the original resolution to obtain an upsampled feature map, so that the fused feature map can maintain the same size as the original image. The upsampled feature map is feature decoded to reconstruct detail features and structural features. Feature decoding decodes the fused feature map back to specific detail and structural feature representations through operations such as inverse convolution, and uses the reconstructed detail features and structural features as the detail feature information and structural feature information of each layer of feature map.
[0034] Step S104: performing weighted fusion of regional brightness and contrast significance on each layer of feature maps according to detail feature information and structural feature information to obtain sub-feature detection results of each layer of feature maps;
[0035] Specifically, Gaussian blur filtering is performed on the detail feature information to obtain a smooth detail feature map. Gaussian blur filtering makes the detail feature map smoother and more stable by reducing high-frequency noise in the image. The pixel grayscale gradient amplitude is calculated based on the smooth detail feature map to obtain a detail gradient amplitude map. The grayscale gradient amplitude represents the grayscale change intensity of each pixel in the image, so that the detail change area in the image can be highlighted. At the same time, median filtering is performed on the structural feature information to obtain a smooth structural feature map. Median filtering is a nonlinear filtering method that removes noise by taking the median of pixels in the neighborhood to maintain the edge information of the image. The pixel grayscale gradient direction is calculated based on the smooth structural feature map to obtain a structural gradient direction map. The grayscale gradient direction represents the grayscale change direction of each pixel in the image, so that the structural features of the image can be captured. The detail gradient amplitude map and the structural gradient direction map are processed to obtain a detail saliency map and a structural saliency map, respectively. The detail saliency map provides saliency information of detail features by highlighting the saliency detail area in the image. The structural saliency map provides saliency information of structural features by highlighting the saliency structure area in the image. The pixel region brightness saliency weight coefficient matrix is calculated according to the detail saliency map. The brightness saliency weight coefficient matrix represents the brightness saliency weight of each pixel region, so that the image can highlight the area with significant brightness. At the same time, the pixel region contrast saliency weight coefficient matrix is calculated according to the structural saliency map. The contrast saliency weight coefficient matrix represents the contrast saliency weight of each pixel region, so that the image can highlight the area with significant contrast. The detail feature information is weightedly fused with the regional brightness saliency weight coefficient matrix to obtain a brightness fusion feature map. At the same time, the structural feature information is weightedly fused with the regional contrast saliency weight coefficient matrix to obtain a contrast fusion feature map. The brightness fusion feature map and the contrast fusion feature map are pixel-level fused to obtain the sub-feature detection results of each layer of the feature map. The brightness fusion feature map and the contrast fusion feature map are pixel-by-pixel added or other fusion operations are performed, so that the final feature map contains both brightness and contrast saliency feature information, thereby enhancing the comprehensive expression ability of the feature map.
[0036] Step S105: performing noise and false target elimination processing on the background layer to obtain a pure background layer result, and performing logical operations and integration on the pure background layer result and the sub-feature detection results of each layer of feature map to obtain a result integration vector;
[0037] Specifically, the background layer is decomposed by wavelet transform to obtain low-frequency components and high-frequency components. Wavelet transform decomposition effectively separates low-frequency information and high-frequency detail information in the image by decomposing the image into components of different frequencies. The background layer approximate image is reconstructed based on the low-frequency component. The low-frequency component contains the overall structure and main content of the image. The reconstructed approximate image can represent the basic form and information of the background layer. At the same time, the high-frequency component is subjected to soft threshold denoising to obtain a denoised high-frequency component. Soft threshold denoising is a commonly used signal processing method. By performing threshold processing on the high-frequency component, noise is effectively removed while retaining the detail information of the image. The background layer detail image is reconstructed based on the denoised high-frequency component. The background layer approximate image and the background layer detail image are subjected to wavelet reconstruction to obtain a reconstructed background layer image. Wavelet reconstruction generates a complete image containing low-frequency and high-frequency information by recombining the approximate image and the detail image. A pure background layer result is generated based on the reconstructed background layer image. A pixel-level logical AND operation is performed on the pure background layer result and the sub-feature detection result of each layer feature map to obtain an AND operation result set. The logical AND operation can effectively combine the background layer information and the feature detection results by performing a pixel-by-pixel logical AND operation on the pure background layer and the sub-feature detection results, thereby highlighting the target feature area in the image. The region growing algorithm is clustered on the result set of the AND operation to obtain the target region set. The region growing algorithm is an image segmentation method that can identify connected target regions in an image by combining adjacent pixels into regions. The target region set is encoded and vectorized to obtain the result integration vector.
[0038] Step S106: input the result integration vector into a preset multi-view dual support vector machine model to perform lamp bead defect classification decision, and obtain the LED lamp bead defect classification decision result.
[0039] Specifically, principal component analysis is performed on the result integration vector to obtain a feature vector after dimensionality reduction. Principal component analysis extracts the main features of the data by mapping high-dimensional data to low-dimensional space, thereby reducing the dimension of the data and retaining important information. A multi-view feature space is constructed based on the feature vector after dimensionality reduction. Positive and negative sample sets are sampled in the multi-view feature space, and the positive sample set and the negative sample set represent defective and non-defective LED lamp bead samples, respectively. The positive and negative sample sets are mapped by kernel techniques to obtain a high-dimensional feature sample set. The kernel technique maps low-dimensional features to high-dimensional space, making the samples linearly separable in the high-dimensional space, thereby improving the performance of the classifier. Based on the high-dimensional feature sample set, multiple support vector machine classifiers are trained to obtain multiple support vector machine classifier sets. Support vector machine is a supervised learning model that classifies samples by finding the optimal hyperplane. In order to improve the robustness and accuracy of classification, multiple classifiers are used for training. Multiple support vector machine classifier sets are weighted integrated to obtain a multi-view dual support vector machine model. Weighted integration improves the overall classification performance by weighted averaging the outputs of multiple classifiers and integrating the advantages of each classifier. Input the reduced feature vector into the multi-view dual support vector machine model to obtain a classification score vector. The classification score vector represents the score of each sample under each classifier. By integrating these scores, the category of the sample is judged. The classification confidence score is calculated based on the classification score vector. The classification confidence score represents the credibility of the classification result. By comparing the confidence scores, the reliability of the classification result is judged. The classification confidence score is compared with the preset threshold to determine the defect category and output the defect classification detection result of the LED lamp bead. The preset threshold is a benchmark value set according to the actual application requirements. When the classification confidence score exceeds the threshold, the sample is considered to belong to a certain defect category, otherwise the sample is considered to be defect-free.
[0040] In the embodiment of the present application, the quality and detail clarity of the image are significantly improved by denoising, grayscale conversion and contrast enhancement of the original lamp bead image. The Laplace pyramid algorithm is used for multi-scale segmentation, which can effectively separate feature maps and background layers of different scales to ensure the comprehensive capture of details and structural information. By constructing a dual-channel convolutional neural network model, detail feature information and structural feature information are extracted respectively, ensuring the comprehensive capture of local details and global structures in the LED lamp bead image. The combination of detail feature channel and structural feature channel is weighted by attention mechanism to improve the accuracy of feature extraction. The regional brightness and contrast significance weighted fusion is performed on each layer of feature map, and the image is refined by calculating the significance of detail features and structural features. The weighted fusion of significance not only improves the accuracy of sub-feature detection results, but also effectively suppresses the influence of noise and irrelevant background during the fusion process. By eliminating noise and pseudo-targets from the background layer, a pure background layer result is obtained. The purity of the background layer is ensured by wavelet transform and soft threshold denoising, so that only real and effective target information is retained during logical operations and integration, greatly reducing the possibility of false detection. Using the multi-view dual support vector machine model to classify the result integration vector, the feature information under different viewpoints can be considered more comprehensively, significantly improving the accuracy and stability of defect classification. Multi-view learning combined with principal component analysis and kernel skill mapping not only enhances the generalization ability of the model, but also effectively avoids the overfitting problem, thereby improving the detection accuracy of LED lamp beads.
[0041] In a specific embodiment, the process of executing step S101 may specifically include the following steps:
[0042] (1) Capture the image of LED lamp beads to obtain the original lamp bead image, and perform bilateral filtering denoising on the original lamp bead image to obtain a preliminary denoised image;
[0043] (2) Calculate the global histogram based on the preliminary denoised image and determine the optimal threshold. At the same time, perform threshold segmentation on the preliminary denoised image to obtain a binary image.
[0044] (3) Fill the holes of the binary image to obtain a binary image without holes, and perform a morphological opening operation on the binary image without holes to remove noise spots and obtain an opening operation result image;
[0045] (4) Performing a linear stretching transformation according to the grayscale statistical information of the image resulting from the opening operation to obtain a grayscale stretched image, and applying an adaptive histogram equalization algorithm to the grayscale stretched image to enhance the image contrast to obtain a contrast enhanced image;
[0046] (5) Perform edge detection on the contrast enhanced image to obtain an edge detection result image, and perform small area connected domain analysis on the edge detection result image to obtain a connected domain marked image;
[0047] (6) Extract the effective target area according to the connected domain features of the connected domain marker image to obtain the target area image, and perform geometric correction on the target area image to obtain the target lamp bead image.
[0048] Specifically, the LED lamp beads are imaged to obtain the original lamp bead image. The original lamp bead image is subjected to bilateral filtering denoising to obtain a preliminary denoised image. Bilateral filtering is a filtering method that considers both spatial neighborhood and pixel value similarity, which can effectively remove noise while retaining the edge details of the image. The mathematical expression of bilateral filtering is:
[0049] ;
[0050] in, It's pixels The filtered value, It's pixels The value of It's pixels Neighborhood of is the weight function of pixel value similarity, is the weight function of the spatial neighborhood, is the normalization factor. Calculate the global histogram based on the preliminary denoised image and determine the optimal threshold. The global histogram shows the number of pixels at each gray level in the image, and the gray distribution of the image is analyzed by the histogram. For example, using the Otsu threshold method, the optimal threshold is determined by maximizing the inter-class variance, and the formula is:
[0051] ;
[0052] in, is the threshold The between-class variance at and The thresholds are The pixel ratio below and above, and The thresholds are The pixel mean below and above. At the same time, threshold segmentation is performed on the preliminary denoised image to obtain a binary image. The binary image divides the pixels in the image into two categories: foreground and background. Hole filling is performed on the binary image to obtain a binary image without holes. Hole filling makes the foreground area more coherent and complete by filling small holes in the binary image. Morphological opening operation is performed on the binary image without holes to remove noise spots and obtain the opening operation result image. Morphological opening operation is an image processing method that combines erosion and dilation operations, which can effectively remove small spots and fine noise in the image. A linear stretching transformation is performed based on the grayscale statistical information of the opening operation result image to obtain a grayscale stretched image. The linear stretching transformation improves the contrast of the image by adjusting the grayscale range of the image. The formula is:
[0053] ;
[0054] in, and are the input and output pixel values, respectively. and are the minimum and maximum grayscale values of the input image, respectively. and are the minimum and maximum grayscale values of the output image, respectively. Adaptive histogram equalization algorithm is used for the grayscale stretched image to enhance the image contrast and obtain a contrast enhanced image. Adaptive histogram equalization makes the image details clearer and evenly distributed by locally adjusting the contrast of the image. Edge detection is performed on the contrast enhanced image to obtain an edge detection result image. Edge detection identifies the edges and contours in the image by detecting the brightness changes in the image. Common edge detection algorithms include Canny edge detection, which detects edges by calculating the gradient of the image. Small area connected domain analysis is performed on the edge detection result image to obtain a connected domain marker image. Connected domain analysis identifies the target area in the image by combining connected pixels into regions. The effective target area is extracted according to the connected domain features of the connected domain marker image to obtain the target area image. Geometric correction is performed on the target area image to obtain the target lamp bead image. Geometric correction corrects the deformation and distortion of the image to make the shape of the target area in the image more regular and accurate.
[0055] In a specific embodiment, the process of executing step S102 may specifically include the following steps:
[0056] (1) Perform Gaussian smoothing filtering on the target lamp bead image to obtain a smoothed image, and construct a Gaussian pyramid based on the smoothed image to obtain a Gaussian hierarchical image set of different scales;
[0057] (2) Upsampling the Gaussian hierarchical image set to obtain an extended Gaussian hierarchical image set, and performing pixel difference on adjacent layer images of the extended Gaussian hierarchical image set to obtain a Laplacian hierarchical image set;
[0058] (3) Selecting the lowest resolution layer from the Laplacian hierarchy image set as the background layer, and selecting the remaining layers except the background layer from the Laplacian hierarchy image set as the feature layer set;
[0059] (4) Perform non-maximum suppression on each layer of the feature layer set to obtain a multi-layer feature map.
[0060] Specifically, the target lamp bead image is subjected to Gaussian smoothing filtering. The image is convolved using a Gaussian kernel, which is a smoothing filter defined by a Gaussian function, and its formula is:
[0061] ;
[0062] in, is the Gaussian kernel function value, and are pixel coordinates, is the standard deviation, which determines the width of the Gaussian kernel. By convolving the target lamp bead image with the Gaussian kernel, a smooth image is obtained to reduce the influence of noise and details. A Gaussian pyramid is constructed based on the smoothed image. The Gaussian pyramid is a multi-scale image representation method, which is constructed by downsampling and Gaussian filtering the image layer by layer. The original image is Gaussian filtered, and then each layer of the image is downsampled (usually taking a value every other pixel) to generate a series of images with decreasing resolution to obtain different levels of the Gaussian pyramid. In this way, Gaussian hierarchical image sets of different scales are obtained. The Gaussian hierarchical image set is upsampled to obtain an extended Gaussian hierarchical image set. Upsampling is the process of enlarging a low-resolution image to a high-resolution image, which is usually achieved through interpolation methods, such as bilinear interpolation. After upsampling, the adjacent layer images of the extended Gaussian hierarchical image set are pixel-differentiated to obtain a Laplacian hierarchical image set. The Laplacian hierarchical image set is obtained by pixel-differentiating each layer of the Gaussian hierarchical image set with the extended image of the previous layer, and its formula is:
[0063] ;
[0064] in, is the first image set of the Laplacian hierarchy layer, is the first Layer, Upsample It is The extended image of the layer. The lowest resolution layer is selected as the background layer from the Laplacian hierarchy image set. The lowest resolution layer usually contains the overall structural information of the image. The remaining layers except the background layer are selected from the Laplacian hierarchy image set as the feature layer set. Non-maximum suppression is performed on each layer of the feature layer set to obtain a multi-layer feature map. Non-maximum suppression is an edge detection method used to remove non-local maximum responses, thereby retaining only feature points of local maxima. By performing non-maximum suppression on the feature map of each layer, noise and redundant information are removed, making the feature points clearer and more accurate.
[0065] In a specific embodiment, the process of executing step S103 may specifically include the following steps:
[0066] (1) Construct a dual-channel convolutional neural network model, which includes a detail feature extraction channel and a structural feature extraction channel;
[0067] (2) Input the multi-layer feature map into the dual-channel convolutional neural network model. In the detail feature extraction channel, convolution operation is performed on each layer of the input feature map to extract local detail features. At the same time, in the structural feature extraction channel, global pooling is performed on each layer of the input feature map to capture global structural information.
[0068] (3) The output feature map of the detail feature extraction channel is weighted by the channel attention mechanism to obtain a weighted detail feature map, and the output feature map of the structure feature extraction channel is weighted by the channel attention mechanism to obtain a weighted structure feature map;
[0069] (4) Fusing the weighted detail feature map and the weighted structure feature map to obtain a fused feature map, and upsampling the fused feature map to restore it to the original resolution to obtain an upsampled feature map;
[0070] (5) Perform feature decoding on the upsampled feature map to reconstruct detail features and structural features, and use the reconstructed detail features and structural features as the detail feature information and structural feature information of each layer of the feature map, respectively.
[0071] Specifically, a dual-channel convolutional neural network model is constructed, which includes a detail feature extraction channel and a structural feature extraction channel. The multi-layer feature map is input into the dual-channel convolutional neural network model. In the detail feature extraction channel, a convolution operation is performed on each layer of the input feature map. The convolution operation extracts local detail features by sliding the convolution kernel on the image. These convolution kernels can capture detail information such as edges and corners. The formula for the convolution operation is:
[0072] ;
[0073] in, is the output feature map at position The value at is the input feature map at position The value at is the convolution kernel at position The weight of is the bias. At the same time, in the structural feature extraction channel, a global pooling operation is performed on each layer of the input feature map. Global pooling compresses the global structural information of the image into a feature vector by performing a pooling operation on the entire feature map, captures the global features of the image, obtains the overall shape and layout information of the image, and helps to understand the global structure of the image. The output feature map of the detail feature extraction channel is weighted by the channel attention mechanism. The channel attention mechanism can highlight important feature information by calculating the importance weight of each channel and weighting the feature map. At the same time, the output feature map of the structural feature extraction channel is weighted by the channel attention mechanism to obtain a weighted structural feature map. The weighted detail feature map and the weighted structural feature map are feature fused to obtain a fused feature map. By combining the detail features and the structural features, a comprehensive feature representation is formed to better describe the information in the image. The fused feature map is upsampled to restore it to the original resolution. Upsampling enlarges the feature map back to the original resolution through interpolation or deconvolution, and obtains an upsampled feature map, so that the fused feature map can maintain the same size as the original image. The upsampled feature map is decoded to reconstruct detail features and structural features. Feature decoding decodes the fused feature map back to specific detail and structural feature representations through operations such as inverse convolution, and uses the reconstructed detail features and structural features as the detail feature information and structural feature information of each layer of feature map.
[0074] In a specific embodiment, the process of executing step S104 may specifically include the following steps:
[0075] (1) Perform Gaussian blur filtering on the detail feature information to obtain a smooth detail feature map, and calculate the pixel grayscale gradient amplitude based on the smooth detail feature map to obtain a detail gradient amplitude map;
[0076] (2) Perform median filtering on the structural feature information to obtain a smooth structural feature map, and calculate the pixel grayscale gradient direction based on the smooth structural feature map to obtain a structural gradient direction map;
[0077] (3) Processing the detail gradient amplitude map and the structure gradient direction map to obtain the detail saliency map and the structure saliency map;
[0078] (4) Calculate the pixel area brightness saliency weight coefficient matrix based on the detail saliency map, and calculate the pixel area contrast saliency weight coefficient matrix based on the structure saliency map;
[0079] (5) Perform weighted fusion of detail feature information and regional brightness significance weight coefficient matrix to obtain brightness fusion feature map, and perform weighted fusion of structure feature information and regional contrast significance weight coefficient matrix to obtain contrast fusion feature map;
[0080] (6) Perform pixel-level fusion on the brightness fusion feature map and the contrast fusion feature map to obtain the sub-feature detection results of each layer of feature map.
[0081] Specifically, Gaussian blur filtering is performed on the detail feature information to obtain a smooth detail feature map. Gaussian blur filtering makes the image smoother by reducing high-frequency noise in the image while retaining the main structural information. The pixel grayscale gradient amplitude is calculated based on the smoothed detail feature map to obtain a detail gradient amplitude map. The grayscale gradient amplitude represents the grayscale change intensity of each pixel in the image, thereby highlighting the detail change area in the image. The calculation formula of the grayscale gradient amplitude is:
[0082] ;
[0083] Among them, Grad It's location The gray gradient amplitude at and The images are Direction and At the same time, median filtering is performed on the structural feature information to obtain a smooth structural feature map. Median filtering is a nonlinear filtering method that removes noise by taking the median of pixels in the neighborhood to maintain the edge information of the image. The pixel grayscale gradient direction is calculated based on the smoothed structural feature map to obtain a structural gradient direction map. The grayscale gradient direction indicates the direction of grayscale change of each pixel in the image, thereby capturing the structural characteristics of the image. The calculation formula for the grayscale gradient direction is:
[0084] ;
[0085] in, It's location The gray gradient direction at . The detail gradient amplitude map and the structure gradient direction map are processed to obtain the detail saliency map and the structure saliency map respectively. The detail saliency map provides saliency information of detail features by highlighting the saliency detail areas in the image. The structure saliency map provides saliency information of structural features by highlighting the saliency structure areas in the image. These saliency maps can help identify and distinguish important feature areas in the image. The pixel region brightness saliency weight coefficient matrix is calculated according to the detail saliency map. The brightness saliency weight coefficient matrix represents the brightness saliency weight of each pixel region, so that the image can highlight the area with significant brightness. At the same time, the pixel region contrast saliency weight coefficient matrix is calculated according to the structure saliency map. The contrast saliency weight coefficient matrix represents the contrast saliency weight of each pixel region, so that the image can highlight the area with significant contrast. The detail feature information is weighted fused with the regional brightness saliency weight coefficient matrix to obtain the brightness fusion feature map. The weighted fusion multiplies the detail feature information with the brightness saliency weight coefficient so that the detail feature has a higher weight in the area with significant brightness. Similarly, the structure feature information is weighted fused with the regional contrast saliency weight coefficient matrix to obtain the contrast fusion feature map. Weighted fusion multiplies the structural feature information with the contrast significance weight coefficient, so that the structural feature is given a higher weight in the area with significant contrast. The brightness fusion feature map and the contrast fusion feature map are fused at the pixel level to obtain the sub-feature detection results of each layer of feature map. The brightness fusion feature map and the contrast fusion feature map are added pixel by pixel or other fusion operations are performed, so that the final feature map contains significant feature information of both brightness and contrast, thereby enhancing the comprehensive expression ability of the feature map.
[0086] In a specific embodiment, the process of executing step S105 may specifically include the following steps:
[0087] (1) Decompose the background layer by wavelet transform to obtain low-frequency components and high-frequency components;
[0088] (2) Reconstruct the background layer approximate image based on the low-frequency components, and perform soft threshold denoising on the high-frequency components to obtain the denoised high-frequency components;
[0089] (3) Reconstructing the background layer detail image based on the denoised high-frequency components, and performing wavelet reconstruction on the background layer approximate image and the background layer detail image to obtain a reconstructed background layer image, and generating a pure background layer result based on the reconstructed background layer image;
[0090] (4) Perform pixel-level logical AND operations on the pure background layer results and the sub-feature detection results of each layer of feature maps to obtain an AND operation result set;
[0091] (5) Perform region growing algorithm clustering on the result set of AND operation to obtain the target region set, and then encode and vectorize the target region set to obtain the result integration vector.
[0092] Specifically, wavelet transform is applied to the background layer to decompose and obtain low-frequency components and high-frequency components. Wavelet transform is a commonly used signal processing method. By decomposing the signal into components of different frequencies, the features in the signal can be effectively extracted. The basic formula of wavelet transform is:
[0093] ;
[0094] in, are the wavelet coefficients, is the scale parameter, is the translation parameter, is the input signal, is the mother wavelet function. By performing wavelet transform decomposition on the background layer, low-frequency components and high-frequency components are obtained. The low-frequency component contains the main structure and global information of the image, while the high-frequency component contains the details and noise information of the image. The approximate image of the background layer is reconstructed based on the low-frequency component. The reconstruction of the low-frequency component is achieved through inverse wavelet transform, which can restore the main structure and contour of the image. At the same time, the high-frequency component is subjected to soft threshold denoising to obtain the denoised high-frequency component. Soft threshold denoising is a commonly used denoising method. By applying threshold processing to the high-frequency component, noise can be effectively removed while retaining the details of the image. The formula for soft threshold processing is:
[0095] ;
[0096] in, is the value after soft threshold denoising, is the input signal, is the threshold value, is a symbolic function. Based on the denoised high-frequency components, the background layer detail image is reconstructed. The reconstruction of the high-frequency components is achieved by inverse wavelet transform, which can restore the detail information of the image. The background layer approximate image and the background layer detail image are reconstructed by wavelet to obtain the reconstructed background layer image. Wavelet reconstruction generates a complete image containing the main structure and detail information by recombining the low-frequency components and the high-frequency components. By reconstructing the background layer image, a pure background layer result is generated. The pure background layer result and the sub-feature detection result of each layer feature map are logically ANDed at the pixel level to obtain the AND operation result set. The logical AND operation effectively combines the background layer information and the feature detection results by performing a pixel-by-pixel logical AND operation on the two binary images, thereby highlighting the target feature area in the image. The AND operation result set is clustered by the region growing algorithm to obtain the target region set. The region growing algorithm is an image segmentation method that identifies the connected target area in the image by combining adjacent pixels into regions. Specifically, the region growing algorithm starts from an initial seed point and adds adjacent pixels to the region according to the similarity of the pixels until no similar pixels can be added. The target area set is encoded and vectorized to obtain the result integration vector. Encoding and vectorization converts the information of the target area into a vector form by encoding and vectorizing the target area, which is convenient for subsequent classification and analysis.
[0097] In a specific embodiment, the process of executing step S106 may specifically include the following steps:
[0098] (1) Perform principal component analysis on the resulting integrated vector to obtain the feature vector after dimensionality reduction, and construct a multi-view feature space based on the feature vector after dimensionality reduction;
[0099] (2) Sampling in the multi-view feature space to generate positive and negative sample sets, and performing kernel technique mapping on the positive and negative sample sets to obtain a high-dimensional feature sample set;
[0100] (3) Training multiple support vector machine classifiers based on the high-dimensional feature sample set to obtain multiple support vector machine classifier sets;
[0101] (4) Perform weighted integration on multiple support vector machine classifier sets to obtain a multi-view dual support vector machine model;
[0102] (5) Input the reduced feature vector into the multi-view dual support vector machine model to obtain the classification score vector;
[0103] (6) Calculate the classification confidence score based on the classification score vector;
[0104] (7) Compare the classification confidence score with the preset threshold, determine the defect category, and output the defect classification detection result of the LED lamp bead.
[0105] Specifically, principal component analysis is performed on the result integrated vector to obtain the feature vector after dimensionality reduction. Principal component analysis is a dimensionality reduction technique that maps high-dimensional data to low-dimensional space by finding the main components of the data and retains the main information of the data. A multi-view feature space is constructed based on the feature vector after dimensionality reduction. The multi-view feature space can capture the diversity and complexity of data by representing features at different perspectives. In this space, sampling is performed to generate positive and negative sample sets. The positive sample set represents normal LED lamp beads, and the negative sample set represents defective LED lamp beads. The positive and negative sample sets are mapped by kernel techniques to obtain a high-dimensional feature sample set. The kernel technique is a method of mapping data from a low-dimensional space to a high-dimensional space through nonlinear mapping, so that the originally linearly inseparable data becomes linearly separable in the high-dimensional space. Based on the high-dimensional feature sample set, multiple support vector machine classifiers are trained to obtain multiple support vector machine classifier sets. Support vector machine is a supervised learning model that classifies data by finding an optimal hyperplane. The basic formula of support vector machine is:
[0106] ;
[0107] in, is the classification function, is the weight vector, is the feature vector after kernel trick mapping, is the bias. By training multiple support vector machine classifiers, multiple different classification models are obtained. These models can capture the characteristics and patterns of data more comprehensively through different perspectives and kernel functions. A multi-perspective dual support vector machine model is obtained by weighted integration of multiple support vector machine classifier sets. Weighted integration improves the overall classification performance by weighted averaging the output of each classifier and combining the advantages of each classifier. The reduced feature vector is input into the multi-perspective dual support vector machine model to obtain a classification score vector. The classification score vector represents the score of each sample under each classifier. By combining these scores, the category of the sample is judged. The classification confidence score is calculated based on the classification score vector. The classification confidence score represents the credibility of the classification result. By comparing the confidence scores, the reliability of the classification result is judged. The classification confidence score is compared with the preset threshold to determine the defect category and output the defect classification detection result of the LED lamp bead. The preset threshold is a benchmark value set according to the actual application requirements. When the classification confidence score exceeds the threshold, the sample is considered to belong to a certain defect category, otherwise the sample is considered to be defect-free.
[0108] The above describes the detection method of the LED lamp beads in the embodiment of the present application. The following describes the detection device of the LED lamp beads in the embodiment of the present application. Figure 2 In the embodiment of the present application, an embodiment of the detection device of LED lamp beads includes:
[0109] The acquisition module 201 is used to acquire images of LED lamp beads to obtain original lamp bead images, and to perform denoising, grayscale conversion and contrast enhancement on the original lamp bead images to obtain target lamp bead images;
[0110] The segmentation module 202 is used to perform multi-scale segmentation on the target lamp bead image using the Laplace pyramid algorithm to obtain a multi-layer feature map and a background layer;
[0111] The extraction module 203 is used to extract features from the multiple layers of feature maps using a convolutional neural network to obtain detail feature information and structural feature information of each layer of feature maps;
[0112] A fusion module 204 is used to perform weighted fusion of regional brightness and contrast significance on each layer of feature maps according to detail feature information and structural feature information to obtain sub-feature detection results of each layer of feature maps;
[0113] The processing module 205 is used to perform noise and false target elimination processing on the background layer to obtain a pure background layer result, and perform logical operations and integration on the pure background layer result and the sub-feature detection results of each layer of the feature map to obtain a result integration vector;
[0114] The decision module 206 is used to input the result integration vector into a preset multi-view dual support vector machine model to perform lamp bead defect classification decision and obtain the LED lamp bead defect classification decision result.
[0115] Through the synergy of the above components, the original lamp bead image is denoised, grayscale transformed and contrast enhanced, which significantly improves the image quality and detail clarity. The Laplace pyramid algorithm is used for multi-scale segmentation, which can effectively separate feature maps and background layers of different scales to ensure the comprehensive capture of detail and structural information. By constructing a dual-channel convolutional neural network model, detail feature information and structural feature information are extracted respectively, ensuring the comprehensive capture of local details and global structures in the LED lamp bead image. The combination of detail feature channel and structural feature channel is weighted by the attention mechanism to improve the accuracy of feature extraction. The regional brightness and contrast saliency of each layer of feature map is weighted and fused, and the image is refined by calculating the saliency of detail features and structural features. Saliency weighted fusion not only improves the accuracy of sub-feature detection results, but also effectively suppresses the influence of noise and irrelevant background in the fusion process. By eliminating noise and pseudo targets from the background layer, a pure background layer result is obtained. Through wavelet transform and soft threshold denoising technologies, the purity of the background layer is ensured, so that only real and effective target information is retained during logical operations and integration, greatly reducing the possibility of false detection. Using a multi-view dual support vector machine model to make classification decisions on the result integration vector, it is possible to more comprehensively consider the feature information under different perspectives, significantly improving the accuracy and stability of defect classification. Multi-view learning combined with principal component analysis and kernel skill mapping not only enhances the generalization ability of the model, but also effectively avoids the overfitting problem, thereby improving the detection accuracy of LED lamp beads.
[0116] The present application also provides an LED lamp bead detection device, which includes a memory and a processor. The memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, the processor executes the steps of the LED lamp bead detection method in the above-mentioned embodiments.
[0117] The present application also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. Instructions are stored in the computer-readable storage medium. When the instructions are executed on a computer, the computer executes the steps of the LED lamp bead detection method.
[0118] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described systems, systems and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0119] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program codes.
[0120] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for detecting LED lamp beads, characterized in that: The LED lamp bead detection method comprises: Capturing images of LED lamp beads to obtain original lamp bead images, and performing denoising, grayscale conversion, and contrast enhancement on the original lamp bead images to obtain target lamp bead images; The target lamp bead image is segmented at multiple scales using a Laplacian pyramid algorithm to obtain a multi-layer feature map and a background layer; Using a convolutional neural network to extract features from the multiple layers of feature maps, respectively, to obtain detail feature information and structural feature information of each layer of feature maps; According to the detail feature information and the structural feature information, each layer of feature map is subjected to weighted fusion of regional brightness and contrast significance to obtain sub-feature detection results of each layer of feature map; specifically comprising: performing Gaussian blur filtering on the detail feature information to obtain a smooth detail feature map, and calculating the pixel grayscale gradient amplitude according to the smooth detail feature map to obtain a detail gradient amplitude map; performing median filtering on the structural feature information to obtain a smooth structural feature map, and calculating the pixel grayscale gradient direction according to the smooth structural feature map to obtain a structural gradient direction map; processing the detail gradient amplitude map and the structural gradient direction map to obtain a detail saliency map and a structural saliency map; calculating according to the detail saliency map A pixel region brightness significance weight coefficient matrix, the brightness significance weight coefficient matrix represents the brightness significance weight of each pixel region, and at the same time, a pixel region contrast significance weight coefficient matrix is calculated according to the structural significance map, and the contrast significance weight coefficient matrix represents the contrast significance weight of each pixel region; the detail feature information is weightedly fused with the regional brightness significance weight coefficient matrix to obtain a brightness fusion feature map, and the structural feature information is weightedly fused with the regional contrast significance weight coefficient matrix to obtain a contrast fusion feature map; the brightness fusion feature map and the contrast fusion feature map are pixel-level fused to obtain a sub-feature detection result of each layer of the feature map; The background layer is subjected to noise and false target elimination processing to obtain a pure background layer result, and the pure background layer result and the sub-feature detection result of each layer of feature map are subjected to logical operation and integration to obtain a result integration vector; specifically, the method includes: performing wavelet transform decomposition on the background layer to obtain low-frequency components and high-frequency components; reconstructing an approximate image of the background layer according to the low-frequency components, and performing soft threshold denoising on the high-frequency components to obtain denoised high-frequency components; reconstructing a detailed image of the background layer according to the denoised high-frequency components, and performing wavelet reconstruction on the approximate image of the background layer and the detailed image of the background layer to obtain a reconstructed background layer image, and generating a pure background layer result according to the reconstructed background layer image; performing pixel-level logical AND operation on the pure background layer result and the sub-feature detection result of each layer of feature map to obtain an AND operation result set; performing region growing algorithm clustering on the AND operation result set to obtain a target region set, and encoding and vectorizing the target region set to obtain a result integration vector; The result integration vector is input into a preset multi-view dual support vector machine model to perform lamp bead defect classification decision, so as to obtain the defect classification decision result of the LED lamp bead.
2. The method for detecting LED lamp beads according to claim 1, characterized in that: The method of collecting images of LED lamp beads to obtain an original lamp bead image, and performing denoising, grayscale conversion and contrast enhancement on the original lamp bead image to obtain a target lamp bead image includes: Capturing an image of an LED lamp bead to obtain an original lamp bead image, and performing bilateral filtering denoising processing on the original lamp bead image to obtain a preliminary denoised image; Calculating a global histogram and determining an optimal threshold value based on the preliminary denoised image, and at the same time, performing threshold segmentation on the preliminary denoised image to obtain a binary image; Filling holes in the binary image to obtain a binary image without holes, and performing a morphological opening operation on the binary image without holes to remove noise spots and obtain an opening operation result image; Performing a linear stretching transformation according to the grayscale statistical information of the opening operation result image to obtain a grayscale stretched image, and using an adaptive histogram equalization algorithm on the grayscale stretched image to enhance the image contrast to obtain a contrast enhanced image; Performing edge detection on the contrast enhanced image to obtain an edge detection result image, and performing small area connected domain analysis on the edge detection result image to obtain a connected domain labeled image; The effective target area is extracted according to the connected domain features of the connected domain marking image to obtain a target area image, and the target area image is geometrically corrected to obtain a target lamp bead image.
3. The method for detecting LED lamp beads according to claim 1, characterized in that: The Laplace pyramid algorithm is used to perform multi-scale segmentation on the target lamp bead image to obtain a multi-layer feature map and a background layer, including: Performing Gaussian smoothing filtering on the target lamp bead image to obtain a smoothed image, and constructing a Gaussian pyramid based on the smoothed image to obtain a Gaussian hierarchical image set of different scales; Upsampling the Gaussian hierarchical image set to obtain an extended Gaussian hierarchical image set, and performing pixel difference on adjacent layer images of the extended Gaussian hierarchical image set to obtain a Laplacian hierarchical image set; Selecting the lowest resolution layer from the Laplacian hierarchy image set as the background layer, and selecting the remaining layers except the background layer from the Laplacian hierarchy image set as the feature layer set; Non-maximum suppression is performed on each layer of the feature layer set to obtain a multi-layer feature map.
4. The method for detecting LED lamp beads according to claim 1, characterized in that: The convolutional neural network is used to extract features from the multiple layers of feature maps to obtain detail feature information and structural feature information of each layer of feature maps, including: Constructing a dual-channel convolutional neural network model, wherein the dual-channel convolutional neural network model includes a detail feature extraction channel and a structural feature extraction channel; Input the multi-layer feature map into the dual-channel convolutional neural network model, perform convolution operation on each layer of the input feature map in the detail feature extraction channel to extract local detail features, and at the same time, perform global pooling on each layer of the input feature map in the structural feature extraction channel to capture global structural information; Performing a channel attention mechanism weighting on the output feature map of the detail feature extraction channel to obtain a weighted detail feature map, and performing a channel attention mechanism weighting on the output feature map of the structure feature extraction channel to obtain a weighted structure feature map; Performing feature fusion on the weighted detail feature map and the weighted structure feature map to obtain a fused feature map, and upsampling the fused feature map to restore it to the original resolution to obtain an upsampled feature map; Feature decoding is performed on the upsampled feature map to reconstruct detail features and structural features, and the reconstructed detail features and structural features are used as detail feature information and structural feature information of each layer of feature map, respectively.
5. A detection device for LED lamp beads, characterized in that: The detection device of the LED lamp bead comprises: The acquisition module is used to acquire images of LED lamp beads to obtain original lamp bead images, and to perform denoising, grayscale conversion and contrast enhancement on the original lamp bead images to obtain target lamp bead images; A segmentation module, used to perform multi-scale segmentation on the target lamp bead image using a Laplace pyramid algorithm to obtain a multi-layer feature map and a background layer; An extraction module, used to extract features from the multi-layer feature maps using a convolutional neural network to obtain detail feature information and structural feature information of each layer of feature maps; The fusion module is used to perform weighted fusion of regional brightness and contrast significance on each layer of feature maps according to the detail feature information and the structural feature information to obtain sub-feature detection results of each layer of feature maps; specifically comprising: performing Gaussian blur filtering on the detail feature information to obtain a smooth detail feature map, and calculating the pixel grayscale gradient amplitude according to the smooth detail feature map to obtain a detail gradient amplitude map; performing median filtering on the structural feature information to obtain a smooth structural feature map, and calculating the pixel grayscale gradient direction according to the smooth structural feature map to obtain a structural gradient direction map; processing the detail gradient amplitude map and the structural gradient direction map to obtain a detail saliency map and a structural saliency map; and calculating the pixel grayscale gradient direction according to the detail saliency map. Calculate the brightness significance weight coefficient matrix of the pixel region, the brightness significance weight coefficient matrix represents the brightness significance weight of each pixel region, and at the same time, calculate the contrast significance weight coefficient matrix of the pixel region according to the structural significance map, the contrast significance weight coefficient matrix represents the contrast significance weight of each pixel region; perform weighted fusion on the detail feature information and the regional brightness significance weight coefficient matrix to obtain a brightness fusion feature map, and perform weighted fusion on the structural feature information and the regional contrast significance weight coefficient matrix to obtain a contrast fusion feature map; perform pixel-level fusion on the brightness fusion feature map and the contrast fusion feature map to obtain a sub-feature detection result of each layer of the feature map; The processing module is used to perform noise and false target elimination processing on the background layer to obtain a pure background layer result, and perform logical operations and integration on the pure background layer result and the sub-feature detection results of each layer of feature map to obtain a result integration vector; specifically comprising: performing wavelet transform decomposition on the background layer to obtain low-frequency components and high-frequency components; reconstructing an approximate image of the background layer according to the low-frequency components, and performing soft threshold denoising on the high-frequency components to obtain denoised high-frequency components; reconstructing a background layer detail image according to the denoised high-frequency components, and performing wavelet reconstruction on the background layer approximate image and the background layer detail image to obtain a reconstructed background layer image, and generating a pure background layer result according to the reconstructed background layer image; performing pixel-level logical AND operations on the pure background layer result and the sub-feature detection results of each layer of feature map to obtain an AND operation result set; performing region growing algorithm clustering on the AND operation result set to obtain a target region set, and encoding vectorization on the target region set to obtain a result integration vector; The decision module is used to input the result integration vector into a preset multi-view dual support vector machine model to perform lamp bead defect classification decision to obtain the defect classification decision result of the LED lamp bead.
6. A detection device for LED lamp beads, characterized in that: The LED lamp bead detection device comprises: a memory and at least one processor, wherein instructions are stored in the memory; The at least one processor calls the instruction in the memory so that the LED lamp bead detection device executes the LED lamp bead detection method according to any one of claims 1 to 4.
7. A computer-readable storage medium having instructions stored thereon, characterized in that: When the instruction is executed by the processor, the LED lamp bead detection method according to any one of claims 1 to 4 is implemented.
