Liquid crystal panel defect detection method based on image analysis

By using frequency domain wavelet packet decomposition and adaptive morphological filtering kernel processing, the problem of missing detection of tiny dark spot defects under gradient illumination on large-size LCD screens was solved, achieving efficient defect detection and classification, and improving the accuracy and robustness of detection.

CN122435346APending Publication Date: 2026-07-21SHENZHEN CHUNLAI INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHENZHEN CHUNLAI INFORMATION TECHNOLOGY CO LTD
Filing Date
2026-05-06
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

Existing technologies cannot effectively distinguish between gradient lighting and tiny dark spot defects when inspecting large-size LCD screens. This leads to the destruction of the grayscale distribution characteristics of tiny dark spot defects, resulting in missed defects during binarization processing due to the small grayscale difference.

Method used

By converting the LCD screen surface image into a frequency domain signal and performing wavelet packet decomposition, the frequency domain coefficient matrix of the low-frequency background component and the mid-to-high-frequency detail component is extracted. The uniform illumination reference matrix is ​​fitted using an adaptive morphological filter kernel. The mid-to-high-frequency coefficient matrix is ​​then weighted and corrected by combining a spatial adaptive weight matrix and a Bayesian estimation soft threshold function to generate a reconstructed difference image that removes the illumination background. Finally, the defect location and category are output through an isolated forest classifier.

Benefits of technology

It effectively eliminates the interference of non-uniform illumination components, preserves the original edge gradient and texture structure of small dark spot defects, improves the robustness of defect detection, and reduces the false detection rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122435346A_ABST
    Figure CN122435346A_ABST
Patent Text Reader

Abstract

The present application belongs to the technical field of image recognition, and particularly relates to a liquid crystal screen defect detection method based on image analysis. The method comprises: acquiring a liquid crystal screen surface image frequency domain signal and wavelet packet decomposition, and extracting a low frequency and medium-high frequency coefficient matrix; performing convolution on the low frequency coefficient matrix with an adaptive morphological filter kernel, fitting to generate a uniform illumination reference matrix; after weighted correction and denoising of the medium-high frequency coefficient matrix, inverse wavelet packet transformation is performed on the medium-high frequency coefficient matrix and the uniform illumination reference matrix to generate a reconstructed difference image; the local pixel gradient direction vector and the gray level co-occurrence matrix contrast feature of the reconstructed difference image are input into an isolation forest classifier to output a defect position and category. The present scheme shifts illumination separation to the frequency domain, avoids damage to defect pixels by spatial domain filtering, eliminates non-uniform illumination interference, retains the edge gradient and texture structure of small defects, and solves the problem of missing detection of small dark spots under a gradual illumination background.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of image recognition technology, specifically relating to a method for detecting defects in liquid crystal displays based on image analysis. Background Technology

[0002] Current LCD screen defect detection typically employs image recognition technology. For minor dark spot defects on the surface, the industry generally uses spatial domain background subtraction or Gaussian filtering for illumination equalization. The specific implementation process is as follows: The original grayscale image of the LCD screen surface is acquired. A fixed-size sliding window is set in the spatial domain. A Gaussian kernel function is used to calculate the weighted average value of each pixel within the sliding window. This weighted average value is used as the local background reference grayscale. The original grayscale image is then subtracted from this local background reference grayscale value to obtain the difference image. Subsequently, a fixed global grayscale threshold is set to binarize the difference image, extracting the areas of abrupt grayscale changes as defect areas.

[0003] The aforementioned existing technology has a core flaw when processing large-size LCD screens: large-size LCD screens generally exhibit gradual, non-uniform illumination at the edges or center, which manifests as a wide range of low-frequency grayscale fluctuations in the spatial domain. Because existing technologies directly use a fixed-size sliding window for Gaussian filtering in the spatial domain, the Gaussian kernel function cannot distinguish the grayscale distribution differences between the wide range of gradual illumination and tiny dark spot defects. In the process of smoothing the wide range of low-frequency grayscale fluctuations, the grayscale characteristics of the tiny dark spot defects themselves are also smoothed out, resulting in the destruction of the original grayscale distribution characteristics of the tiny dark spot defects. Consequently, in subsequent binarization processing, the defects are missed due to the small grayscale differences. Summary of the Invention

[0004] The purpose of this invention is to provide a method for detecting defects in liquid crystal displays based on image analysis, which can effectively solve the problems mentioned in the background art.

[0005] To achieve the above objectives, the technical solution adopted by the present invention is as follows:

[0006] A defect detection method for liquid crystal displays based on image analysis includes: acquiring an image of the surface of the liquid crystal display, converting the image of the surface of the liquid crystal display into a frequency domain signal and performing wavelet packet decomposition, and extracting a frequency domain coefficient matrix containing low-frequency background components and mid-to-high-frequency detail components.

[0007] The low-frequency coefficient matrix in the frequency domain coefficient matrix is ​​convolved using a preset adaptive morphological filter kernel to fit and generate a uniform illumination reference matrix that characterizes the non-uniform illumination distribution on the surface of the liquid crystal screen.

[0008] The mid-to-high frequency coefficient matrix in the frequency domain coefficient matrix is ​​subjected to inverse wavelet packet transform with the uniform illumination reference matrix to generate a reconstructed difference image with the illumination background removed.

[0009] In the reconstructed difference image, the contrast features of the local pixel gradient direction vector and the gray-level co-occurrence matrix are calculated;

[0010] The gradient direction vector and the contrast feature are input into a pre-built isolated forest classifier, which outputs the location coordinates and defect category of the Mura defect.

[0011] Preferably, converting the liquid crystal screen surface image into a frequency domain signal and performing wavelet packet decomposition includes: performing grayscale processing on the liquid crystal screen surface image and calculating the texture energy entropy of the current grayscale image;

[0012] The texture energy entropy is compared with a preset energy threshold. When the texture energy entropy is greater than the preset energy threshold, the wavelet packet decomposition layer is determined to be three layers. When the texture energy entropy is less than or equal to the preset energy threshold, the wavelet packet decomposition layer is determined to be four layers.

[0013] Using bioorthogonal wavelet basis functions, wavelet packet decomposition is performed on the grayscale image according to a determined number of wavelet packet decomposition levels to obtain the frequency domain coefficient matrix. The frequency domain coefficient matrix is ​​extracted as the low-frequency coefficient matrix at the lowest frequency band node corresponding to the wavelet packet decomposition level, and as the mid-to-high frequency coefficient matrix at the remaining frequency band nodes.

[0014] Preferably, the low-frequency coefficient matrix is ​​convolved using a preset adaptive morphological filter kernel, including: extracting the local gradient tensor field of the low-frequency coefficient matrix, and calculating the feature values ​​and feature vectors of each pixel position in the local gradient tensor field.

[0015] The elliptic eccentricity of each pixel position is calculated based on the eigenvalues, and the principal gradient direction of each pixel position is determined based on the eigenvectors.

[0016] Based on the ellipse eccentricity and the principal gradient direction, a non-uniform structural element is constructed with its size dynamically scaling with the ellipse eccentricity and its major axis aligned with the principal gradient direction. This non-uniform structural element is then used as the adaptive morphological filter kernel.

[0017] The adaptive morphological filter kernel is used to perform an opening operation convolution on the low-frequency coefficient matrix to smooth local gray-level jumps in the low-frequency coefficient matrix and generate the uniform illumination reference matrix.

[0018] Preferably, performing inverse wavelet packet transform on the mid-to-high frequency coefficient matrix and the uniform illumination reference matrix to generate a reconstructed difference image with background removed includes: calculating the local pixel variance of each high-frequency sub-band in the mid-to-high frequency coefficient matrix, and constructing a spatial adaptive weight matrix based on the local pixel variance;

[0019] The mid-to-high frequency coefficient matrix is ​​weighted and corrected using the spatial adaptive weight matrix.

[0020] The weighted and corrected mid-to-high frequency coefficient matrix is ​​recombined with the uniform illumination reference matrix in the frequency domain to obtain the fused frequency domain coefficient matrix.

[0021] A soft thresholding function based on Bayesian estimation is applied to the high-frequency part of the fused frequency domain coefficient matrix for denoising.

[0022] An inverse wavelet packet transform is performed on the denoised fused frequency domain coefficient matrix to restore the frequency domain signal to the spatial domain signal, thus obtaining the reconstructed difference image.

[0023] Preferably, in the reconstructed difference image, calculating the local pixel gradient direction vector includes: constructing a Gabor filter bank containing multiple different spatial frequencies and different directions;

[0024] The reconstructed difference image is input to each Gabor filter in the Gabor filter bank to obtain the Gabor filter response amplitude in each direction;

[0025] Calculate the phase consistency value of the reconstructed difference image at each pixel location;

[0026] The Gabor filter response amplitudes in each direction are multiplied and fused with the phase consistency values ​​pixel by pixel to obtain the fused response map;

[0027] In the fused response map, a local sliding window is constructed with the pixel as the center. Principal component analysis feature vectors are extracted within the local sliding window, and the principal component analysis feature vectors are used as the local pixel gradient direction vectors.

[0028] Preferably, in the reconstructed difference image, calculating the contrast features of the gray-level co-occurrence matrix includes: constructing a ring-shaped neighborhood centered on the pixel to be tested in the reconstructed difference image;

[0029] The probability distribution of pixel pairs that meet the preset gray-level difference condition within the annular neighborhood is statistically analyzed to generate an annular gray-level co-occurrence matrix, wherein the generation process of the annular gray-level co-occurrence matrix does not depend on a fixed horizontal or vertical offset direction.

[0030] Perform a weighted operation on the diagonal elements of the annular gray-level co-occurrence matrix to calculate the contrast value of the annular gray-level co-occurrence matrix;

[0031] The contrast values ​​are logarithmically transformed and normalized to obtain contrast features with linear distribution characteristics. These contrast features characterize the clarity and abrupt changes of the texture surrounding the pixel under test.

[0032] Preferably, before comparing the texture energy entropy with a preset energy threshold, the method further includes: acquiring multiple historical surface images of the batch to which the current LCD screen to be detected belongs, and calculating the historical texture energy entropy of each historical surface image;

[0033] Gaussian kernel density estimation is performed on the energy entropy of multiple historical textures to generate the energy entropy probability density distribution curve of the batch to which the current LCD screen to be detected belongs.

[0034] The peak value of the energy entropy probability density distribution curve is extracted as a benchmark reference value, and the benchmark reference value is shifted towards the high entropy direction by a preset offset to generate a dynamic energy threshold.

[0035] A sliding window is used to move across the current grayscale image. Local texture energy entropy is calculated at each sliding window position. The local texture energy entropy is evaluated using the dynamic energy threshold to determine the number of local wavelet packet decomposition layers corresponding to each sliding window position.

[0036] Preferably, constructing a non-uniform structural element whose size dynamically scales with the eccentricity of the ellipse and whose major axis direction is aligned with the principal gradient direction includes: setting the basic major axis radius and basic minor axis radius of the non-uniform structural element;

[0037] Calculate the Euclidean distance from each discrete coordinate point inside the non-uniform structural element to the center coordinate point;

[0038] A distance decay function based on Gaussian distribution is constructed, and a weight coefficient is assigned to each discrete coordinate point using the distance decay function, so that the weight coefficient decreases non-linearly with the increase of the Euclidean distance.

[0039] The discrete coordinate points, after being assigned weight coefficients, are subjected to an affine transformation according to the elliptic eccentricity and the principal gradient direction to generate non-uniform structural elements with smooth edge weight transitions.

[0040] Preferably, constructing a Gabor filter bank containing multiple different spatial frequencies and directions includes: performing a two-dimensional Fourier transform on the reconstructed difference image to obtain a spectrogram;

[0041] In the spectrum diagram, the coordinates of multiple frequency domain extrema points whose amplitudes exceed a preset spectrum threshold are extracted;

[0042] Based on the coordinates of the multiple frequency domain extrema points, calculate the corresponding set of spatial frequencies and set of direction angles;

[0043] Each spatial frequency in the set of spatial frequencies is used as the center frequency of the Gabor filter, and each directional angle in the set of directional angles is used as the directional parameter of the Gabor filter. Combining the gray-level variance ratio of the local region in the reconstructed difference image, a bandpass width parameter is dynamically generated. The Gabor filter bank is constructed based on the center frequency, the directional parameter, and the bandpass width parameter.

[0044] Preferably, the distribution probability of pixel pairs that meet the preset grayscale difference condition within the annular neighborhood is statistically analyzed, including: obtaining the standard pixel array period parameters of the current LCD screen;

[0045] Based on the standard pixel array period parameters, calculate the spatial phase offset of each pixel in the annular neighborhood relative to the pixel under test;

[0046] Based on the spatial phase offset, a periodic compensation lookup table is constructed, wherein the periodic compensation lookup table records the reference grayscale offset values ​​corresponding to different spatial phase offsets.

[0047] Within the annular neighborhood, the absolute grayscale difference between any two pixels is subtracted from the corresponding baseline grayscale offset value in the periodic compensation lookup table to obtain the compensated grayscale difference.

[0048] Pixel pairs whose compensated grayscale difference is within a preset dynamic fluctuation range are marked as pixel pairs that meet the preset grayscale difference condition. The proportion of the number of pixel pairs that meet the condition to the total number of all possible pixel pairs is counted to obtain the pixel pair distribution probability.

[0049] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0050] 1. This invention transfers the illumination separation operation to the frequency domain and uses wavelet packet decomposition to extract low-frequency and mid-to-high-frequency coefficient matrices, avoiding the direct destruction of defective pixels by spatial domain filtering. An adaptive morphological filter kernel is used to fit a uniform illumination reference matrix in the frequency domain. After weighted correction and denoising of the mid-to-high-frequency coefficient matrix using a spatial adaptive weight matrix and a Bayesian estimation soft threshold function, an inverse wavelet packet transform is performed with the uniform illumination reference matrix. This eliminates interference from non-uniform illumination components and removes block artifacts during image reconstruction. This ensures that small dark spot defects retain their original edge gradients and texture structures in the reconstructed difference image, solving the problem of missed detection of small dark spot defects under gradually varying non-uniform illumination backgrounds.

[0051] 2. In the feature extraction stage, this invention introduces a Gabor filter bank dynamically generated based on spectral extreme points and a ring-shaped gray-level co-occurrence matrix. It utilizes principal component analysis eigenvectors and phase consistency numerical fusion to generate gradient direction vectors, eliminating isolated noise interference from the regularly arranged pixel electrode texture on the LCD screen surface. Simultaneously, it dynamically adjusts the wavelet packet decomposition layer based on the texture energy entropy probability density distribution, uses elliptic eccentricity and non-uniform structural elements to match the illumination gradient trend, and combines a periodic compensation lookup table to eliminate phase interference caused by the standard pixel array period, improving the robustness of defect classification results and reducing the false detection rate under different display brightness levels and local brightness fluctuations in the backlight module. Attached Figure Description

[0052] Figure 1 This is a flowchart illustrating the overall process of the image analysis-based liquid crystal screen defect detection method of the present invention.

[0053] Figure 2 This is a flowchart illustrating the dynamic determination and decomposition process of wavelet packet decomposition layers in this invention.

[0054] Figure 3 This is a flowchart of the adaptive morphological filter kernel construction and illumination reference matrix generation of the present invention;

[0055] Figure 4 This is a flowchart of the inverse wavelet packet transform and reconstruction difference image generation process of the present invention;

[0056] Figure 5 This is a flowchart of the local pixel gradient direction vector calculation process of the present invention;

[0057] Figure 6 This is a flowchart of the gray-level co-occurrence matrix contrast feature calculation of the present invention. Detailed Implementation

[0058] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0059] Please refer to Figure 1This embodiment provides an image analysis-based method for detecting defects in liquid crystal displays (LCDs). This method is applied to the illumination detection station in the LCD manufacturing process. After the LCD is supplied with a preset display drive signal and enters a full-screen pure white display state, a full-frame surface image of the LCD is acquired using an image acquisition device. The optical axis of the image acquisition device is perpendicular to the display plane of the LCD. The acquired image is a digital image containing three color channels: red, green, and blue. Each color channel has 256 grayscale levels. The acquired color image is then converted to grayscale using a weighted average method. The grayscale values ​​of the three color channels are weighted and summed according to human visual sensitivity to obtain a single-channel grayscale image. The weighting coefficients are 0.299 for the red channel, 0.587 for the green channel, and 0.114 for the blue channel. The grayscale image retains the brightness distribution characteristics of the LCD surface while reducing the computational load of subsequent data processing.

[0060] Two-dimensional wavelet packet decomposition is performed on the grayscale image to convert the spatial domain grayscale image into wavelet packet coefficient signals in the frequency domain. Wavelet packet decomposition, through a recursive approach, decomposes the image signal into multiple independent frequency band nodes. Each frequency band node corresponds to a different frequency range and spatial direction. Compared to traditional wavelet decomposition, wavelet packet decomposition can further subdivide high-frequency subbands, achieving full-band coverage of the image signal and avoiding the loss of high-frequency detail features. The recursive process of wavelet packet decomposition is implemented using the following formula:

[0061]

[0062] Where j is the current layer number of the wavelet packet decomposition, n is the frequency band node number of the current layer, and k is the index of the discrete sampling point. These are the coefficients of the low-pass decomposition filter. These are the coefficients of the high-pass decomposition filter. For the wavelet packet coefficients of the nth frequency band node in the jth layer, For the low-frequency subband coefficients of the next layer, These are the high-frequency subband coefficients for the next layer. After completing the wavelet packet decomposition of the preset number of layers using the above recursive formula, a frequency domain coefficient matrix containing multiple frequency band nodes is obtained. Among them, the coefficients of the lowest frequency band node corresponding to the decomposition layer are extracted as a low-frequency coefficient matrix, corresponding to the non-uniform illumination background component of the LCD screen surface. The coefficients of the remaining frequency band nodes are extracted as a mid-to-high frequency coefficient matrix, corresponding to the detail texture and defect components of the LCD screen surface.

[0063] In this embodiment, the wavelet packet decomposition layer is set to 3 layers, and a total of 8 independent frequency band nodes are generated after decomposition. The frequency range, component type and physical meaning of each frequency band node are shown in Table 1.

[0064] Table 1. Correspondence between wavelet packet decomposition frequency band nodes and component attributes

[0065] 3 0 0 1 / 8 Low frequency components Corresponding to a large area of ​​non-uniform illumination background distribution on the LCD screen surface, there are no obvious detailed texture features. 3 1 1 / 8 2 / 8 Mid-to-high frequency components Corresponding to the low-frequency detail textures on the surface of the LCD screen, including the basic structural features of the pixel array. 3 2 2 / 8 3 / 8 Mid-to-high frequency components Corresponding to the mid-frequency detail texture of the LCD screen surface, including the edge structure features of the display area. 3 3 3 / 8 4 / 8 Mid-to-high frequency components Corresponding to the mid-frequency detail texture of the LCD screen surface, including the edge transition features of minute defects. 3 4 4 / 8 5 / 8 Mid-to-high frequency components Corresponding to the mid-to-high frequency detail textures on the surface of the LCD screen, including the core grayscale abrupt change features in defect areas. 3 5 5 / 8 6 / 8 Mid-to-high frequency components Corresponding to the high-frequency detail textures on the surface of the LCD screen, including the fine structural features of the pixel electrodes. 3 6 6 / 8 7 / 8 Mid-to-high frequency components Corresponding to the high-frequency detailed texture of the LCD screen surface, including random noise signals introduced during the acquisition process. 3 7 7 / 8 8 / 8 Mid-to-high frequency components The highest frequency detail texture corresponding to the surface of the LCD screen, including salt-and-pepper noise signals introduced during the acquisition process.

[0066] Among them, the frequency band range corresponding to node 0 is 0. The 1 / 8 normalized frequency is a low-frequency component. This component only contains a large area of ​​non-uniform illumination background distribution on the LCD screen surface and does not contain defect-related detailed texture features. Therefore, the wavelet packet coefficients of this node are extracted as a low-frequency coefficient matrix. The frequency bands corresponding to the remaining nodes 1 to 7 cover 1 / 8 of the normalized frequency. The 8 / 8 normalized frequency belongs to the mid-to-high frequency component, which contains the detailed texture, defect features and noise signals of the LCD screen surface. Therefore, the wavelet packet coefficients of these nodes are extracted into a mid-to-high frequency coefficient matrix. By dividing the frequency band, the illumination background component and the defect detail component are completely separated, avoiding the destruction of defect features in the subsequent background fitting process.

[0067] The extracted low-frequency coefficient matrix is ​​convolved using a pre-defined adaptive morphological filter kernel to generate a uniform illumination reference matrix characterizing the non-uniform illumination distribution on the LCD screen surface. The size and orientation of the adaptive morphological filter kernel are adapted to the local gradient distribution characteristics in the low-frequency coefficient matrix, enabling smoothing of local gray-level jumps while preserving the overall illumination gradient trend and eliminating local defect interference signals mixed in with the low-frequency components. The morphological convolution operation employs an opening operation, which is implemented using the following formula:

[0068]

[0069] Where I is the input low-frequency coefficient matrix, and S is the adaptive morphological filter kernel. For the erosion operator, This is the expansion operator. The result is a uniform illumination reference matrix after opening operations. The erosion operation involves sliding the filter kernel pixel by pixel on the low-frequency coefficient matrix, using the minimum coefficient within the filter kernel's coverage area as the output value of the center pixel to eliminate local bright or dark spots smaller than the filter kernel in the low-frequency coefficient matrix. The dilation operation involves sliding the filter kernel pixel by pixel on the eroded matrix, using the maximum coefficient within the filter kernel's coverage area as the output value of the center pixel to restore the overall distribution of the illumination gradient. The resulting uniform illumination reference matrix retains only the non-uniform illumination distribution characteristics of the LCD screen surface, eliminating local defect texture interference.

[0070] The extracted mid-to-high frequency coefficient matrix and the fitted uniform illumination reference matrix are subjected to inverse wavelet packet transform to generate a reconstructed difference image with the illumination background removed. Inverse wavelet packet transform is the inverse process of wavelet packet decomposition. A reconstruction filter restores the wavelet packet coefficients in the frequency domain to the image signal in the spatial domain. The recursive process of inverse wavelet packet transform is implemented using the following formula:

[0071]

[0072] The physical meaning of each parameter is consistent with the corresponding parameter in the aforementioned wavelet packet decomposition formula. and The coefficients of the low-pass and high-pass reconstruction filters are respectively obtained by conjugating and flipping the coefficients of the decomposed filters. In the inverse transform process, the uniform illumination reference matrix is ​​used as the coefficient of the lowest frequency band node of the wavelet packet decomposition. After combining it with the mid-to-high frequency coefficient matrix in the frequency domain, the inverse wavelet packet transform is performed to restore the frequency domain signal to the reconstructed difference image in the spatial domain. In this image, a large area of ​​non-uniform illumination background components have been removed, and only mid-to-high frequency details and defect components are retained, thus achieving effective separation of illumination background and defect features.

[0073] In the generated reconstructed difference image, the contrast features of the local pixel gradient direction vector and the gray-level co-occurrence matrix are calculated. The calculation process of the local pixel gradient direction vector is as follows: A local sliding window of a preset size is constructed with each pixel in the reconstructed difference image as the center; the covariance matrix of the pixel gray-level values ​​within the window is calculated; eigenvalue decomposition is performed on the covariance matrix; and the eigenvector corresponding to the largest eigenvalue is extracted as the local pixel gradient direction vector at that pixel location. The eigenvalue decomposition process is implemented using the following formula:

[0074]

[0075] Where C is the covariance matrix of pixel grayscale values ​​within the local sliding window. These are the eigenvalues ​​of the covariance matrix. For the corresponding feature vector, the feature vector corresponding to the largest feature value is taken as the local pixel gradient direction vector at that pixel position. This vector represents the main direction of gray-level change in the local area and can reflect the direction characteristics of the defect edge.

[0076] The calculation process of the contrast feature of the gray-level co-occurrence matrix is ​​as follows: In the reconstructed difference image, a neighborhood window of a preset size is constructed with the pixel to be tested as the center. The gray-level joint distribution probability of pixel pairs with a preset spatial offset relationship within the neighborhood window is statistically analyzed to generate the gray-level co-occurrence matrix. The contrast value is calculated based on the gray-level co-occurrence matrix. The contrast calculation process is implemented through the following formula:

[0077]

[0078] Where L represents the number of gray levels in the reconstructed difference image, and in this embodiment, the number of gray levels is set to 256. i and j are the gray values ​​of the two pixels in the pixel pair, respectively. CON is the joint probability distribution of pixels with gray value i and gray value j within a preset neighborhood window and under a preset spatial offset relationship. CON is the contrast value of the gray-level co-occurrence matrix, which represents the degree of gray-level abrupt change in local texture in the image. The higher the value, the greater the gray-level difference in the local area and the higher the probability of defects.

[0079] The calculated gradient direction vector is concatenated with the contrast feature to generate a fixed-dimensional feature vector. This vector is then input into a pre-built isolated forest classifier, which outputs the location coordinates and defect category of the Mura defect. The isolated forest classifier scores the input feature vector using multiple isolated trees. When the anomaly score exceeds a preset threshold, the pixel region corresponding to that feature vector is determined to be a Mura defect region. Based on connected component analysis of the defect region, the minimum bounding rectangle coordinates of the defect are output. Simultaneously, based on the feature distribution characteristics of the defect region, the corresponding defect category is output. The anomaly score calculation process is implemented using the following formula:

[0080]

[0081] Where x is the input feature vector, containing the gradient direction vector and contrast features, and n is the size of the sample set used to train the isolated forest. Let x be the path length of sample x in the isolated tree. Let x be the mean path length of sample x across all isolated trees. The average path length of a binary search tree constructed for a sample set of size n. An anomaly score is assigned to sample x, with a value range of [0,1]. When the anomaly score exceeds a preset threshold, the pixel region corresponding to the sample is determined to be a Mura defect region. In this embodiment, the isolated forest classifier contains 100 isolated trees, with a maximum depth of 15 for each tree. The training sample set includes feature samples of normal LCD screen surface images and feature samples of various Mura defects. After training, the defect and normal regions are classified using a preset anomaly score threshold. Simultaneously, based on the feature distribution of the defect region, the defect category is output, including dark spot Mura, bright spot Mura, and stripe Mura.

[0082] This embodiment separates the illumination background component from the defect detail component through wavelet packet decomposition in the frequency domain, avoiding the destruction of defect features by spatial domain filtering. It fits a uniform illumination reference matrix through adaptive morphological filtering and generates a reconstructed difference image that eliminates illumination interference by combining inverse wavelet packet transform. Based on gradient direction vector and contrast features, it realizes the detection and classification of Mura defects, fully realizing the entire process of LCD screen defect detection and ensuring the complete preservation of minute defect features.

[0083] In a preferred embodiment, reference Figure 2 The wavelet packet decomposition process of the LCD screen surface image is adaptively optimized. First, the acquired LCD screen surface image is converted to grayscale, and the grayscale processing method is consistent with the previous embodiment. After obtaining a single-channel grayscale image, the texture energy entropy of the current grayscale image is calculated. The texture energy entropy is used to characterize the richness of texture details in the image. The richer the texture details, the higher the value of the texture energy entropy. Its calculation process is implemented through the following formula:

[0084]

[0085] Where B is the total number of frequency band nodes in the wavelet packet decomposition. Let E be the proportion of the wavelet packet coefficient energy of the b-th frequency band node to the total energy, and E be the texture energy entropy of the grayscale image. To calculate the texture energy entropy, the grayscale image is first decomposed using wavelet packet decomposition with a preset base number of layers to obtain the wavelet packet coefficients of each frequency band node. The energy of the coefficients for each frequency band node is then calculated, which is the sum of the squares of the absolute values ​​of the coefficients. Finally, the proportion of the energy of each frequency band node to the total energy is calculated, and the value of the texture energy entropy is obtained using the formula described above.

[0086] The calculated texture energy entropy is compared with a preset energy threshold. When the texture energy entropy is greater than the preset energy threshold, the wavelet packet decomposition layer is determined to be three layers; when the texture energy entropy is less than or equal to the preset energy threshold, the wavelet packet decomposition layer is determined to be four layers. A texture energy entropy greater than the preset energy threshold indicates rich texture details in the image. Using three layers avoids the dispersion of defect features caused by over-decomposition and reduces computational load. A texture energy entropy less than or equal to the preset energy threshold indicates sparse texture details in the image. Using four layers enables finer frequency band division and improves the separation accuracy between low-frequency background components and high-frequency defect components. A bioorthogonal wavelet basis function is used to perform wavelet packet decomposition on the grayscale image according to the determined wavelet packet decomposition layer. The bioorthogonal wavelet basis has linear phase characteristics, which can avoid phase distortion during image decomposition and reconstruction, ensuring the complete preservation of defect edge features. In this embodiment, a bioorthogonal 9 / 7 wavelet basis function is used, which has good adaptability in the fields of image compression and feature extraction. After decomposition, coefficients are extracted from the lowest frequency band node corresponding to the wavelet packet decomposition level as the low-frequency coefficient matrix, and coefficients are extracted from the remaining frequency band nodes as the mid-to-high frequency coefficient matrix.

[0087] Before comparing the texture energy entropy with a preset energy threshold, the preset energy threshold is dynamically optimized. The optimization process involves acquiring multiple historical surface images of the batch to which the current LCD screen to be inspected belongs. These historical surface images are normal LCD screen surface images from that batch that have been inspected and confirmed to be defect-free. The historical texture energy entropy of each historical surface image is calculated to obtain a sample set of historical texture energy entropies. Gaussian kernel density estimation is then performed on the multiple historical texture energy entropies in the sample set to generate the energy entropy probability density distribution curve of the batch to which the current LCD screen to be inspected belongs. The calculation process for Gaussian kernel density estimation is implemented using the following formula:

[0088]

[0089] Where N is the number of historical surface images. Let be the historical texture energy entropy of the i-th historical surface image, and h be the bandwidth parameter of the Gaussian kernel. In this embodiment, the bandwidth parameter is adaptively determined using the Silverman criterion. Let be the Gaussian kernel function, and its expression is: , Let e ​​be the probability density value corresponding to the texture energy entropy. This formula is used to generate a continuous energy entropy probability density distribution curve.

[0090] The texture energy entropy value corresponding to the peak of the energy entropy probability density distribution curve is extracted as a benchmark reference value. The benchmark reference value is shifted towards higher entropy by a preset offset to generate a dynamic energy threshold. The preset offset is set according to the texture distribution characteristics of the LCD screens in the batch. In this embodiment, the preset offset is set to 0.8. A sliding window of a preset size moves pixel by pixel on the current grayscale image. The local texture energy entropy is calculated at each sliding window position. The calculation method of the local texture energy entropy is consistent with the calculation method of the global texture energy entropy. The generated dynamic energy threshold is used to evaluate the local texture energy entropy at each sliding window position. When the local texture energy entropy is greater than the dynamic energy threshold, the wavelet packet decomposition level of the local region corresponding to the sliding window position is determined to be three levels. When the local texture energy entropy is less than or equal to the dynamic energy threshold, the wavelet packet decomposition level of the local region corresponding to the sliding window position is determined to be four levels. This realizes adaptive adjustment of the decomposition level based on the local texture distribution characteristics.

[0091] In this embodiment, the dynamic energy threshold generated based on the historical data of the batch is 5.2, and the wavelet packet decomposition layer parameters corresponding to different texture energy entropy intervals are shown in Table 2.

[0092] Table 2. Corresponding parameters for texture energy entropy range and wavelet packet decomposition level.

[0093] >5.2 3 8 0 1 / 8 1 / 8 8 / 8 Areas rich in texture detail, such as display edges and densely pixelated areas. ≤5.2 4 16 0 1 / 16 1 / 16 16 / 16 Areas with sparse texture details, such as the flat center area of ​​a full-screen pure white display.

[0094] Based on this parameter correspondence, when the global texture energy entropy is greater than 5.2, the entire image is decomposed using three-layer wavelet packet decomposition; when the global texture energy entropy is less than or equal to 5.2, the entire image is decomposed using four-layer wavelet packet decomposition. At the same time, for the texture energy entropy within the local sliding window, the same dynamic threshold is used to adjust the number of local decomposition layers to ensure that the number of decomposition layers in texture-rich areas meets the detail preservation requirements, and the number of decomposition layers in texture-flat areas meets the background fitting requirements.

[0095] This embodiment achieves adaptive determination of the wavelet packet decomposition level through texture energy entropy, generates a dynamic energy threshold based on Gaussian kernel density estimation of historical data from the same batch, and supports local decomposition level adjustment of local sliding window, so that the frequency band division of wavelet packet decomposition can adapt to the texture distribution characteristics of different LCD screen images. While preserving defect details, it improves the separation accuracy of illumination and background components, and avoids the problems of detail loss or insufficient background fitting caused by a fixed decomposition level.

[0096] In a preferred embodiment, reference Figure 3The convolution process of the low-frequency coefficient matrix is ​​optimized by first extracting the local gradient tensor field of the low-frequency coefficient matrix and then calculating the eigenvalues ​​and eigenvectors of each pixel position in the local gradient tensor field. The local gradient tensor field is used to characterize the gradient distribution characteristics of each pixel position in the low-frequency coefficient matrix, reflecting the direction and amplitude of illumination gradient in the local region. The construction process of the gradient tensor matrix is ​​achieved through the following formula:

[0097]

[0098] in, These represent the coordinates of pixels in the low-frequency coefficient matrix. The gradient value at that pixel location in the x-direction is obtained by convolving the low-frequency coefficient matrix with the Sobel operator in the horizontal direction. The gradient value at this pixel location in the y-direction is obtained by convolving the low-frequency coefficient matrix with the Sobel operator in the vertical direction. Let be the gradient tensor matrix at this pixel location. Perform eigenvalue decomposition on the gradient tensor matrix at each pixel location to obtain two non-negative eigenvalues. and and the corresponding unit eigenvector and ,in , The eigenvector corresponding to the largest eigenvalue represents the principal gradient direction at that pixel location, i.e., the principal direction of the illumination gradient.

[0099] The elliptic eccentricity at each pixel location is calculated based on the eigenvalues ​​obtained from the decomposition. The elliptic eccentricity is used to characterize the degree of anisotropy of the gradient tensor field, and its calculation process is implemented through the following formula:

[0100]

[0101] Where e is the eccentricity of the ellipse, and its value ranges from [0,1). When e=0, The gradient tensor field is isotropic, corresponding to a local region with no obvious gradient direction and uniform illumination distribution; when e approaches 1, much smaller The gradient tensor field is strongly anisotropic, corresponding to a significant unidirectional gradient change in the local region, i.e., a significant unidirectional illumination gradient.

[0102] Based on the calculated elliptic eccentricity and principal gradient direction, a non-uniform structural element is constructed, whose size dynamically scales with the elliptic eccentricity and whose major axis is aligned with the principal gradient direction. This non-uniform structural element is then used as an adaptive morphological filter kernel. The construction process of the non-uniform structural element involves first setting the basic major axis radius and basic minor axis radius. In this embodiment, the basic major axis radius is set to 5 pixels, and the basic minor axis radius is set to 3 pixels. A circular set of discrete coordinate points centered at the origin is generated. The Euclidean distance from each discrete coordinate point in the set to the center coordinate point is calculated. A distance decay function based on a Gaussian distribution is constructed, and weight coefficients are assigned to each discrete coordinate point using this distance decay function. The expression for the distance decay function is:

[0103]

[0104] Where d is the Euclidean distance from the discrete coordinate point to the center coordinate point of the structuring element. The standard deviation is the Gaussian distribution, as shown in this embodiment. The value of is equal to the radius of the major axis of the foundation. The weight coefficients corresponding to the discrete coordinate points are non-linearly decreasing with the increase of Euclidean distance, so that the center weight of the structuring element is the highest and the edge weights are smoothly transitioned, avoiding blocky artifacts after convolution processing.

[0105] The discrete coordinate points, after being assigned weights, are subjected to an affine transformation based on the elliptic eccentricity and the principal gradient direction to generate non-uniform structuring elements with smooth edge weight transitions. The affine transformation process is implemented using the following formula:

[0106]

[0107] in, These are the original discrete coordinate points of the structuring element. Let these be the coordinates of the points after the affine transformation. Let be a rotation matrix, and its expression is: Rotation angle The angle of the principal gradient direction, derived from the eigenvectors. The direction is calculated to align the major axis of the structuring element with the principal gradient direction. 'a' is the major axis scaling factor, which is positively correlated with the ellipse eccentricity. In this embodiment... 'b' is the minor axis scaling factor, which is negatively correlated with the ellipse eccentricity. In this embodiment... Through this affine transformation, non-uniform structural elements are generated whose size is dynamically adjusted with the eccentricity of the ellipse and whose direction is aligned with the principal gradient direction.

[0108] In this embodiment, the non-uniform structural element parameters corresponding to different elliptic eccentricity ranges are shown in Table 3.

[0109] Table 3 Correspondence between Elliptic Eccentricity and Non-uniform Structural Element Parameters

[0110] 0 0.3 1 1.6 1 0.76 No forced rotation, retains default orientation. Isotropic illumination distribution, flat area with no obvious gradual change in direction 0.3 0.7 1.6 2.4 0.76 0.44 The major axis is aligned with the principal gradient direction, and the rotation angle error does not exceed 5°. The weakly anisotropic illumination distribution exhibits regions of gentle unidirectional gradient. 0.7 0.99 2.4 2.98 0.44 0.208 The major axis is strictly aligned with the principal gradient direction, and the rotation angle error does not exceed 1°. Strongly anisotropic illumination distribution with distinct unidirectional gradient edge regions.

[0111] Based on this parameter correspondence, when the ellipse eccentricity is 0.8, the major axis scaling factor is 2.6, the minor axis scaling factor is 0.36, and the rotation angle is strictly consistent with the principal gradient direction. This allows the structuring element to adapt to the direction and amplitude of the illumination gradient, smoothing local jumps while fully preserving the overall trend of the illumination gradient. The constructed adaptive morphological filter kernel is used to perform an opening operation convolution on the low-frequency coefficient matrix, smoothing local gray-level jumps in the low-frequency coefficient matrix and generating a uniform illumination reference matrix.

[0112] This embodiment constructs an adaptive morphological filter kernel based on the local gradient tensor field of the low-frequency coefficient matrix. The size ratio of the structuring element is dynamically adjusted by the elliptic eccentricity, and the major axis of the structuring element is aligned by the principal gradient direction. Combined with the Gaussian distance decay function, the weight of the structuring element is smoothly transitioned, enabling the filtering process to accurately adapt to the gradual characteristics of non-uniform illumination. This effectively eliminates local defect interference in the low-frequency coefficient matrix, improves the fitting accuracy of the uniform illumination reference matrix, and avoids the background fitting distortion problem caused by fixed structuring elements.

[0113] In a preferred embodiment, reference Figures 4 to 6 To optimize the generation process of reconstructed difference images and the extraction process of defect features, the local pixel variance of each high-frequency sub-band in the mid-to-high frequency coefficient matrix is ​​first calculated. A spatial adaptive weight matrix is ​​then constructed based on the local pixel variance, and this matrix is ​​used to perform weighted correction on the mid-to-high frequency coefficient matrix. Each element of the spatial adaptive weight matrix corresponds to a pixel position in the high-frequency sub-band, and its value is determined by the local pixel variance and noise variance at that position. The calculation process is implemented using the following formula:

[0114]

[0115] in, These represent the coordinates of the pixels in the high-frequency subband. The local pixel variance at that pixel location is calculated using coefficient values ​​within a sliding window of a preset size centered on that pixel. The noise variance in the high-frequency sub-band is obtained by estimating the variance of the flat regions within the sub-band. In this embodiment, the median absolute deviation method is used for noise variance estimation. The local pixel variance is an adaptive weighting coefficient. When the local pixel variance is large, it indicates that there are significant details or defects at that location, and the weighting coefficient approaches 1 to fully preserve the coefficient value at that location. When the local pixel variance is small, it indicates that the location is dominated by noise signals, and the weighting coefficient approaches 0 to suppress noise interference at that location.

[0116] The weighted and corrected mid-to-high frequency coefficient matrix is ​​recombinated with the uniform illumination reference matrix in the frequency domain. The recombination process involves using the uniform illumination reference matrix as the coefficients of the lowest frequency band node in wavelet packet decomposition, and then sequentially filling the corresponding frequency band positions with the weighted and corrected mid-to-high frequency coefficient matrix according to the order of the frequency band nodes, resulting in a complete fused frequency domain coefficient matrix. A soft thresholding function based on Bayesian estimation is applied to the high-frequency portion of the fused frequency domain coefficient matrix for denoising. The expression for the soft thresholding function is:

[0117]

[0118] Where d represents the high-frequency coefficient values ​​in the fused frequency domain coefficient matrix. These are the coefficient values ​​after thresholding. The sign function is T, which is an adaptive threshold obtained based on Bayesian estimation. The value of the threshold T is positively correlated with the noise variance of the high-frequency subband and negatively correlated with the signal variance. It is optimized by the Bayesian minimum mean square error criterion. The soft threshold function can suppress noise while avoiding edge ringing artifacts caused by hard thresholding, thus improving the quality of the reconstructed image.

[0119] An inverse wavelet packet transform is performed on the denoised fused frequency domain coefficient matrix to restore the frequency domain signal to the spatial domain signal, resulting in a reconstructed difference image. The execution process of the inverse wavelet packet transform is consistent with the aforementioned embodiment. In the generated reconstructed difference image, local pixel gradient direction vectors are calculated. First, a Gabor filter bank containing multiple different spatial frequencies and directions is constructed. Gabor filters have good spatial locality and direction selectivity, enabling accurate extraction of texture features in specific directions and frequencies, effectively suppressing regular texture interference from the LCD pixel array. The kernel function of the two-dimensional Gabor filter is implemented using the following formula:

[0120]

[0121] in, , f is the center spatial frequency of the Gabor filter. The direction angle of the filter. and The Gaussian envelopes are respectively in and The standard deviation of the direction determines the passband width of the filter. This is the kernel function of a two-dimensional Gabor filter.

[0122] The construction process of the Gabor filter bank is as follows: A two-dimensional Fourier transform is performed on the reconstructed difference image to obtain the corresponding spectrogram. In the spectrogram, the coordinates of multiple frequency domain extrema points whose amplitudes exceed a preset spectral threshold are extracted. The preset spectral threshold is set to 10% of the global maximum amplitude of the spectrogram. Based on the extracted coordinates of these frequency domain extrema points, the corresponding spatial frequency set and directional angle set are calculated. The spatial frequency is calculated from the distance from the frequency domain extrema point to the center of the spectrogram, and the directional angle is calculated from the azimuth angle of the frequency domain extrema point relative to the center of the spectrogram. Each spatial frequency in the spatial frequency set is used as the center frequency of the Gabor filter, and each directional angle in the directional angle set is used as the directional parameter of the Gabor filter. Combined with the gray-level variance ratio of local regions in the reconstructed difference image, a bandpass width parameter is dynamically generated. The bandpass width parameter is positively correlated with the local gray-level variance. Finally, the Gabor filter bank is constructed based on the center frequency, directional parameter, and bandpass width parameter.

[0123] In this embodiment, eight Gabor filters were generated based on the spectral extreme points of the reconstructed difference image. These filters are divided into four directions and two spatial frequencies. The parameter configurations of each filter are shown in Table 4.

[0124] Table 4. Parameter Configuration Table for Dynamically Generated Gabor Filter Bank

[0125] 1 0.05 0 8.0 16.0 0.12 2 0.05 45 8.0 16.0 0.12 3 0.05 90 8.0 16.0 0.12 4 0.05 135 8.0 16.0 0.12 5 0.1 0 4.0 8.0 0.24 6 0.1 45 4.0 8.0 0.24 7 0.1 90 4.0 8.0 0.24 8 0.1 135 4.0 8.0 0.24

[0126] This filter bank can accurately match the frequency and directional characteristics of defect features, effectively suppressing the regular texture interference of LCD pixel arrays. The reconstructed difference image is input into each Gabor filter in the Gabor filter bank to obtain the Gabor filter response amplitude in each direction. The filter response amplitude is the modulus of the complex output of the filter. The phase consistency value of the reconstructed difference image at each pixel position is calculated. The phase consistency value characterizes the saliency of edge features in the image, is unaffected by changes in illumination, and can further improve the robustness of the gradient direction vector. The Gabor filter response amplitudes in each direction are multiplied and fused pixel by pixel to obtain a fused response map. The fused response map retains the texture features of specific directions and frequencies, and enhances the saliency of edge features through phase consistency, suppressing interference caused by illumination fluctuations.

[0127] In the fused response map, a local sliding window of a preset size is constructed with each pixel as the center. In this embodiment, the sliding window size is set to 9×9 pixels. Principal component analysis is performed on the fused response value of the pixel within the local sliding window, and the principal component analysis feature vector is extracted. The feature vector corresponding to the largest principal component is used as the local pixel gradient direction vector at that pixel position. This vector can accurately characterize the direction feature of the defect edge, while effectively suppressing the directional interference caused by regular pixel texture.

[0128] In reconstructing the difference image, the contrast features of the gray-level co-occurrence matrix are calculated. First, a ring-shaped neighborhood is constructed centered on the pixel to be tested. The inner radius of the ring-shaped neighborhood is set to 3 pixels, and the outer radius is set to 7 pixels. Only pixels within the ring-shaped area are included in the calculation, excluding pixel interference from the central and outer regions. The probability distribution of pixel pairs within the ring-shaped neighborhood that meet the preset gray-level difference conditions is statistically analyzed to generate the ring-shaped gray-level co-occurrence matrix. The generation process of the ring-shaped gray-level co-occurrence matrix does not depend on a fixed horizontal or vertical offset direction, but covers all possible pixel pair combinations within the ring-shaped neighborhood. This avoids the omission of texture features caused by a fixed direction and improves the omnidirectional adaptability of the contrast features.

[0129] In the process of statistically analyzing the probability distribution of pixel pairs, the standard pixel array periodicity parameter of the current LCD screen is first obtained. This parameter is determined by the physical pixel spacing of the LCD screen and characterizes the periodic arrangement characteristics of the pixel array. Based on the standard pixel array periodicity parameter, the spatial phase offset of each pixel point in the annular neighborhood relative to the pixel under test is calculated. The spatial phase offset is the remainder of the pixel point's coordinate position relative to the pixel array period, characterizing the phase position of the pixel point within the pixel array period. Based on the spatial phase offset, a periodic compensation lookup table is constructed. The periodic compensation lookup table records the reference grayscale offset values ​​corresponding to different spatial phase offsets. These values ​​are obtained through statistical analysis of the pixel array grayscale distribution of normal LCD screens in the same batch, and can reflect the inherent grayscale fluctuations caused by the periodic arrangement of the pixel array.

[0130] Within the annular neighborhood, the absolute grayscale difference between any two pixels is subtracted from the corresponding baseline grayscale offset value in the periodic compensation lookup table to obtain the compensated grayscale difference. This compensated grayscale difference eliminates the inherent grayscale fluctuation interference caused by the periodic arrangement of the pixel array. Pixel pairs whose compensated grayscale differences fall within a preset dynamic fluctuation range are marked as meeting the preset grayscale difference conditions. The preset dynamic fluctuation range is adaptively adjusted according to the display brightness level of the LCD screen. The proportion of the number of pixel pairs meeting the conditions to the total number of all possible pixel pairs within the annular neighborhood is counted to obtain the pixel pair distribution probability. An annular grayscale co-occurrence matrix is ​​then generated based on this distribution probability.

[0131] The generated annular gray-level co-occurrence matrix is ​​subjected to a diagonal element weighting operation. The weighting coefficient is positively correlated with the absolute value of the gray-level difference between pixels. The contrast value of the annular gray-level co-occurrence matrix is ​​calculated. The contrast value is then subjected to logarithmic transformation and normalization to obtain a contrast feature with linear distribution characteristics. The logarithmic transformation can compress the dynamic range of the contrast value, and the normalization process limits the value range of the contrast feature to between 0 and 1. This contrast feature characterizes the clarity and abruptness of the texture around the pixel being tested. The higher the value, the higher the probability of defects in the local area.

[0132] The calculated gradient direction vector is concatenated with the contrast feature to generate a feature vector with fixed dimensions. This vector is then input into a pre-built isolated forest classifier, which outputs the location coordinates and defect category of the Mura defect. The execution process of the isolated forest classifier is consistent with the aforementioned embodiment.

[0133] This embodiment improves the quality of reconstructed difference images by performing weighted correction and denoising on the mid-to-high frequency coefficient matrix through a spatial adaptive weight matrix and a Bayesian soft thresholding function. The Gabor filter bank dynamically generated based on the spectral extreme points and the gradient direction vector fused with phase consistency effectively suppresses the interference of regular pixel textures. The contrast features extracted by the annular gray-level co-occurrence matrix and the periodic compensation lookup table eliminate the phase interference caused by the pixel array period, further improving the accuracy and robustness of defect feature extraction and reducing the false detection rate under different display brightness levels and local brightness fluctuations of the backlight module.

Claims

1. A method for detecting defects in a liquid crystal panel based on image analysis, characterized by, include: Acquire an image of the surface of the liquid crystal screen, convert the image of the surface of the liquid crystal screen into a frequency domain signal and perform wavelet packet decomposition to extract a frequency domain coefficient matrix containing low-frequency background components and mid-to-high-frequency detail components. The low-frequency coefficient matrix in the frequency domain coefficient matrix is ​​convolved using a preset adaptive morphological filter kernel to fit and generate a uniform illumination reference matrix that characterizes the non-uniform illumination distribution on the surface of the liquid crystal screen. The mid-to-high frequency coefficient matrix in the frequency domain coefficient matrix is ​​subjected to inverse wavelet packet transform with the uniform illumination reference matrix to generate a reconstructed difference image with the illumination background removed. In the reconstructed difference image, the contrast features of the local pixel gradient direction vector and the gray-level co-occurrence matrix are calculated; The gradient direction vector and the contrast feature are input into a pre-built isolated forest classifier, which outputs the location coordinates and defect category of the Mura defect.

2. The image analysis-based liquid crystal display defect detection method according to claim 1, characterized in that, Converting the surface image of the liquid crystal screen into a frequency domain signal and performing wavelet packet decomposition includes: performing grayscale processing on the surface image of the liquid crystal screen and calculating the texture energy entropy of the current grayscale image; The texture energy entropy is compared with a preset energy threshold. When the texture energy entropy is greater than the preset energy threshold, the wavelet packet decomposition layer is determined to be three layers. When the texture energy entropy is less than or equal to the preset energy threshold, the wavelet packet decomposition layer is determined to be four layers. Using bioorthogonal wavelet basis functions, wavelet packet decomposition is performed on the grayscale image according to a determined number of wavelet packet decomposition levels to obtain the frequency domain coefficient matrix. The frequency domain coefficient matrix is ​​extracted as the low-frequency coefficient matrix at the lowest frequency band node corresponding to the wavelet packet decomposition level, and as the mid-to-high frequency coefficient matrix at the remaining frequency band nodes.

3. The image analysis-based liquid crystal display defect detection method according to claim 1, characterized in that, The low-frequency coefficient matrix is ​​convolved using a preset adaptive morphological filter kernel, including: extracting the local gradient tensor field of the low-frequency coefficient matrix, and calculating the feature values ​​and feature vectors of each pixel position in the local gradient tensor field. The elliptic eccentricity of each pixel position is calculated based on the eigenvalues, and the principal gradient direction of each pixel position is determined based on the eigenvectors. Based on the ellipse eccentricity and the principal gradient direction, a non-uniform structural element is constructed with its size dynamically scaling with the ellipse eccentricity and its major axis aligned with the principal gradient direction. This non-uniform structural element is then used as the adaptive morphological filter kernel. The adaptive morphological filter kernel is used to perform an opening operation convolution on the low-frequency coefficient matrix to smooth local gray-level jumps in the low-frequency coefficient matrix and generate the uniform illumination reference matrix.

4. The image analysis-based liquid crystal display defect detection method according to claim 1, characterized in that, Performing an inverse wavelet packet transform on the mid-to-high frequency coefficient matrix and the uniform illumination reference matrix to generate a reconstructed difference image with the illumination background removed includes: calculating the local pixel variance of each high-frequency sub-band in the mid-to-high frequency coefficient matrix, and constructing a spatial adaptive weight matrix based on the local pixel variance. The mid-to-high frequency coefficient matrix is ​​weighted and corrected using the spatial adaptive weight matrix. The weighted and corrected mid-to-high frequency coefficient matrix is ​​recombined with the uniform illumination reference matrix in the frequency domain to obtain the fused frequency domain coefficient matrix. A soft thresholding function based on Bayesian estimation is applied to the high-frequency part of the fused frequency domain coefficient matrix for denoising. An inverse wavelet packet transform is performed on the denoised fused frequency domain coefficient matrix to restore the frequency domain signal to the spatial domain signal, thus obtaining the reconstructed difference image.

5. The image analysis-based liquid crystal display defect detection method according to claim 1, characterized in that, In the reconstructed difference image, the local pixel gradient direction vector is calculated, including: constructing a Gabor filter bank containing multiple different spatial frequencies and different directions; The reconstructed difference image is input to each Gabor filter in the Gabor filter bank to obtain the Gabor filter response amplitude in each direction; Calculate the phase consistency value of the reconstructed difference image at each pixel location; The Gabor filter response amplitudes in each direction are multiplied and fused with the phase consistency values ​​pixel by pixel to obtain the fused response map; In the fused response map, a local sliding window is constructed with the pixel as the center. Principal component analysis feature vectors are extracted within the local sliding window, and the principal component analysis feature vectors are used as the local pixel gradient direction vectors.

6. The image analysis-based liquid crystal display defect detection method according to claim 1, characterized in that, In the reconstructed difference image, the contrast features of the gray-level co-occurrence matrix are calculated, including: in the reconstructed difference image, a ring-shaped neighborhood is constructed with the pixel to be tested as the center; The probability distribution of pixel pairs that meet the preset gray-level difference condition within the annular neighborhood is statistically analyzed to generate an annular gray-level co-occurrence matrix, wherein the generation process of the annular gray-level co-occurrence matrix does not depend on a fixed horizontal or vertical offset direction. Perform a weighted operation on the diagonal elements of the annular gray-level co-occurrence matrix to calculate the contrast value of the annular gray-level co-occurrence matrix; The contrast values ​​are logarithmically transformed and normalized to obtain contrast features with linear distribution characteristics. These contrast features characterize the clarity and abrupt changes of the texture surrounding the pixel under test.

7. The image analysis-based liquid crystal display defect detection method according to claim 2, characterized in that, Before comparing the texture energy entropy with the preset energy threshold, the method further includes: acquiring multiple historical surface images of the batch to which the current LCD screen to be detected belongs, and calculating the historical texture energy entropy of each historical surface image; Gaussian kernel density estimation is performed on the energy entropy of multiple historical textures to generate the energy entropy probability density distribution curve of the batch to which the current LCD screen to be detected belongs. The peak value of the energy entropy probability density distribution curve is extracted as a benchmark reference value, and the benchmark reference value is shifted towards the high entropy direction by a preset offset to generate a dynamic energy threshold. A sliding window is used to move across the current grayscale image, and the local texture energy entropy is calculated at each sliding window position. The local texture energy entropy is then evaluated using the dynamic energy threshold.

8. The image analysis-based liquid crystal display defect detection method according to claim 3, characterized in that, Constructing a non-uniform structural element whose size dynamically scales with the eccentricity of the ellipse and whose major axis is aligned with the principal gradient direction includes: setting the basic major axis radius and basic minor axis radius of the non-uniform structural element; Calculate the Euclidean distance from each discrete coordinate point inside the non-uniform structural element to the center coordinate point; A distance decay function based on Gaussian distribution is constructed, and a weight coefficient is assigned to each discrete coordinate point using the distance decay function, so that the weight coefficient decreases non-linearly with the increase of the Euclidean distance. The discrete coordinate points, after being assigned weight coefficients, are subjected to an affine transformation according to the elliptic eccentricity and the principal gradient direction to generate non-uniform structural elements with smooth edge weight transitions.

9. The image analysis-based liquid crystal display defect detection method according to claim 5, characterized in that, Constructing a Gabor filter bank containing multiple different spatial frequencies and directions includes: performing a two-dimensional Fourier transform on the reconstructed difference image to obtain a spectrum; In the spectrum diagram, the coordinates of multiple frequency domain extrema points whose amplitudes exceed a preset spectrum threshold are extracted; Based on the coordinates of the multiple frequency domain extrema points, calculate the corresponding set of spatial frequencies and set of direction angles; Each spatial frequency in the set of spatial frequencies is used as the center frequency of the Gabor filter, and each directional angle in the set of directional angles is used as the directional parameter of the Gabor filter. Combining the gray-level variance ratio of the local region in the reconstructed difference image, a bandpass width parameter is dynamically generated. The Gabor filter bank is constructed based on the center frequency, the directional parameter, and the bandpass width parameter.

10. The image analysis-based liquid crystal display defect detection method according to claim 6, characterized in that, Statistical analysis of the distribution probability of pixel pairs that meet the preset grayscale difference condition within the annular neighborhood includes: obtaining the standard pixel array period parameters of the current LCD screen; Based on the standard pixel array period parameters, calculate the spatial phase offset of each pixel in the annular neighborhood relative to the pixel under test; Based on the spatial phase offset, a periodic compensation lookup table is constructed, wherein the periodic compensation lookup table records the reference grayscale offset values ​​corresponding to different spatial phase offsets. Within the annular neighborhood, the absolute grayscale difference between any two pixels is subtracted from the corresponding baseline grayscale offset value in the periodic compensation lookup table to obtain the compensated grayscale difference. Pixel pairs whose compensated grayscale difference is within a preset dynamic fluctuation range are marked as pixel pairs that meet the preset grayscale difference condition. The proportion of the number of pixel pairs that meet the condition to the total number of all possible pixel pairs is counted to obtain the pixel pair distribution probability.