Display screen dead pixel detection method based on morphological characteristics and geometric calculation
By employing adaptive image preprocessing and robust geometric feature extraction, combined with intelligent mesh reconstruction and fault-tolerant analysis, the problems of uneven illumination and geometric deformation in display screen inspection are solved, achieving high-precision defect detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- STORAGEX TECH INC
- Filing Date
- 2026-01-21
- Publication Date
- 2026-05-01
AI Technical Summary
Existing technologies in automated optical inspection of displays struggle to address localized contrast variations caused by uneven lighting, moiré patterns, or differences in screen brightness. Furthermore, they are prone to misjudging defective pixels in high-noise areas and missing real defective pixels in low-contrast areas. Additionally, geometric deformation and incomplete contours lead to pixel grid positioning errors.
An adaptive image preprocessing enhancement method based on morphological features and geometric calculation is adopted to extract robust geometric features and perform intelligent mesh reconstruction and fault tolerance analysis, including adaptive brightness and contrast calibration, local brightness compensation, multi-threshold binarization, contour filtering, geometric correction and fault tolerance analysis, to generate the display screen defect detection results.
It improves the signal-to-noise ratio under complex backgrounds, reduces the false alarm rate, achieves robustness and adaptability in real-world environments, and ensures accurate mapping of bad point coordinates and stable detection.
Smart Images

Figure CN121962101A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of machine vision inspection technology, specifically a method for detecting dead pixels on a display screen based on morphological features and geometric calculations. Background Technology
[0002] In automated optical inspection of displays, defect detection is a crucial step. Existing technologies typically employ image preprocessing combined with template matching or fixed threshold segmentation. Preprocessing often relies on global contrast stretching, Gaussian filtering, or uniform morphological operations to enhance the difference between bright spots and the background. In the localization and analysis stage, precise edge detection is often used to segment the screen area, assuming the screen is a regular rectangle in the image, and then dividing it into a grid for pixel-level analysis.
[0003] Existing technical solutions have shortcomings. Uniform preprocessing parameters are insufficient to handle local contrast variations in screen images caused by uneven lighting, moiré patterns, or differences in screen brightness. In high-noise areas, noise is easily misidentified as dead pixels, while in low-contrast areas, true, weak dead pixels may be missed. Mesh generation methods relying on perfect edge detection are very fragile. In real industrial environments, screen edges may be worn, reflective, or partially occluded, leading to incomplete contour extraction. Furthermore, perspective distortion caused by camera angles or slight screen rotation can cause geometric deformation of the pixel mesh. Directly generating meshes based on deformed images will result in incorrect physical coordinate positioning of dead pixels, heavily relying on high-precision tooling.
[0004] This invention aims to address the problem of insufficient adaptability of the preprocessing stage to image content. It also aims to solve the problem of how to achieve stable and accurate pixel-level mesh reconstruction and positioning when the screen image has geometric distortion or incomplete contour information. Summary of the Invention
[0005] The purpose of this invention is to provide a method for detecting dead pixels on a display screen based on morphological features and geometric calculations, so as to solve the problems mentioned in the background art.
[0006] To achieve the above objectives, the present invention provides a method for detecting dead pixels on a display screen based on morphological features and geometric calculations, the method comprising: Capture a grayscale image of the display screen; The grayscale image is subjected to adaptive image preprocessing and enhancement to generate a preprocessed image. The adaptive image preprocessing and enhancement includes adaptive brightness and contrast global calibration, local brightness compensation and equalization, and adaptive segmented enhancement based on bright spot density analysis. Robust geometric feature extraction and correction are performed on the preprocessed image to generate the geometric structure features of the screen, which include contour information, center point coordinates and rotation angle. Based on the aforementioned geometric structural features, intelligent mesh reconstruction and fault-tolerant analysis are performed to generate defect detection results for the display screen.
[0007] Preferably, the adaptive image preprocessing enhancement process for the grayscale image includes: The histogram of the grayscale image is statistically analyzed. When the effective range of the histogram does not cover the typical interval, the grayscale distribution is stretched to the target detection interval using linear or piecewise linear mapping. The grayscale image is divided into non-overlapping grid blocks, the average grayscale of each grid block is calculated, dark grid blocks with average grayscale significantly lower than the global mean are identified, and adaptive histogram equalization with limited contrast is applied to the dark grid blocks. Calculate the density distribution of high grayscale pixels in the grayscale image, adaptively determine the threshold, keep the grayscale value unchanged when the pixel grayscale value is lower than the threshold, and apply a nonlinear enhancement function when the pixel grayscale value is higher than the threshold.
[0008] Preferably, the robust geometric feature extraction and correction process for the preprocessed image includes: The preprocessed image is binarized using multiple thresholds to obtain multiple sets of contours. The contours are then fused by voting, and candidate contours that appear in at least two binarization results are retained. The candidate contours are then morphologically filtered based on area, roundness, and aspect ratio. For each filtered contour, the image centroid is calculated as the initial center point, and the center point of the minimum bounding rectangle of the contour is calculated. The initial center point and the center point of the minimum bounding rectangle are then fused to obtain the final center point. The final set of center points is subjected to column clustering and row clustering. The linear model is fitted using the random sampling consensus algorithm to obtain the column direction angle and row direction angle. The angle is then fused and the sign is determined to generate the final rotation angle.
[0009] Preferably, binarizing the preprocessed image using multiple thresholds includes: The preprocessed image is binarized using three different thresholds to generate three sets of contours; The three sets of contours are fused by voting, and the contours that appear in at least two binarization results are retained as candidate valid contours. The candidate valid contours are subjected to shape filtering to remove contours that are too large or too small in area or have extremely irregular shapes.
[0010] Preferably, the step of fusing the initial center point and the center point of the minimum bounding rectangle to obtain the final center point includes: Calculate the centroid of the image as the initial center point; Calculate the minimum bounding rectangle of the contour and obtain its center point; The initial center point and the center point of the smallest bounding rectangle are weighted and merged, or the one that is closer to the geometric distance of the contour point set is taken as the final center point.
[0011] Preferably, the step of performing angle fusion and sign determination to generate the final rotation angle includes: The final set of center points is sorted by x-coordinate and column clustering is performed. A linear model is fitted using a random sampling consensus algorithm to obtain the column direction angle. The final set of center points is sorted by y-coordinate and row clustering is performed. A random sampling consensus algorithm is used to fit a straight line model to obtain the row direction angle. Compare the column direction angle and the row direction angle. If they are the same, take the average value as the final rotation angle. Otherwise, select the angle with a higher proportion of the inner point. The correct sign of the angle is determined by the monotonically increasing trend of the x-coordinate of the cluster center point with the y-coordinate.
[0012] Preferably, the intelligent mesh reconstruction and fault-tolerant analysis based on the geometric structural features includes: The image and center point coordinates are rotated and corrected using the final rotation angle. Adaptive one-dimensional clustering in the x and y directions is performed on the corrected center point coordinates to detect abnormal structures and estimate the grid cell size based on the clustering results. On the reconstructed grid, the pixel fill rate and average gray level of the region are calculated for each cell, and bad pixels are adaptively determined by combining local context information.
[0013] Preferably, the adaptive one-dimensional clustering of the corrected center point coordinates in the x and y directions includes: Perform x-axis and y-axis clustering on the coordinates of the center point after rotation correction to obtain column clusters and row clusters; Locations in column or row clusters where the number of center points is significantly less than in other clusters or where spacing is abnormal are marked as potentially indicating missing rows or columns. Calculate the median and mode of the spacing between adjacent columns and the row spacing, and then weight and combine them to obtain the cell width and height; For missing rows or columns of labels, linear interpolation of theoretical coordinates is performed and inserted into the clustering sequence.
[0014] Preferably, the adaptive determination of bad pixels based on local context information includes: For each cell, define the analysis area and calculate the pixel fill rate and the average gray level of the area; The threshold for determining bad pixels is finely adjusted based on the average brightness of good pixels in the local area where the current cell is located. If an isolated point is identified as a bad point, but its surrounding neighborhood consists of good points, then a secondary verification is initiated.
[0015] Preferably, the method further includes: Generate a zero-one matrix representing the state of each unit on the display screen, where zero represents a bad pixel and one represents a good pixel; Based on the zero-one matrix, bad pixel location and statistical analysis are performed, and the bad pixel location is visualized.
[0016] Preferably, the step of performing column clustering and row clustering on the final set of centroids specifically includes: Sort all center points in the final center point set according to their x-coordinate values from smallest to largest; The sorted sequence of x-coordinate values is subjected to cluster analysis based on statistical distance. The centroids with similar x-coordinate values are grouped into the same column cluster, and the average x-coordinate value of all centroids contained in each column cluster is calculated. Sort all center points in the final center point set according to their ordinate values from smallest to largest; The sorted sequence of ordinate values is subjected to cluster analysis based on statistical distance. The centroids with similar ordinate values are grouped into the same row cluster, and the average ordinate value of all centroids contained in each row cluster is calculated.
[0017] Preferably, the step of fitting the linear model using a random sampling consensus algorithm to obtain the column direction angle and row direction angle specifically includes: For each column cluster, extract the two-dimensional coordinate data of all center points within that cluster; Two non-repeating sample points are randomly selected from the two-dimensional coordinate data, and a candidate straight line model is defined by these two sample points; Calculate the distance from all other center points in the two-dimensional coordinate data to the candidate straight line model, set a distance threshold, and determine the center points whose distance is less than the threshold as the support interior points of the candidate straight line model; Repeat the above process of extracting sample points, defining candidate models, and calculating support interior points a preset number of times, and select the candidate line model that obtains the most support interior points as the best fitting line for the column family. Calculate the angle between the best-fit line and the horizontal axis of the image coordinate system, and take its absolute value as the column direction angle of the column cluster; For all column families, calculate the average of their column direction angles as the global column direction angle; The same steps are used to process each row cluster, and the global row direction angle is finally calculated.
[0018] Preferably, the step of performing angle fusion and sign determination to generate the final rotation angle specifically includes: Compare the absolute value of the difference between the global column direction angle and the global row direction angle; If the absolute value of the difference is less than the preset allowable deviation threshold, it is determined that the column direction angle is consistent with the row direction angle, and the arithmetic mean of the global column direction angle and the global row direction angle is used as the initial rotation angle of the undetermined sign. If the absolute value of the difference is greater than or equal to the preset allowable deviation threshold, then the proportion of interior points of the best-fit line model corresponding to the global column direction angle and the proportion of interior points of the best-fit line model corresponding to the global row direction angle are calculated respectively. The angle corresponding to the straight line model with a higher proportion of interior points is selected as the initial rotation angle for the undetermined symbol. Calculate the trend of the average abscissa value of the center point of all interior points on the best-fit straight line model corresponding to the initial rotation angle of the undetermined sign as a function of its average ordinate value. If the average abscissa value increases with the increase of the average ordinate value, then a positive sign is assigned to the initial rotation angle of the undetermined sign; If the average horizontal coordinate value decreases as the average vertical coordinate value increases, then a negative sign is assigned to the initial rotation angle of the undetermined sign. The angle value after assigning a sign is taken as the final rotation angle.
[0019] Compared with the prior art, the beneficial effects of the present invention are: Adaptive segmented enhancement technology based on bright spot density analysis changes the traditional globally uniform processing approach. This technology first performs density analysis on the preprocessed image for potential bright spots, dividing the image into regions with different characteristics based on the density distribution. For high bright spot density regions, the algorithm can activate stronger contrast enhancement and noise suppression strategies to highlight real defects and suppress clustered noise; in low-density regions, more conservative enhancement parameters are used to avoid over-processing and introducing false defects. This scheme, which dynamically adjusts based on the characteristics of the image content itself, improves the signal-to-noise ratio for real defects in complex backgrounds and reduces false alarms caused by uneven lighting or background textures.
[0020] This intelligent mesh reconstruction technology, combining geometric correction and fault-tolerant analysis, breaks through the traditional method's reliance on a perfectly regular screen and complete outlines in the image. By using extracted geometric features to perform affine or perspective transformations on the image, tilted or distorted screen areas can be normalized to a standard front view. Based on the known physical resolution of the screen, a theoretical pixel mesh is reconstructed, achieving a precise mapping between defective pixel coordinates and physical pixels on the screen. The built-in fault-tolerant analysis mechanism compensates for geometric feature errors through algorithmic fitting and inference when the extracted outlines are partially missing or interfered with, resulting in stable mesh reconstruction. This significantly reduces the requirements for camera pose, screen placement, and the integrity of the screen borders in the entire inspection process, enhancing the robustness and adaptability of the inspection system in real-world production environments. Attached Figure Description
[0021] Figure 1 This is a schematic diagram illustrating the working principle of the display screen defect detection method based on morphological features and geometric calculations described in this invention. Figure 2 The flowchart for multi-threshold binarization and contour fusion is shown below; Figure 3 Flowchart for angle fusion and symbol determination; Figure 4 A composite image of column cluster spacing and the number of center points within a cluster in display screen defect detection; Figure 5 A heatmap of the image on the display screen. Detailed Implementation
[0022] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0023] Please see Figure 1This invention provides a method for detecting defective pixels in a display screen based on morphological features and geometric calculations. The method includes: acquiring a grayscale image of the display screen using an image acquisition device, which serves as input data for the entire detection process; performing adaptive image preprocessing enhancement on the acquired grayscale image, which aims to improve image quality to highlight the contrast between the display area and the background and compensate for possible uneven lighting, generating a preprocessed image; performing robust geometric feature extraction and correction on the preprocessed image, accurately extracting the geometric structural features of the screen by analyzing the contours and arrangement of the display units in the image, including the contour information of the effective display area, the set of center point coordinates of the display unit array, and the rotation angle of the screen relative to the image coordinate axes; and performing intelligent mesh reconstruction and fault-tolerant analysis based on the extracted geometric structural features, reconstructing a regular theoretical mesh model based on the center point coordinates, and analyzing pixel features within the image area corresponding to each mesh cell, thereby generating defective pixel detection results for the display screen and identifying the good or bad status of each display unit.
[0024] Example 1: The histogram of a grayscale image is statistically analyzed to determine its grayscale value distribution range. When the effective range of the histogram does not cover the typical detection interval, a linear or piecewise linear mapping function is used to stretch the grayscale distribution of the image to the target detection interval to enhance overall contrast. The grayscale image is divided into several non-overlapping grid blocks. The average grayscale value of pixels in each grid block is calculated. By comparing the average grayscale value of each grid block with the global mean of the image, dark grid blocks with average grayscale values significantly lower than the global mean are identified. An adaptive histogram equalization algorithm with contrast limitation is applied to these identified dark grid blocks to improve the contrast of local areas without amplifying noise. The density distribution of high grayscale pixels in the grayscale image is calculated. A grayscale threshold is adaptively determined based on the distribution characteristics. For pixels with grayscale values below this threshold, their original grayscale values are kept unchanged. For pixels with grayscale values above this threshold, a non-linear enhancement function is applied to enhance brightness, achieving targeted enhancement of bright areas.
[0025] In specific implementations, adaptive image preprocessing enhancement includes adaptive global brightness and contrast calibration, local brightness compensation and equalization, and adaptive segmented enhancement based on bright spot density analysis. Specifically, the histogram of the grayscale image is statistically analyzed. When the effective range of the grayscale image's histogram does not cover the typical range, linear mapping or piecewise linear mapping is used to stretch the grayscale distribution to the target detection range. The typical range is a range pre-defined based on the grayscale characteristics of the display image. The target detection range covers a continuous range from the minimum target grayscale value to the maximum target grayscale value. In some embodiments, linear mapping is achieved by linearly transforming the original grayscale values to the target range, while piecewise linear mapping allows different stretching coefficients to be applied to different sub-ranges of the grayscale image. Optionally, the inflection point of the piecewise linear mapping is automatically selected based on the histogram distribution characteristics of the grayscale image.
[0026] In practice, the grayscale image is divided into non-overlapping grid blocks. The size of the grid blocks is adaptively determined based on the image resolution. The average grayscale value of each grid block is calculated. The global mean is the average of the grayscale values of all pixels in the entire grayscale image. Grid blocks with average grayscale values significantly lower than the global mean are identified as dark area grid blocks. The criterion for significantly lower than the global mean is that the average grayscale value of the grid block is less than the global mean minus a fixed threshold. Adaptive histogram equalization with limited contrast is applied to the dark area grid blocks. Adaptive histogram equalization with limited contrast is achieved by cropping the peak value of the local histogram and redistributing the grayscale levels. It can be understood that the local brightness compensation and equalization process independently processes each dark area grid block to improve local contrast.
[0027] In practical implementation, the density distribution of high grayscale pixels in the grayscale image is calculated. High grayscale pixels are those with grayscale values higher than a preset threshold. The density distribution is obtained by counting the number of high grayscale pixels at different grayscale levels. The threshold is adaptively determined using the maximum inter-class variance method or by analyzing the inflection point of the density distribution curve. For pixels with grayscale values lower than the adaptive threshold, the original grayscale value of the pixel is kept unchanged. For pixels with grayscale values higher than the adaptive threshold, a nonlinear enhancement function is applied. The form of the nonlinear enhancement function is as follows: in: This represents the enhanced pixel grayscale value. Represents the original pixel grayscale value. Indicates an adaptive threshold. Indicates the gain coefficient. Represents the power exponent and gain coefficient. Power index The gain coefficient is adaptively adjusted based on the high grayscale pixel density, especially at high densities. The value decreases, and the gain coefficient decreases at low density. As the value increases, in some embodiments, the adaptive threshold... Calculated using the Otsu's method, the optional nonlinear enhancement function is activated only when the pixel grayscale value is higher than the adaptive threshold.
[0028] Example 2: See Figure 2 The preprocessed image is binarized using multiple different thresholds, for example, three different thresholds are used to generate three binary images, resulting in three sets of contours. These three sets of contours are then fused through a voting process, retaining those contours that appear in at least two of the binarized results generated by different thresholds; these are then identified as candidate valid contours. Morphological filtering is applied to these candidate valid contours, filtering out contours that are too large or too small, or extremely irregular in shape, based on morphological parameters such as area, roundness, and aspect ratio, while retaining contours that conform to the characteristics of the display unit. For each contour after morphological filtering, its image moments are calculated to obtain the centroid coordinates as the initial center point, and the minimum bounding rectangle of the contour is calculated, along with its center point coordinates. The initial center point and the center point of the minimum bounding rectangle are fused to obtain the final center point of the contour. The fusion strategy can employ a weighted average or select the point with the closest geometric distance to the contour point set. The final set of center points is sorted by x-coordinate and then clustered along the column direction. A random sampling consensus algorithm is used to fit a linear model to obtain the column direction angles. Similarly, the set is sorted by y-coordinate and then clustered along the row direction, again using the random sampling consensus algorithm to fit a linear model to obtain the row direction angles. Angle fusion and sign determination are then performed to generate the final rotation angles. The column direction angles and row direction angles are compared; if they are the same, the average is taken; otherwise, the angle corresponding to the model with the higher proportion of interior points is selected. The correct sign of the angle is determined based on the monotonically increasing trend of the x-coordinate of the column cluster center point with the y-coordinate.
[0029] In specific implementation, robust geometric feature extraction and correction processing includes binarizing the preprocessed image using multiple thresholds, performing voting fusion on the obtained contours, morphological filtering on candidate contours, calculating contour center points, and performing angle fitting on the center point set. In specific implementation, binarizing the preprocessed image using multiple thresholds means processing the image separately using at least three different fixed thresholds or adaptive thresholds to generate multiple binary images. In some embodiments, three different thresholds are used to binarize the preprocessed image, and the three thresholds are respectively set to specific quantiles of the gray value distribution, such as low quantile, median, and high quantile. Contours of all connected regions are extracted from each binary image to obtain three independent contour sets.
[0030] In the specific implementation, the three sets of contours are fused by voting. The purpose of voting fusion is to determine those contours that appear stably under multiple binarization conditions, retaining contours that appear in at least two binarization results as candidate valid contours. The fusion process is achieved by comparing the position and shape overlap of contours in different contour sets. It can be understood that candidate valid contours represent the boundaries of screen display units that can still be stably detected under changes in illumination or contrast. In the specific implementation, morphological filtering is performed on candidate valid contours. Morphological filtering is based on area, roundness, and aspect ratio parameters to filter out contours that are too large or too small. Contours with too large an area may correspond to screen borders or large reflective areas, while contours with too small an area may correspond to image noise or minor blemishes. Contours with extremely irregular shapes are also filtered out. Roundness is used to measure how close the contour is to a circle, and aspect ratio is used to exclude obviously non-rectangular shapes. Optionally, the area threshold is set based on the statistical value of the expected display unit size in the image, and the roundness threshold and aspect ratio threshold are set based on the geometric characteristics of an ideal rectangular display unit.
[0031] In practical implementation, for each filtered contour, the image moment centroid is calculated as the initial center point. The image moment centroid is calculated from the zeroth and first moments of the contour. Simultaneously, the center point of the contour's minimum bounding rectangle is calculated. The minimum bounding rectangle is the smallest rectangle that completely encloses the contour and whose edges are parallel to the image coordinate axes. Its center point coordinates are obtained. The initial center point and the minimum bounding rectangle center point are fused to obtain the final center point. The fusion strategy can be to calculate a weighted average of the two point coordinates. In some embodiments, the weighting formula is: in: Indicates the final center point coordinates. Represents the centroid coordinates of the image moments. This represents the coordinates of the center point of the smallest bounding rectangle. This represents the fusion weight coefficient. Optionally, the fusion strategy can also be to use a point that is geometrically closer to the contour point set as the final center point. The distance is measured by calculating the average or minimum distance from the center point to all points on the contour.
[0032] In practice, column clustering and row clustering are performed on the final set of centroids. Column clustering is performed by sorting the final centroids by their x-coordinates. A random sampling consensus algorithm is used to fit the linear model to obtain the column direction angle. The random sampling consensus algorithm robustly estimates the linear parameters from noisy data through iterative random sampling and model validation. Row clustering is performed by sorting the final centroids by their y-coordinates. A random sampling consensus algorithm is used to fit the linear model to obtain the row direction angle. Ideally, the column direction angle and the row direction angle should be complementary angles or have a fixed relationship. The column direction angle and the row direction angle are compared. If their values are the same, the average value is taken as the final rotation angle. Otherwise, the angle corresponding to the random sampling consensus algorithm model with a higher proportion of inliers is selected as the final rotation angle. The proportion of inliers is the ratio of the number of centroids conforming to the linear model to the total number of centroids. The correct sign of the angle is determined based on the monotonically increasing trend of the x-coordinate of the column cluster centroids with the y-coordinate.
[0033] Example 3: See Figure 3 For each filtered contour, its image centroid is calculated as the initial center point. The minimum bounding rectangle of the contour is calculated, and its center point is obtained. The initial center point and the minimum bounding rectangle center point are merged to obtain the final center point. The fusion method includes weighted averaging of the coordinates of the two points, or calculating the geometric distance between the two points and the contour point set, and selecting the closer point as the final center point. The final center point set is sorted by x-coordinate and clustered into columns. A linear model is fitted using the random sampling consensus algorithm to obtain the column direction angle. The final center point set is sorted by y-coordinate and clustered into rows. A linear model is fitted using the random sampling consensus algorithm to obtain the row direction angle. Angle fusion and sign determination are performed to generate the final rotation angle. The obtained column direction angle and row direction angle are compared. If they are consistent, the average value is taken as the final rotation angle; otherwise, the angle with a higher proportion of inliers is selected as the final rotation angle. The correct sign of the angle is determined based on the monotonically increasing trend of the x-coordinate of the column cluster center point with the y-coordinate.
[0034] In specific implementation, for each contour retained after morphological filtering, the image moment centroid is calculated as the initial center point of the contour. The calculation of the image moment centroid is based on the polygonal point set of the contour, obtained by taking the weighted average of the pixel coordinates within the contour region. Simultaneously, the minimum bounding rectangle of the contour is calculated. The minimum bounding rectangle is a rectangle that completely encloses all points of the contour and whose sides are parallel to the image coordinate system axes. The coordinates of the center point of the minimum bounding rectangle are obtained. In some embodiments, the minimum bounding rectangle is determined by directly traversing the boundary values of the contour point set. The initial center point and the center point of the minimum bounding rectangle are fused to obtain the final center point. The fusion operation can be calculated by taking the weighted average of the coordinates of the two points. The weighting formula is: in: This represents the final center point coordinate vector. This represents the centroid coordinate vector of the image moments. This represents the coordinate vector of the center point of the smallest bounding rectangle. This represents the fusion weighting coefficient. The value ranges from 0 to 1. Optionally, the fusion strategy can also be to use the point that is closer to the geometric distance of the contour point set as the final center point, calculate the sum of the squares of the distances from the initial center point and the center point of the smallest bounding rectangle to each side of the contour polygon, and select the point with the smaller sum of squared distances as the final center point.
[0035] In practice, column clustering and row clustering are performed on the final center point set composed of the final center points of all contours to fit a straight line and calculate the angle. The final center point set is sorted in ascending order of x-coordinate and then column clustering is performed. Column clustering uses a traversal method based on a fixed distance threshold, grouping consecutive points whose x-coordinate difference is less than a preset column spacing threshold into the same column cluster. For the center points within each column cluster, a random sampling consensus algorithm is used to fit a straight line model. The random sampling consensus algorithm iteratively selects two points to determine a straight line and calculates the number of interior points. Interior points are those whose distance to the straight line is less than a set tolerance error. For the poorest points, select the straight line model with the most interior points, calculate the angle between this line and the horizontal coordinate axis of the image as the column direction angle, sort the final center point set in ascending order of y-coordinate, and then perform row clustering. Row clustering adopts a traversal method based on a fixed distance threshold, and group consecutive points with y-coordinate differences less than a preset row spacing threshold into the same row cluster. For the center point in each row cluster, use a random sampling consensus algorithm to fit the straight line model and calculate the angle between this line and the vertical coordinate axis of the image as the row direction angle. It can be understood that the row direction angle and the column direction angle should differ by 90 degrees under an ideal orthogonal grid.
[0036] In practice, angle fusion and sign determination are performed to generate the final rotation angle. The column direction angle and row direction angle are compared. The column direction angle is the angle between the column cluster line and the horizontal axis, and the row direction angle is the angle between the row cluster line and the vertical axis. If the absolute difference between the column direction angle and the row direction angle minus 90 degrees is less than a set tolerance, they are considered consistent. The arithmetic mean of the results of the column direction angle and the row direction angle minus 90 degrees is taken as the final rotation angle. If they are inconsistent, the proportion of interior points in the best model obtained by the random sampling consensus algorithm during column clustering and row clustering is checked separately. The angle corresponding to the model with the higher proportion of interior points is selected as the final rotation angle. The point ratio is the proportion of the number of internal points to the total number of points in the cluster. The correct sign of the angle is determined based on the monotonically increasing trend of the x-coordinate of the column cluster center point with the y-coordinate. The linear regression slope of the coordinates of all center points in the column cluster is calculated. If the slope is positive, the angle sign is positive; if the slope is negative, the angle value is negative. In some embodiments, before angle fusion, the angles calculated for all column and row clusters are subjected to median filtering to remove outliers. Optionally, the final rotation angle is used to perform reverse rotation correction on the original image and all coordinates, so that the screen display unit array is aligned with the image coordinate axis. It can be understood that the correct determination of the angle sign ensures the logical consistency of coordinate sorting during subsequent mesh reconstruction.
[0037] Example 4: The original image and all extracted center point coordinates are rotated and corrected using the final rotation angle to align the screen display unit array with the image coordinate axes. Adaptive one-dimensional clustering is performed on the rotated and corrected center point coordinates in the x and y directions to obtain column clusters and row clusters. Locations in column or row clusters where the number of center points is significantly less than other clusters or where the spacing between adjacent clusters is abnormal are detected and marked as areas where entire rows or columns of display units may be missing. The median and mode of all adjacent column spacings are calculated, and a weighted fusion is performed to obtain the estimated grid cell width. The cell height is calculated using the same method. For the marked potentially missing rows or columns, linear interpolation is performed based on the coordinate information of the rows and columns before and after them to generate theoretical center point coordinates, which are then inserted into the clustering sequence to complete the reconstruction of the grid structure. On the reconstructed theoretical grid, an analysis region corresponding to each cell in the image is defined, and the pixel fill rate and average gray level of the region are calculated. Defective pixels are adaptively determined by combining local context information.
[0038] In the specific implementation, intelligent grid reconstruction and fault-tolerant analysis are performed based on geometric structural features. Specifically, the original grayscale image and all extracted final center point coordinates are rotated and corrected using the final rotation angle. This rotation correction is achieved through an affine transformation with the image center as the origin. The final rotation angle is negatively valued as the rotation parameter, ensuring that the physical row and column directions of the screen display unit array are parallel to the coordinate axes of the processed image. The corrected center point coordinates form a new two-dimensional point set, whose coordinate values reflect the theoretical position of the display unit in the corrected image. In the specific implementation, adaptive one-dimensional clustering in the x-direction and y-direction is performed on the rotated and corrected center point coordinates. The x-coordinates are sorted, and the difference between adjacent x-coordinates is calculated. Continuous points with differences less than a dynamic threshold are grouped into the same column cluster. The dynamic threshold is determined by multiplying the median of the difference sequence of all adjacent x-coordinates by a coefficient. A similar operation is performed on the y-coordinates to obtain row clusters. See Table 1, which shows a simplified column clustering result and spacing calculation.
[0039] Table 1: Clustering Results of Corrected Centroid Columns
[0040] In practical implementation, the system detects whether there are clusters of columns or rows where the number of center points is significantly less than that of other clusters. For example, if the number of center points in a certain column cluster is less than 50% of the number of center points in other column clusters, this location is marked as potentially having a missing column. The system also detects whether there are anomalies in the spacing between adjacent column clusters or adjacent row clusters. If a spacing value exceeds 1.5 times or is less than 0.5 times the typical median spacing value, this location is marked as an anomaly. These markers are used to indicate potential defects or detection interference in the grid structure. In practical implementation, the grid cell size is estimated based on the clustering results. The median and mode of all adjacent column spacing values are calculated, and the median and mode are weighted and fused to obtain the cell width. Similarly, the median and mode of all adjacent row spacing values are calculated, and weighted and fused to obtain the cell height. The weighted fusion formula is as follows: in: This indicates the estimated cell width or height. This represents the median of the adjacent spacing values. The mode represents the value of the interval between adjacent values. This represents the weighting coefficient. The value ranges from 0.5 to 0.8. In some embodiments, the weighting coefficient... The weighting coefficient is adaptively adjusted based on the degree of dispersion of the spacing values; when the dispersion is large, the weighting coefficient is adjusted accordingly. Sloping toward the median.
[0041] In practice, linear interpolation is performed on marked missing rows or columns to generate theoretical coordinates. For positions with missing columns, linear interpolation is performed based on the estimated cell width using the center values of the x-coordinates of the complete column clusters before and after the missing column. The theoretical x-coordinate of the missing column is then calculated and inserted into the column clustering sequence as a virtual center point. A similar operation is performed on missing rows, using the center values of the y-coordinates of the complete row clusters before and after the missing rows and the estimated cell height for interpolation. Optionally, linear interpolation is performed independently in the x and y directions. After interpolation, a complete, theoretical grid intersection coordinate matrix is formed. It can be understood that the fault-tolerant interpolation operation ensures that the grid structure can still be completely reconstructed when some display units are completely ineffective or severely contaminated, causing contour extraction to fail. This provides a unified coordinate framework for subsequent bad pixel analysis.
[0042] See Figure 4 This is a composite chart showing the spacing between column clusters and the number of center points within each cluster in display defect detection, corresponding to the "one-dimensional clustering analysis stage." Its core function is to identify anomalies in column clusters. The spacing between column clusters 2-5 is stable between 24-25 pixels, falling within the normal range of "low threshold (12.1) - high threshold (36.4)," with no spacing anomalies. The number of center points in column clusters 1-4 is 8, while that in column cluster 5 is only 2, far lower than other clusters (less than 50%), classifying it as an abnormal cluster with "significantly insufficient number of center points." Column cluster 5 is marked as a region where "entire column of display units is missing." This type of chart is a key analytical tool for intelligent grid reconstruction. By simultaneously displaying the distribution of "spacing" and "number of center points," it can quickly locate potential defects in the grid structure (such as missing rows and columns), providing a basis for subsequent "linear interpolation to complete the grid," ensuring the integrity and accuracy of the grid framework for display defect detection.
[0043] Example 5: For each grid cell, within its corresponding image analysis area, calculate the pixel fill rate and the average gray level of the region. Fine-tune the defective pixel determination threshold based on the average brightness of good pixels in the local area where the current cell is located, achieving threshold adaptation. If an isolated point is determined to be a defective pixel, but all its surrounding cells are determined to be good pixels, a secondary verification process is initiated for the determination result of this isolated point, such as using stricter determination conditions or combining other features for review. Generate a zero-one matrix representing the state of each unit on the display screen, where a zero matrix element indicates that the corresponding display unit is a defective pixel, and a one matrix element indicates that the corresponding display unit is a good pixel. Based on this zero-one matrix, perform defective pixel location and quantity statistics, analyze distribution patterns, and visually annotate the defective pixel location information on the original image or grid diagram.
[0044] In specific implementation, for each cell obtained after intelligent grid reconstruction, its analysis area on the rotated and corrected image is defined. The analysis area is usually a rectangular area formed by extending outward from the theoretical center coordinates of the cell to 80% of the estimated cell size. The pixel fill rate within the analysis area is calculated. The pixel fill rate is the ratio of the number of pixels with gray values higher than the background segmentation threshold to the total number of pixels in the area. At the same time, the average gray value of the analysis area is calculated. The average gray value of the area is the arithmetic mean of the gray values of all pixels in the analysis area. In some embodiments, the background segmentation threshold is automatically determined by analyzing the gray value distribution of the non-display area of the screen. Optionally, the range of the analysis area can be fine-tuned according to the confidence of the grid reconstruction. When the reconstruction confidence is low, the range of the analysis area can be appropriately expanded.
[0045] In practice, the system adaptively determines defective pixels by incorporating local context information. The defective pixel determination threshold is fine-tuned based on the average brightness of good pixels within the local area containing the current cell. The local area is defined as a rectangular block composed of several rows and columns of adjacent cells centered on the current cell. The average brightness of good pixels is the average grayscale value of the area within the local area that has been initially determined to be a normal display unit. The adjusted defective pixel determination threshold is as follows: in: This represents the adaptive decision threshold after fine-tuning. This represents the global basic judgment threshold. This indicates the average brightness of a localized area. This indicates that the average brightness of the entire screen is better. This represents the local brightness adjustment coefficient. The value ranges from 0.1 to 0.5. It can be understood that this fine-tuning mechanism allows the judgment threshold to adapt to the gradual changes in brightness or slight uneven lighting in different areas of the screen.
[0046] In practical implementation, if an isolated pixel is initially identified as a bad pixel, but all its surrounding cells are identified as good pixels, a secondary verification is initiated for the isolated pixel's identification result. The surrounding cells typically refer to the eight cells directly adjacent to it. The secondary verification process includes re-evaluating using a more stringent identification threshold, or reviewing the result by combining a weighted comprehensive score of pixel fill rate and average gray level of the region. In some embodiments, the weighted comprehensive score formula uses different feature weights than the initial identification. Optionally, the secondary verification may also introduce historical detection data or morphological consistency checks of the cell as auxiliary judgment criteria. In practical implementation, a zero-one matrix representing the state of each unit on the display screen is generated. The number of rows and columns in the zero-one matrix strictly corresponds to the number of row clusters and column clusters in the reconstructed theoretical grid. Each element in the matrix corresponds to a theoretical cell. For each cell, if it is ultimately identified as a bad pixel, a zero is filled in the corresponding position in the zero-one matrix; if it is identified as a good pixel, a one is filled in. It can be understood that the zero-one matrix completely encodes the bad pixel distribution information of the entire screen in a concise two-dimensional array form.
[0047] In specific implementation, defect location and statistical analysis are performed based on a zero-one matrix. Defect location is achieved by traversing the zero-one matrix and recording the row and column indices of all elements with a value of zero. Statistical analysis includes calculating the total number of defective pixels, calculating the proportion of defective pixels to the total number of display units on the screen, and analyzing whether defective pixels exhibit a clustered distribution. The location of defective pixels is then visualized. Visualization is achieved by drawing a mark at the theoretical center of each cell identified as a defective pixel on a grid aligned with the original image. The mark can be a conspicuous colored cross or a solid circle. In some embodiments, the visualization results are overlaid on the original or corrected image as an independent layer. Optionally, key data from the statistical analysis are annotated in text form on the edge area of the visualized image.
[0048] See Figure 5 This is a heatmap of a display screen image, corresponding to the "adaptive image preprocessing enhancement" or "defective pixel determination" stage in the display screen defect detection process. Its core purpose is to display the grayscale distribution characteristics of different areas of the screen. The grayscale values of most areas of the screen are concentrated between 100 and 200, with relatively uniform overall brightness. The dark purple blocks have grayscale values close to 0, belonging to "low grayscale abnormal areas," consistent with the grayscale characteristics of display screen defects. Abnormal areas are distributed in isolated blocks, without obvious continuous patches, consistent with the behavior of single / few defective pixels. This type of heatmap is a basic visualization tool for display screen defect detection: by mapping the grayscale values of screen pixels to colors, it can intuitively locate areas of grayscale abnormalities, providing intuitive visual basis for subsequent "adaptive preprocessing enhancement" (such as local brightness compensation) and "defective pixel determination" (combined with fill rate / local context), assisting in the accurate identification of defective pixel locations. Example
[0049] In the display defect detection process, after adaptive image preprocessing enhancement and robust geometric feature extraction, the process enters the intelligent mesh reconstruction and fault-tolerant analysis stage. First, the original grayscale image and all extracted final center point coordinates are rotated and corrected using the calculated final rotation angle. The rotation correction operation is achieved through an affine transformation with the image center as the origin, using the negative value of the final rotation angle as the rotation parameter, ensuring that the physical row and column directions of the screen display unit array are strictly parallel and aligned with the image coordinate axes. The corrected center point coordinates constitute a new two-dimensional point set, whose coordinate values reflect the theoretical position of each display unit in the corrected image, laying the geometric foundation for subsequent mesh reconstruction.
[0050] Adaptive one-dimensional clustering analysis was performed on the center point coordinates after rotation correction in both the x and y directions. In the x-direction, all center points were sorted in ascending order of their x-coordinate values, forming an ordered sequence. The difference in x-coordinates between adjacent points in the sequence was calculated, and a clustering distance threshold was dynamically set based on the median of all difference sequences. Points with consecutive x-coordinate differences less than this threshold were grouped into the same column cluster, and the average x-coordinate value of all center points contained in each column cluster was calculated as the representative coordinate of that column cluster. Similarly, a similar operation was performed in the y-direction: all center points were sorted by y-coordinate, and clustering was performed based on the dynamic threshold of y-coordinate differences to form row clusters. The average y-coordinate value of each row cluster was calculated. This adaptive clustering process effectively addresses center point loss or coordinate deviation caused by the complete failure of some display units or poor local image quality.
[0051] Based on the clustering results, the system detects abnormal structures within column or row clusters. Specifically, it checks if a column cluster contains significantly fewer centroids than most other column clusters (e.g., less than 50% of the centroids of other clusters) or if the spacing between adjacent column clusters is abnormal (e.g., a spacing value significantly greater than or less than the median of typical spacing values). Clusters with insufficient centroids or adjacent clusters with abnormal spacing are marked as potentially missing rows or columns. The system then calculates the median and mode of all adjacent column spacing values and performs a weighted fusion of these two statistics to obtain an estimated grid cell width. Row spacing is processed using the same procedure to obtain an estimated grid cell height. During weighted fusion, the weighting coefficients are adaptively adjusted based on the dispersion of the spacing values; if the distribution is relatively concentrated, the mode is favored, while if the distribution is dispersed, the median is given more weight, ensuring the robustness of the estimated size. For previously marked potentially missing rows or columns, the system activates a fault-tolerant mechanism. Based on the representative coordinates of the complete row or column clusters before and after the missing location, and combined with the estimated cell height or width, linear interpolation is performed to generate the theoretical center point coordinates of the missing row or column. These theoretical coordinate points are then inserted as virtual center points into the corresponding clustering sequence, thereby constructing a complete and regular theoretical mesh model. This fault-tolerant interpolation step is crucial, ensuring that even if some center points are missing due to some cells being completely unresponsive or contour extraction failing during actual detection, the entire screen's mesh framework can still be accurately reconstructed, providing a unified and complete coordinate reference system for subsequent bad pixel analysis.
[0052] On the successfully reconstructed theoretical grid, adaptive defect detection is performed for each grid cell. An analysis region is defined for each cell in the corrected image, typically a rectangular area extending outwards from the theoretical center coordinates of that cell to 80% of the estimated cell size. Within this analysis region, two key performance indicators are calculated: pixel fill rate and region average grayscale. Pixel fill rate refers to the proportion of pixels with grayscale values higher than the background segmentation threshold within the analysis region, reflecting the density of bright pixels in that region. Region average grayscale is the arithmetic mean of all pixel grayscale values within the analysis region, reflecting the overall brightness level of that region. The background segmentation threshold is automatically determined by analyzing the grayscale distribution in non-display areas such as screen borders.
[0053] The judgment process fully incorporates local contextual information to achieve adaptability. First, the global basic judgment threshold is fine-tuned based on the average brightness of good points in the local area where the current cell is located. A local area is typically defined as a rectangular block composed of several adjacent cells centered on the current cell. The average brightness of good points refers to the average grayscale value of the cells within this local area that have been initially determined to be normal display units. The fine-tuning formula allows the judgment threshold to be dynamically adjusted according to changes in local brightness, appropriately increasing the threshold in brighter areas to avoid false detections and appropriately decreasing the threshold in darker areas to prevent missed detections. This mechanism effectively compensates for the effects of uneven screen brightness or slight differences in lighting.
[0054] Furthermore, the system introduces a secondary verification mechanism for isolated points to improve the reliability of the judgment. If a cell is initially judged as a bad point, but its eight directly adjacent cells are all judged as good points, meaning the bad point is isolated, the system will initiate a secondary verification process for this judgment. Secondary verification may use a more stringent judgment threshold to recalculate feature indicators, or combine pixel fill rate and average grayscale of the region to calculate a weighted comprehensive score and use different feature weights than the initial judgment for review, and may even refer to the cell's state data in historical detections. This step helps reduce false judgments caused by transient noise, minor blemishes, or other accidental factors, improving the accuracy of the detection results.
[0055] For calculating the column and row direction angles, a robust linear model is fitted using a random sampling consensus algorithm. For each column cluster obtained through clustering, the two-dimensional coordinate data of all center points within the cluster are extracted. Two unique sample points are randomly selected from these coordinate data, and these two points determine a candidate linear model. The distances from all other center points within the cluster to this candidate line are calculated. A distance threshold is set, and points with distances less than the threshold are identified as supporting interior points of the candidate model. This random sampling and interior point counting process is repeated a preset number of times, and the candidate linear model with the most supporting interior points is finally selected as the best-fit line for that column cluster. The angle between this best-fit line and the horizontal axis of the image coordinate system is calculated, and its absolute value is taken as the column direction angle for that column cluster. The average of the column direction angles calculated for all column clusters is taken to obtain the global column direction angle. The exact same algorithm is applied to each row cluster to finally calculate the global row direction angle. The random sampling consensus algorithm effectively eliminates outliers in the coordinate data, ensuring the robustness of the linear fitting.
[0056] After obtaining the global column and row angles, angle fusion and sign determination are performed to generate the final rotation angle. First, the absolute value of the difference between the global column angle and the global row angle minus 90 degrees is compared. If this absolute value is less than a preset tolerance threshold, the column and row directions are considered to have good orthogonality, and their angles are consistent. The arithmetic mean of the results of subtracting 90 degrees from the column and row angles is then taken to obtain a preliminary rotation angle with an undetermined sign. If the absolute value of the difference exceeds the tolerance threshold, it indicates a significant deviation in orthogonality. In this case, it is necessary to compare the proportion of inliers corresponding to the best-fit linear models in the column and row clustering processes. A higher proportion of inliers indicates a better fit of the linear model, and the more reliable the corresponding angle. Therefore, the angle with the higher proportion of inliers is selected as the preliminary rotation angle with an undetermined sign.
[0057] The algorithm calculates the trend of the average x-coordinate value of the center point of all supporting interior points on the best-fit linear model corresponding to the initial rotation angle with an undetermined sign, as a function of their average y-coordinate value. Specifically, linear regression analysis can be performed on these interior point coordinates to observe the slope of the regression line. If the average x-coordinate value increases with the average y-coordinate value (i.e., the slope is positive), the initial rotation angle is assigned a positive sign. If the average x-coordinate value decreases with the average y-coordinate value (i.e., the slope is negative), the initial rotation angle is assigned a negative sign. Finally, the angle value assigned the correct sign is used as the final rotation angle for image and coordinate rotation correction. This sign determination mechanism ensures that the physical coordinate order of cells remains logically consistent with the actual row and column orientation of the screen during subsequent mesh reconstruction.
[0058] Finally, a zero-one matrix is generated that perfectly corresponds to the number of rows and columns of the reconstructed theoretical grid, used to encode the defect detection results for the entire display screen. Each element in the matrix represents the state of a theoretical cell; if the cell is ultimately determined to be a defective pixel, the corresponding matrix position is assigned a value of zero; if it is determined to be a good pixel, it is assigned a value of one. Based on this zero-one matrix, defective pixels can be easily located, the row and column indices of all defective pixels can be recorded, and statistical analysis can be performed, such as calculating the total number of defective pixels, the defective pixel rate, and analyzing whether the distribution pattern of defective pixels shows clustering. The detection results are finally presented visually. On a grid map aligned with the original or corrected image, a prominent mark, such as a colored cross or a solid circle, is drawn at the theoretical center position corresponding to each defective pixel, forming an intuitive defective pixel distribution map. All key statistical information is also annotated in text form next to the image.
[0059] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A method for detecting dead pixels on a display screen based on morphological features and geometric calculations, characterized in that, The method includes: Capture a grayscale image of the display screen; The grayscale image is subjected to adaptive image preprocessing and enhancement to generate a preprocessed image. The adaptive image preprocessing and enhancement includes adaptive brightness and contrast global calibration, local brightness compensation and equalization, and adaptive segmented enhancement based on bright spot density analysis. Robust geometric feature extraction and correction are performed on the preprocessed image to generate the geometric structure features of the screen, which include contour information, center point coordinates and rotation angle. Based on the aforementioned geometric structural features, intelligent mesh reconstruction and fault-tolerant analysis are performed to generate defect detection results for the display screen. The robust geometric feature extraction and correction process for the preprocessed image includes: The preprocessed image is binarized using multiple thresholds to obtain multiple sets of contours. The contours are then fused by voting, and candidate contours that appear in at least two binarization results are retained. The candidate contours are then morphologically filtered based on area, roundness, and aspect ratio. For each filtered contour, the image centroid is calculated as the initial center point, and the center point of the minimum bounding rectangle of the contour is calculated. The initial center point and the center point of the minimum bounding rectangle are then fused to obtain the final center point. The final set of center points is subjected to column clustering and row clustering. The linear model is fitted using the random sampling consensus algorithm to obtain the column direction angle and row direction angle. The angle is then fused and the sign is determined to generate the final rotation angle.
2. The display screen defect detection method based on morphological features and geometric calculations according to claim 1, characterized in that, The adaptive image preprocessing enhancement process for the grayscale image includes: The histogram of the grayscale image is statistically analyzed. When the effective range of the histogram does not cover the typical interval, the grayscale distribution is stretched to the target detection interval using linear or piecewise linear mapping. The grayscale image is divided into non-overlapping grid blocks, the average grayscale of each grid block is calculated, dark grid blocks with average grayscale significantly lower than the global mean are identified, and adaptive histogram equalization with limited contrast is applied to the dark grid blocks. Calculate the density distribution of high grayscale pixels in the grayscale image, adaptively determine the threshold, keep the grayscale value unchanged when the pixel grayscale value is lower than the threshold, and apply a nonlinear enhancement function when the pixel grayscale value is higher than the threshold.
3. The display screen defect detection method based on morphological features and geometric calculations according to claim 1, characterized in that, The step of binarizing the preprocessed image using multiple thresholds includes: The preprocessed image is binarized using three different thresholds to generate three sets of contours; The three sets of contours are fused by voting, and the contours that appear in at least two binarization results are retained as candidate valid contours. The candidate valid contours are subjected to shape filtering to remove contours that are too large or too small in area or have extremely irregular shapes.
4. The display screen defect detection method based on morphological features and geometric calculations according to claim 1, characterized in that, The process of fusing the initial center point and the center point of the minimum bounding rectangle to obtain the final center point includes: Calculate the centroid of the image as the initial center point; Calculate the minimum bounding rectangle of the contour and obtain its center point; The initial center point and the center point of the smallest bounding rectangle are weighted and merged, or the one that is closer to the geometric distance of the contour point set is taken as the final center point.
5. The display screen defect detection method based on morphological features and geometric calculations according to claim 1, characterized in that, The process of angle fusion and sign determination to generate the final rotation angle includes: The final set of center points is sorted by x-coordinate and column clustering is performed. A linear model is fitted using a random sampling consensus algorithm to obtain the column direction angle. The final set of center points is sorted by y-coordinate and row clustering is performed. A random sampling consensus algorithm is used to fit a straight line model to obtain the row direction angle. Compare the column direction angle and the row direction angle. If they are the same, take the average value as the final rotation angle. Otherwise, select the angle with a higher proportion of the inner point. The correct sign of the angle is determined by the monotonically increasing trend of the x-coordinate of the cluster center point with the y-coordinate.
6. The display screen defect detection method based on morphological features and geometric calculations according to claim 5, characterized in that, The intelligent mesh reconstruction and fault-tolerant analysis based on the geometric structural features includes: The image and center point coordinates are rotated and corrected using the final rotation angle. Adaptive one-dimensional clustering in the x and y directions is performed on the corrected center point coordinates to detect abnormal structures and estimate the grid cell size based on the clustering results. On the reconstructed grid, the pixel fill rate and average gray level of the region are calculated for each cell, and bad pixels are adaptively determined by combining local context information; The adaptive determination of bad pixels by combining local context information includes: For each cell, define the analysis area and calculate the pixel fill rate and the average gray level of the area; The threshold for determining bad pixels is finely adjusted based on the average brightness of good pixels in the local area where the current cell is located. If an isolated point is identified as a bad point, but its surrounding neighborhood consists of good points, then a secondary verification is initiated.
7. The display screen defect detection method based on morphological features and geometric calculations according to claim 6, characterized in that, The adaptive one-dimensional clustering of the corrected center point coordinates in the x and y directions includes: Perform x-axis and y-axis clustering on the coordinates of the center point after rotation correction to obtain column clusters and row clusters; Locations in column or row clusters where the number of center points is significantly less than in other clusters or where spacing is abnormal are marked as potentially indicating missing rows or columns. Calculate the median and mode of the spacing between adjacent columns and the row spacing, and then weight and combine them to obtain the cell width and height; For missing rows or columns of labels, linear interpolation of theoretical coordinates is performed and inserted into the clustering sequence.
8. The display screen defect detection method based on morphological features and geometric calculations according to claim 3, characterized in that, The column clustering and row clustering of the final set of centroids specifically include: Sort all center points in the final center point set according to their x-coordinate values from smallest to largest; The sorted sequence of x-coordinate values is subjected to cluster analysis based on statistical distance. The centroids with similar x-coordinate values are grouped into the same column cluster, and the average x-coordinate value of all centroids contained in each column cluster is calculated. Sort all center points in the final center point set according to their ordinate values from smallest to largest; The sorted sequence of ordinate values is subjected to cluster analysis based on statistical distance. The centroids with similar ordinate values are grouped into the same row cluster, and the average ordinate value of all centroids contained in each row cluster is calculated.
9. The display screen defect detection method based on morphological features and geometric calculations according to claim 8, characterized in that, The step of fitting the linear model using a random sampling consensus algorithm to obtain the column direction angle and row direction angle specifically includes: For each column cluster, extract the two-dimensional coordinate data of all center points within that cluster; Two non-repeating sample points are randomly selected from the two-dimensional coordinate data, and a candidate straight line model is defined by these two sample points; Calculate the distance from all other center points in the two-dimensional coordinate data to the candidate straight line model, set a distance threshold, and determine the center points whose distance is less than the threshold as the support interior points of the candidate straight line model; Repeat the above process of extracting sample points, defining candidate models, and calculating support interior points a preset number of times, and select the candidate line model that obtains the most support interior points as the best fitting line for the column family. Calculate the angle between the best-fit line and the horizontal axis of the image coordinate system, and take its absolute value as the column direction angle of the column cluster; For all column families, calculate the average of their column direction angles as the global column direction angle; The same steps are used to process each row cluster, and the global row direction angle is finally calculated.
10. The display screen defect detection method based on morphological features and geometric calculations according to claim 9, characterized in that, The process of angle fusion and sign determination to generate the final rotation angle specifically includes: Compare the absolute value of the difference between the global column direction angle and the global row direction angle; If the absolute value of the difference is less than the preset allowable deviation threshold, it is determined that the column direction angle is consistent with the row direction angle, and the arithmetic mean of the global column direction angle and the global row direction angle is used as the initial rotation angle of the undetermined sign. If the absolute value of the difference is greater than or equal to the preset allowable deviation threshold, then the proportion of interior points of the best-fit line model corresponding to the global column direction angle and the proportion of interior points of the best-fit line model corresponding to the global row direction angle are calculated respectively. The angle corresponding to the straight line model with a higher proportion of interior points is selected as the initial rotation angle for the undetermined symbol. Calculate the trend of the average abscissa value of the center point of all interior points on the best-fit straight line model corresponding to the initial rotation angle of the undetermined sign as a function of its average ordinate value. If the average abscissa value increases with the increase of the average ordinate value, then a positive sign is assigned to the initial rotation angle of the undetermined sign; If the average horizontal coordinate value decreases as the average vertical coordinate value increases, then a negative sign is assigned to the initial rotation angle of the undetermined sign. The angle value after assigning a sign is taken as the final rotation angle.