A method, apparatus, and storage medium for extracting defects in display screen images.

By using adaptive iterative threshold segmentation and dynamic array coordinate processing, combined with adaptive spatial filtering kernel matrix and grayscale morphological processing, the problem of shadow interference in the defect detection of flexible foldable screens is solved, thereby improving the detection accuracy and defect feature extraction effect.

CN120823214BActive Publication Date: 2026-03-10SHENZHEN SEICHITECH TECHN CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-18
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

Existing technologies are insufficient to effectively eliminate the problem of reduced detection accuracy caused by shadows in defect detection of new displays such as flexible foldable screens, especially the inaccurate positioning caused by folding reflection spots and microcircuit reflection spots.

Method used

The target region is determined by adaptive iterative threshold segmentation. The image segmentation accuracy is analyzed and corrected using the four endpoints of the minimum bounding rectangle. A dynamic array coordinate array is generated for shadow removal. Convolution enhancement is performed by combining an adaptive spatial filter kernel matrix. Finally, defective regions are integrated through grayscale morphology processing.

Benefits of technology

It improves the accuracy of defect detection in flexible foldable screens, reduces shadow interference, and enhances the detection effect of defect features.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120823214B_ABST
    Figure CN120823214B_ABST
Patent Text Reader

Abstract

This application discloses a method, apparatus, and storage medium for defect extraction from display screen images, aimed at reducing the decrease in defect detection accuracy caused by shadows. The method involves: acquiring a display screen image and determining the target region; performing image segmentation accuracy analysis on the display screen image; correcting the display screen image; generating four dynamic array coordinate arrays for the target region and performing shadow removal processing based on these arrays to generate a shadow-free display screen image, where the four dynamic array coordinate arrays are the final row and column arrays of the individual segmented image regions; performing interpolation calculations on the pixels in the corner regions of the shadow-free display screen image; constructing an adaptive spatial filter kernel matrix and performing convolution enhancement operations between the adaptive spatial filter kernel matrix and the shadow-free display screen image; performing threshold control processing on the shadow-free display image and integrating the defect region through grayscale morphological processing; and extracting and analyzing defect features from the shadow-free display image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of display screen inspection, and more particularly to a method, apparatus, and storage medium for extracting defects in display screen images. Background Technology

[0002] With technological innovation, new display technologies (such as MicroLED and flexible foldable screens) are rapidly reshaping the industry landscape. As a core link in the display screen industry chain, display screen quality inspection technology continues to receive attention. Accurate identification of micron-level defects on the display screen surface has become a key factor determining the yield rate of display screen products.

[0003] In the defect detection process of a display screen, after acquiring the screen image, image preprocessing is required to better display the characteristics of defects. Preprocessing steps may include filtering and noise reduction, enhancing defect contrast, and shadow removal. This application primarily focuses on shadow removal from display screen images. Shadows on display screen images are typically caused by factors such as the single directionality of auxiliary external light sources, insufficient number of external light sources, improper angles between external light sources and the screen under test, and the influence of backlights on the edges of the screen. Existing technologies typically adjust the number and brightness of light sources, as well as the angle parameters between the light sources and the screen under test, and adjust the brightness of the backlight to minimize shadows. However, with the continuous development of new display screens, simply adjusting the acquisition environment is no longer sufficient to effectively eliminate shadows. Among the new types of displays are those with complex structural designs, such as flexible foldable screens. Flexible foldable screens require separate defect detection for the foldable area, which needs to be folded at different scales. Compared to flat screens, the target area (folded area) of a flexible foldable screen changes its relative position with the external light source during the folding process, making it easy to form a reflection angle with the external light source. In addition, the folded area usually contains microcircuit modules, which can reflect some light. This causes the flexible foldable screen to form folding reflection spots and microcircuit reflection spots during defect detection. This reduces the positioning accuracy of the defect detection area of ​​the flexible foldable screen and also generates new environmental shadows on the display image. These new environmental shadows reduce the accuracy of defect detection. Summary of the Invention

[0004] This application discloses a method, apparatus, and storage medium for extracting defects from display screen images, which reduces the decrease in defect detection accuracy due to shadows.

[0005] In a first aspect, embodiments of this application provide a method for defect extraction of a display screen image, comprising: acquiring a screen image; performing adaptive iterative threshold segmentation on the screen image to determine a target region; performing image segmentation accuracy analysis on the screen image based on the four endpoints of the minimum bounding rectangle of the target region, wherein the image segmentation accuracy analysis result is used to determine the image segmentation quality of the target region in the screen image; when the image segmentation quality of the target region in the screen image meets the standard, correcting the screen image based on the four endpoints; generating four dynamic array coordinate arrays for the target region, and performing shadow removal processing based on the four dynamic array coordinate arrays to generate a shadow-removed screen image, wherein the four dynamic array coordinate arrays are the final row and column arrays of a single segmented image region to be divided; performing interpolation calculation on the pixels in the corner regions of the shadow-removed screen image; constructing an adaptive spatial filter kernel matrix, and performing convolution enhancement operation with the shadow-removed screen image through the adaptive spatial filter kernel matrix; after the convolution enhancement operation is completed, performing threshold control processing on the shadow-removed screen image, and integrating the defect region through grayscale morphological processing; and extracting and analyzing defect features from the shadow-removed screen image.

[0006] Optionally, the steps of generating four dynamic array coordinate arrays for the target region and performing shadow removal processing based on the four dynamic array coordinate arrays to generate a shadow-removed screen image include: converting the target region of the screen image to an image type and determining the row and column start coordinates; generating the second width and height dimensions of a single segmented image based on the number of segments to be segmented and the first width and height dimensions of the screen image; generating four dynamic array coordinate arrays based on the row and column start coordinates, the first width and height dimensions, the number of segments to be segmented, and the second width and height dimensions, wherein the four dynamic array coordinate arrays are the final row and column arrays of the single segmented image region to be divided; generating several minimum bounding rectangles and an overall minimum bounding rectangle based on the coordinate data of the four dynamic array coordinate arrays; calculating the gain coefficient based on the grayscale information of the several minimum bounding rectangles and the overall minimum bounding rectangle; generating an auxiliary image based on the first width and height dimensions and the gain coefficient; performing shadow filtering on the screen image after image type conversion based on the auxiliary image and the gain coefficient, and then performing image type conversion again to generate a shadow-removed screen image.

[0007] Optionally, the row and column start coordinates include the row start coordinate Start_Row and the column start coordinate Start_Col; the first width and height dimensions include the width dimension W_Size and the height dimension H_Size; the number of segments to be divided includes the number of width segments to be divided W_Num and the number of height segments to be divided H_Num; and the second width and height dimensions include the width step size W_Step and the height step size H_Step. The steps to generate four dynamic array coordinate arrays based on the row and column start coordinates, the first width and height dimensions, the number of segments to be divided, and the second width and height dimensions include: generating a first row dynamic array array Mark_R1 based on the row start coordinate Start_Row, the height dimension H_Size, and the height step size H_Step, and recording the first starting length of the first row dynamic array array Mark_R1; when the number of width segments to be divided W_Num is greater than a preset value, creating a first filling matrix Rows_M based on the first starting length; filling the values ​​in the first filling matrix Rows_M with the values ​​of the first row dynamic array array Mark_R1; and using the entire first filling matrix Rows_M as a base template, copying and creating a second filling matrix R. The code iterates through the elements of the second filling matrix `Rows_MM` and stores the values ​​in the first row of the dynamic array `Mark_R1`. It then generates the second row of the dynamic array `Mark_R2` based on the first row of `Mark_R1` and the height step size `H_Step`. A first column of the dynamic array `Mark_C1` is generated based on the column start coordinates `Start_Col`, the width size `W_Size`, and the width step size `W_Step`, and the second starting length `length` of the first column of the dynamic array `Mark_C1` is recorded. When the number of height segments to be divided `H_Num` is greater than a preset value, a third filling matrix `Cols_M` is created based on the second starting length. The values ​​in the third filling matrix `Cols_M` are then filled with the values ​​of the first column of the dynamic array. Using the third filling matrix `Cols_M` as the base template, a fourth filling matrix `Cols_MM` is created by copying it. The code iterates through the elements of the fourth filling matrix `Cols_MM` and stores the values ​​in the first column of the dynamic array `Mark_C1`. Finally, a second column of the dynamic array `Mark_C2` is generated based on the first column of the dynamic array `Mark_C1` and the width step size `W_Step`.

[0008] Optionally, after the step of generating an auxiliary image based on the first width and height dimensions and the gain coefficient, and before the step of performing shadow filtering on the screen image after image type conversion based on the auxiliary image and the gain coefficient, and then performing image type conversion to generate a shadow-free screen image, the defect extraction method further includes: performing mean filtering on the auxiliary image using a filter with a size equal to the second width and height dimensions.

[0009] Optionally, the step of interpolating the pixels in the corner areas of the deshadowed screen image includes: interpolating the pixels in the corner areas of the deshadowed screen image using a harmonic compensation algorithm.

[0010] Optionally, the steps of constructing an adaptive spatial filter kernel matrix and performing convolution enhancement operations between the adaptive spatial filter kernel matrix and the deshaded screen image include: constructing an adaptive spatial filter kernel matrix based on the enhanced contrast distance, wherein the enhanced contrast distance is determined according to the defect to be detected; and performing convolution enhancement operations between the adaptive spatial filter kernel matrix and the deshaded screen image.

[0011] Optionally, the steps for analyzing the image segmentation accuracy of the screen image based on the four endpoints of the minimum bounding rectangle of the target region include: determining the Euclidean distance and tilt angle between the endpoints of the minimum bounding rectangle of the target region; analyzing the image segmentation accuracy based on the screen image resolution, image mapping value, mapping value ratio control threshold, and Euclidean distance; if the image segmentation accuracy does not meet the preset conditions, adjusting the position of the acquisition device based on the image segmentation accuracy and tilt angle, and re-acquiring the screen image for detection until the preset conditions are met.

[0012] Optionally, when the image segmentation quality of the target region in the screen image meets the standard, the step of correcting the screen image based on the four endpoints includes: correcting the screen image based on the endpoints of the minimum bounding rectangle of the target region, the preset ideal coordinates, and the tilt angle.

[0013] Secondly, embodiments of this application provide a defect extraction device for a display screen image, comprising: a determining unit, configured to acquire a screen image, perform adaptive iterative threshold segmentation processing on the screen image, and determine a target region; a first analysis unit, configured to perform image segmentation accuracy analysis on the screen image based on the four endpoints of the minimum bounding rectangle of the target region, wherein the image segmentation accuracy analysis result is used to determine the image segmentation quality of the target region in the screen image; a correction unit, configured to correct the screen image based on the four endpoints when the image segmentation quality of the target region in the screen image meets the standard; and a generating unit, configured to generate four dynamic array coordinate arrays for the target region, and based on the four dynamic... The system employs a multi-array coordinate system to perform shadow removal processing, generating a shadow-free screen image. Four dynamic array coordinate arrays represent the final row and column arrays of the individual segmented image regions to be divided. An interpolation unit performs interpolation calculations on pixels in the corner regions of the shadow-free screen image. A convolution unit constructs an adaptive spatial filter kernel matrix and performs convolution enhancement operations with the shadow-free screen image using this matrix. An integration processing unit performs threshold control processing on the shadow-free screen image after the convolution enhancement operation and integrates defect regions through grayscale morphological processing. A second analysis unit extracts and analyzes defect features from the shadow-free screen image.

[0014] Optionally, the generation unit specifically includes: a first generation module, used to perform image type conversion on the target region of the screen image, determine the row and column start coordinates, and generate the second width and height dimensions of a single segmented image based on the number of segments to be segmented and the first width and height dimensions of the screen image; a second generation module, used to generate four dynamic array coordinate arrays based on the row and column start coordinates, the first width and height dimensions, the number of segments to be segmented, and the second width and height dimensions, wherein the four dynamic array coordinate arrays are the final row and column arrays of the single segmented image region to be divided; a third generation module, used to generate several minimum bounding rectangles and an overall minimum bounding rectangle based on the coordinate data of the four dynamic array coordinate arrays; a calculation module, used to calculate the gain coefficient based on the grayscale information of the several minimum bounding rectangles and the overall minimum bounding rectangle; a fourth generation module, used to generate an auxiliary image based on the first width and height dimensions and the gain coefficient; and a fifth generation module, used to perform shadow filtering on the screen image after image type conversion based on the auxiliary image and the gain coefficient, and then perform image type conversion again to generate a shadow-free screen image.

[0015] Optionally, the row and column start coordinates include the row start coordinate Start_Row and the column start coordinate Start_Col; the first width and height dimensions include the width dimension W_Size and the height dimension H_Size; the number of segments to be divided includes the width segment number W_Num and the height segment number H_Num; and the second width and height dimensions include the width step size W_Step and the height step size H_Step. The second generation module specifically includes: generating a first row dynamic array array Mark_R1 based on the row start coordinate Start_Row, the height dimension H_Size, and the height step size H_Step, and recording the first starting length of the first row dynamic array array Mark_R1; when the width segment number W_Num is greater than a preset value, creating a first filling matrix Rows_M based on the first starting length; filling the values ​​in the first filling matrix Rows_M with the values ​​of the first row dynamic array array Mark_R1; using the entire first filling matrix Rows_M as a base template, copying and creating a second filling matrix Rows_MM; and iterating through and obtaining the second filling matrix R... The values ​​in the elements of ows_MM are placed into the first row of the dynamic array array Mark_R1; the second row of the dynamic array array Mark_R2 is generated based on the first row of the dynamic array array Mark_R1 and the height step size H_Step; the first column of the dynamic array array is generated based on the column start coordinate Start_Col, the width size W_Size, and the width step size W_Step, and the second starting length of the first column of the dynamic array array Mark_C1 is recorded; when the number of heights to be divided H_Num is greater than the preset value, a third filling matrix Cols_M is created based on the second starting length; the values ​​in the third filling matrix Cols_M are filled with the values ​​of the first column of the dynamic array array; the fourth filling matrix Cols_MM is created by copying the entire third filling matrix Cols_M as the base template; the values ​​in the elements of the fourth filling matrix Cols_MM are traversed and placed into the first column of the dynamic array array Mark_C1; the second column of the dynamic array array Mark_C2 is generated based on the first column of the dynamic array array Mark_C1 and the width step size W_Step.

[0016] Optionally, after the fourth generation module and before the fifth generation module, the defect extraction device further includes a filtering module for performing mean filtering on the auxiliary image using a filter with a size of the second width and height dimensions.

[0017] Optionally, the interpolation unit specifically includes: performing interpolation calculations on the pixels in the corner areas of the shaded screen image using a harmonic compensation algorithm.

[0018] Optionally, the convolutional unit specifically includes: constructing an adaptive spatial filter kernel matrix based on the enhanced contrast distance, wherein the enhanced contrast distance is determined according to the defect to be detected; and performing convolution enhancement operation between the adaptive spatial filter kernel matrix and the shaded screen image.

[0019] Optionally, the first analysis unit specifically includes: determining the Euclidean distance and tilt angle between the endpoints of the smallest bounding rectangle of the target area; analyzing the image segmentation accuracy based on the screen image resolution, image mapping value, mapping value ratio control threshold, and Euclidean distance; if the image segmentation accuracy does not meet the preset conditions, adjusting the position of the acquisition device based on the image segmentation accuracy and tilt angle, and re-acquiring the screen image for detection until the preset conditions are met.

[0020] Optionally, the correction unit specifically includes: performing image correction on the screen image based on the endpoints of the minimum bounding rectangle of the target area, preset ideal coordinates, and tilt angle.

[0021] Thirdly, embodiments of this application provide a defect extraction apparatus for a display screen image, comprising:

[0022] Processor, memory, input / output units, and bus;

[0023] The processor is connected to memory, input / output units, and a bus;

[0024] The memory stores a program, which the processor calls to execute, such as the first aspect and any optional defect extraction method of the first aspect.

[0025] Fourthly, embodiments of this application provide a computer-readable storage medium on which a program is stored, which, when executed on a computer, performs the defect extraction method as described in the first aspect and any optional method of the first aspect.

[0026] As can be seen from the above technical solutions, the embodiments of this application have the following advantages:

[0027] In this application, a screen image is first acquired, and adaptive iterative threshold segmentation is performed on the screen image to determine the target region. Image segmentation accuracy analysis is then performed on the screen image based on the four endpoints of the minimum bounding rectangle of the target region. The results of this analysis determine the image segmentation quality of the target region within the screen image. When the image segmentation quality of the target region in the screen image meets the standard, the screen image is corrected based on the four endpoints. Four dynamic array coordinate arrays are generated for the target region, and shadow removal processing is performed based on these four dynamic array coordinate arrays to generate a shadow-free screen image. The four dynamic array coordinate arrays represent the final row and column arrays of the single segmented image region to be divided. Interpolation calculations are performed on the pixels in the corner regions of the shadow-free screen image. An adaptive spatial filter kernel matrix is ​​constructed, and convolution enhancement operations are performed between the adaptive spatial filter kernel matrix and the shadow-free screen image. After the convolution enhancement operation is completed, threshold control processing is performed on the shadow-free screen image, and defect regions are integrated through grayscale morphological processing. Defect features are extracted and analyzed from the shadow-free screen image.

[0028] By performing adaptive iterative threshold segmentation on the screen image, the target region to be processed can be accurately determined, reducing the amount of computation. Then, the image segmentation accuracy of the screen image is analyzed based on the four endpoints of the minimum bounding rectangle of the target region to determine whether the current screen image meets the standard. If it does not meet the standard, it needs to be readjusted. Furthermore, the screen image is corrected based on the four endpoints to minimize defects in the target region before shadow removal processing. First, four dynamic array coordinate arrays are generated for the target region, where the four dynamic array coordinate arrays are the final row and column arrays of the single segmented image region to be divided. Then, shadow removal processing is performed based on the four dynamic array coordinate arrays to generate a shadow-removed screen image. Next, the pixels in the corner areas of the shadow-removed screen image are interpolated to reduce the number of missing pixels in the corner areas. Then, an adaptive spatial filter kernel matrix is ​​constructed, and convolution enhancement operation is performed between the adaptive spatial filter kernel matrix and the shadow-removed screen image to enhance defect features and make them easier to detect. After the convolutional enhancement operation is completed, the de-shadowed screen image is subjected to threshold control processing, and the defect region is integrated through grayscale morphological processing. Finally, defect features are extracted and analyzed from the de-shadowed screen image. This method analyzes grayscale data from four different dynamic array coordinate arrays, which are the final row and column arrays of the individual segmented image regions to be divided. After analyzing these grayscale data, an auxiliary image for shadow filtering is generated, which can effectively reduce the shadows caused by folded reflection spots and microcircuit reflection spots, as well as environmental shadows, thus reducing the decrease in defect detection accuracy caused by shadows. Attached Figure Description

[0029] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0030] Figure 1 This is a schematic diagram of the first embodiment of the defect extraction method for display screen images according to this application;

[0031] Figure 2 A schematic diagram of a first embodiment of a method for generating a shaded screen image for this application;

[0032] Figure 3 A schematic diagram of a first embodiment of a method for generating four dynamic array coordinate arrays according to this application;

[0033] Figure 4 This is a schematic diagram of the first embodiment of the preprocessing method for auxiliary images in this application;

[0034] Figure 5 A schematic diagram of the first embodiment of the method for interpolating pixels in the corner region of this application;

[0035] Figure 6 This is a schematic diagram of the first embodiment of the spatial filtering kernel matrix application method of this application;

[0036] Figure 7 This is a schematic diagram of the first embodiment of the image segmentation accuracy analysis method of this application;

[0037] Figure 8 This is a schematic diagram of the first embodiment of the method for correcting screen images according to this application;

[0038] Figure 9 This is a schematic diagram of the first embodiment of the defect extraction device for display screen images according to this application;

[0039] Figure 10 This is a schematic diagram of a second embodiment of the defect extraction device for display screen images according to this application. Detailed Implementation

[0040] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application can also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.

[0041] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.

[0042] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0043] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."

[0044] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0045] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0046] In existing technologies, after acquiring the display screen image during defect detection, image preprocessing is required to better display the defect characteristics. Preprocessing steps may include filtering and noise reduction, enhancing defect contrast, and shadow removal. This application primarily addresses shadow removal in display screen images. Shadows on display screen images are typically caused by factors such as the single directionality of auxiliary external light sources, insufficient number of external light sources, improper angles between external light sources and the display screen under test, and the influence of backlights on the edges of the display screen. Existing technologies typically adjust the number and brightness of light sources, as well as the angle parameters between the light sources and the display screen under test, and adjust the brightness of the backlight to minimize shadows. However, with the continuous development of new display screens, simply adjusting the acquisition environment is no longer sufficient to effectively eliminate shadows. Among the new types of displays are those with complex structural designs, such as flexible foldable screens. Flexible foldable screens require separate defect detection for the foldable area, which needs to be folded at different scales. Compared to flat screens, the target area (folded area) of a flexible foldable screen changes its relative position with the external light source during the folding process, making it easy to form a reflection angle with the external light source. In addition, the folded area usually contains microcircuit modules, which can reflect some light. This causes the flexible foldable screen to form folding reflection spots and microcircuit reflection spots during defect detection. This reduces the positioning accuracy of the defect detection area of ​​the flexible foldable screen and also generates new environmental shadows on the display image. These new environmental shadows reduce the accuracy of defect detection.

[0047] Based on this, this application discloses a method, apparatus and storage medium for extracting defects from display screen images, which can reduce the decrease in defect detection accuracy caused by shadows.

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

[0049] The method described in this application can be applied to servers, devices, terminals, or other devices with logical processing capabilities; therefore, this application does not limit its application. For ease of description, the following description uses a terminal as the executing entity.

[0050] Please see Figure 1 This application provides an embodiment of a method for extracting defects from a display screen image, comprising:

[0051] 101. Obtain the screen image, perform adaptive iterative threshold segmentation on the screen image, and determine the target region.

[0052] In this embodiment, after installing the platform, camera, and other hardware in the intelligent manufacturing darkroom, the display product (the display screen under test) is driven and illuminated by the PG screen-dotting device to display a specific image. After controlling the position of the industrial camera and the position of the display screen under test, the display screen under test is photographed to obtain the screen image.

[0053] At this point, the terminal also needs to continuously capture and locate the captured screen image, perform adaptive iterative threshold segmentation on the screen image, and determine the target area. Specifically, this embodiment adopts an adaptive iterative threshold segmentation algorithm to effectively separate the target area from the background, as shown in the following algorithm formula:

[0054]

[0055] in, and These represent the proportions of the foreground and background regions of the screen image, respectively. and These are the average gray levels of the foreground and background regions of the image, respectively. The average gray level of the screen image is Tmax. When the parameter Tmax in the above formula reaches its maximum value, the segmentation threshold at that time is obtained.

[0056] The image region is divided using the segmentation threshold Tmax to determine the target region and background region of the screen image.

[0057] 102. Based on the four endpoints of the minimum bounding rectangle of the target region, perform image segmentation accuracy analysis on the screen image. The results of the image segmentation accuracy analysis are used to determine the image segmentation quality of the target region in the screen image.

[0058] In this embodiment, the terminal first performs image segmentation accuracy analysis on the screen image based on the four endpoints of the minimum bounding rectangle of the target area. It should be noted that the image segmentation accuracy analysis result is used to determine the image segmentation quality of the target area in the screen image. The specific accuracy segmentation steps will be described in detail in subsequent embodiments.

[0059] 103. When the image segmentation quality of the target region in the screen image meets the standard, the screen image is corrected based on the four endpoints.

[0060] When the image segmentation quality of the target region in the screen image in step 102 meets the standard, the terminal corrects the screen image based on the four endpoints. The specific correction steps will be described in detail in subsequent embodiments.

[0061] 104. Generate four dynamic array coordinate arrays for the target region, and perform shadow removal processing based on the four dynamic array coordinate arrays to generate a shadow-removed screen image. The four dynamic array coordinate arrays are the final row and column arrays of the single segmented image region to be divided.

[0062] The terminal generates four dynamic array coordinate arrays for the target area and performs shadow removal processing based on the four dynamic array coordinate arrays to generate a shadow-removed screen image. The four dynamic array coordinate arrays are the final row and column arrays of a single segmented image region to be divided. The specific steps of using the four dynamic array coordinate arrays to generate a shadow-removed screen image will be described in detail in subsequent embodiments.

[0063] 105. Perform interpolation calculations on the pixels in the corner areas of the screen image after removing the shadows.

[0064] The terminal performs interpolation calculations on the pixels in the corner areas of the screen image after the shadows have been removed. The purpose of this is to reduce the number of missing pixels in the corner areas. The specific method will be described in detail in subsequent embodiments.

[0065] 106. Construct an adaptive spatial filter kernel matrix, and perform convolution enhancement operation between the adaptive spatial filter kernel matrix and the shaded screen image.

[0066] The terminal constructs an adaptive spatial filtering kernel matrix and performs convolution enhancement operations with the shaded screen image through the adaptive spatial filtering kernel matrix to enhance the features of the defects to be detected. The specific steps will be described in detail in subsequent embodiments.

[0067] 107. After the convolution enhancement operation is completed, the screen image with the shadow removed is subjected to threshold control processing, and the defect area is integrated through grayscale morphology processing.

[0068] After the above adaptive filtering convolution, the terminal performs threshold control on the gray values ​​of suspected defective parts, and tries to connect the broken parts in the same whole defect through gray morphology closing operation.

[0069] 108. Extract and analyze defect features from the shaded screen image.

[0070] After the deshaded screen image has undergone convolution enhancement, threshold control, and grayscale morphological processing, the terminal extracts and analyzes defect features from the deshaded screen image.

[0071] After performing the above image operations, feature value analysis is performed on the obtained image. Selectable features include gray level, area, roundness, gray-level co-occurrence matrix correlation, etc. The following is the calculation method of gray-level co-occurrence matrix Con, and finally the defects on the image to be detected are obtained.

[0072]

[0073] Where T is the range of gray values ​​of the screen image after the gray-scale morphology closing operation. In fact, T is equal to the maximum gray value of the image at this time. i and j are the gray values ​​of the image. p(i,j) is the probability of gray level (i,j) appearing in a specified direction. For example, if there are gray values ​​equal to 1, 2, ..., N, then two gray values ​​(i,j) are randomly selected. i and j can be any values ​​in 1, 2, ..., N. Two numbers i and j are randomly selected, and a statistical value (this statistical value is generally a probability value) is calculated.

[0074] In this embodiment, a screen image is first acquired, and adaptive iterative threshold segmentation is performed on the screen image to determine the target region. Image segmentation accuracy analysis is then performed on the screen image based on the four endpoints of the minimum bounding rectangle of the target region. The results of this analysis determine the image segmentation quality of the target region in the screen image. When the image segmentation quality of the target region in the screen image meets the standard, the screen image is corrected based on the four endpoints. Four dynamic array coordinate arrays are generated for the target region, and shadow removal processing is performed based on these four dynamic array coordinate arrays to generate a shadow-removed screen image. The four dynamic array coordinate arrays represent the final row and column arrays of the single segmented image region to be divided. Interpolation calculations are performed on the pixels in the corner regions of the shadow-removed screen image. An adaptive spatial filter kernel matrix is ​​constructed, and convolution enhancement operations are performed between the adaptive spatial filter kernel matrix and the shadow-removed screen image. After the convolution enhancement operation is completed, threshold control processing is performed on the shadow-removed screen image, and defect regions are integrated through grayscale morphological processing. Defect features are extracted and analyzed from the shadow-removed screen image.

[0075] By performing adaptive iterative threshold segmentation on the screen image, the target region to be processed can be accurately determined, reducing the amount of computation. Then, the image segmentation accuracy of the screen image is analyzed based on the four endpoints of the minimum bounding rectangle of the target region to determine whether the current screen image meets the standard. If it does not meet the standard, it needs to be readjusted. Furthermore, the screen image is corrected based on the four endpoints to minimize defects in the target region before shadow removal processing. First, four dynamic array coordinate arrays are generated for the target region, where the four dynamic array coordinate arrays are the final row and column arrays of the single segmented image region to be divided. Then, shadow removal processing is performed based on the four dynamic array coordinate arrays to generate a shadow-removed screen image. Next, the pixels in the corner areas of the shadow-removed screen image are interpolated to reduce the number of missing pixels in the corner areas. Then, an adaptive spatial filter kernel matrix is ​​constructed, and convolution enhancement operation is performed between the adaptive spatial filter kernel matrix and the shadow-removed screen image to enhance defect features and make them easier to detect. After the convolutional enhancement operation is completed, the de-shadowed screen image is subjected to threshold control processing, and the defect region is integrated through grayscale morphological processing. Finally, defect features are extracted and analyzed from the de-shadowed screen image. This method analyzes grayscale data from four different dynamic array coordinate arrays, which are the final row and column arrays of the individual segmented image regions to be divided. After analyzing these grayscale data, an auxiliary image for shadow filtering is generated, which can effectively reduce the shadows caused by folded reflection spots and microcircuit reflection spots, as well as environmental shadows, thus reducing the decrease in defect detection accuracy caused by shadows.

[0076] Please see Figure 2 This application provides an embodiment of a method for generating a shaded screen image, comprising:

[0077] 201. Convert the target region of the screen image to an image type and determine the starting coordinates of the rows and columns. Generate the second width and height of a single segmented image based on the number of segments to be segmented and the first width and height of the screen image.

[0078] Due to external interference factors and the influence of the screen itself, there are still shadow problems after the screen image is acquired. That is, the overall display of the screen image has uneven phenomena such as the upper half being bright and the lower half being dark, or the left half being bright and the right half being dark.

[0079] To address this problem, the following algorithm is designed: First, the image data of the screen image is converted to a real number type in this embodiment. At the same time, its row and column starting coordinates are calculated as Start_Row and Start_Col, respectively.

[0080] Next, the terminal calculates the first width and height dimensions of the screen image as H_Size and W_Size, respectively. Then, it sets the number of screen image regions to be segmented, converted to real numbers, as H_Num and W_Num. Next, it divides the first width and height dimensions of the screen image by the respective number of segments to obtain the second width and height dimensions of a single segmented image as H_Step and W_Step, respectively. The second width and height dimensions include the width step size W_Step and the height step size H_Step.

[0081] 202. Generate four dynamic array coordinate arrays based on the starting coordinates of rows and columns, the first width and height dimensions, the number of segments to be divided, and the second width and height dimensions. The four dynamic array coordinate arrays are the final row and column arrays of the single segmented image region to be divided.

[0082] The terminal generates four dynamic array coordinate arrays based on the row and column start coordinates, the first width and height dimensions, the number of segments to be divided, and the second width and height dimensions. The four dynamic array coordinate arrays are the final row and column arrays of a single segmented image region to be divided. The specific method of generating the dynamic array coordinate arrays will be described in detail in subsequent embodiments.

[0083] 203. Generate several minimum bounding rectangle envelopes and the overall minimum bounding rectangle envelope based on the coordinate data of the four dynamic array coordinate arrays.

[0084] In this embodiment, the terminal extracts the coordinates of the four dynamic arrays obtained in the above steps according to their index numbers to form a Length1 group, where Length1 is the length of the array. The minimum bounding rectangle (MBR) is calculated for each coordinate in the Length1 group. Simultaneously, the overall MBR is calculated from the multiple MBRs obtained. The average grayscale of the screen image under each MBR is calculated, and the results are combined and denoted as Rel_Mean. Rel_Mean contains the average grayscale of each MBR, and the average grayscale Mean_Center of the screen image under the overall MBR is also calculated.

[0085] 204. Calculate the gain coefficient based on the grayscale information of several minimum bounding rectangles and the overall minimum bounding rectangle.

[0086] Based on the average gray level of the screen image within each minimum bounding rectangle and the average gray level Mean_Center of the screen image within the overall minimum bounding rectangle, calculate:

[0087]

[0088] Here, Gmax represents the maximum grayscale value across several screen image channels before conversion to a real number type. The number of Gmax values ​​depends on the image type: a single-channel image has only one Gmax value, a two-channel image has two values, a three-channel image has three values, and so on. Furthermore, the value of Gmax is determined by the image type: for a byte image, Gmax = 255; for a Uint2 image, Gmax = 65535. For functions that calculate the average, mean(Gmax) calculates the average of Gmax, and max(Gain) calculates the maximum value among several Gains. This indicates conversion to a real number type, where Gain is the intermediate gain parameter. This is the gain coefficient.

[0089] 205. Generate an auxiliary image based on the first width and height dimensions and the gain coefficient.

[0090] In this embodiment, the terminal pre-generates a blank, all-black image of size H_Size*W_Size and type real number, and then fills the image grayscale values ​​with a size of Gain*Gain_K to generate an auxiliary image.

[0091] 206. Based on the auxiliary image and gain coefficient, perform shadow filtering on the screen image after image type conversion, and then perform image type conversion again to generate a shadow-free screen image.

[0092] In this embodiment, the terminal multiplies the gray values ​​at corresponding positions of the original image (the screen image after image type conversion) with those of the auxiliary image one by one. The resulting new intermediate image is then divided by the gain coefficient Gain_K to obtain the screen image with the shadow removed. However, the screen image with the shadow removed at this time is of the real number image type. Finally, the real number image type is converted back to the previous data type to obtain the corrected screen image with the shadow removed.

[0093] By converting the screen image to its image type, and then generating the final row and column arrays of individual segmented image regions based on the starting row and column coordinates, the first width and height dimensions, the number of segments to be segmented, and the second width and height dimensions, the method determines the corresponding minimum bounding rectangle (MBR) in the image using a dynamic array coordinate array. The overall MBR is then determined using the MBR, and the gain coefficient for shadow removal is calculated using the grayscale information of both the MBR and the overall MBR. Next, an auxiliary image for shadow removal is generated using the gain coefficient. This auxiliary image is then used to complete the shadow removal process on the screen image, followed by feature extraction and analysis. This method, which analyzes the grayscale data collected for different envelopes to generate the auxiliary image for shadow filtering, effectively reduces shadows caused by folded reflective spots and microcircuit reflective spots, as well as environmental shadows, thus minimizing the reduction in defect detection accuracy due to shadows.

[0094] Please see Figure 3 This application provides an embodiment of a method for generating four dynamic array coordinate arrays. The row and column start coordinates include the row start coordinate Start_Row and the column start coordinate Start_Col. The first width and height dimensions include the width dimension W_Size and the height dimension H_Size. The number of segments to be divided includes the width segment number W_Num and the height segment number H_Num. The second width and height dimensions include the width step size W_Step and the height step size H_Step. The method includes:

[0095] 301. Generate the first row dynamic array array Mark_R1 based on the row start coordinate Start_Row, height size H_Size and height step size H_Step, and record the first starting length of the first row dynamic array array Mark_R1.

[0096] In this embodiment, the terminal pre-sets four sets of dynamic array coordinate arrays, denoted as Mark_R1, Mark_C1, Mark_R2, and Mark_C2, which are the final row and column arrays of the single image region to be divided.

[0097] This embodiment describes the generation of the first row of dynamic array array Mark_R1 and the second row of dynamic array array Mark_R2.

[0098] First, starting from the row coordinate Start_Row and ending at the height size H_Size, the step size is selected as the height step size H_Step, which can be abbreviated as Mark_R1=[Start_Row:H_Step:H_Size-1]. The array length of the first row dynamic array Mark_R1 is recorded as length.

[0099] 302. When the number of widths to be divided, W_Num, is greater than the preset value, create the first filling matrix Rows_M based on the first starting length.

[0100] Next, when the number of widths to be divided, W_Num, is greater than 1, a matrix Rows_M (the first filling matrix Rows_M) with a length*1 (length rows, 1 column) is created based on the first starting length.

[0101] 303. Fill the values ​​in the first filling matrix Rows_M with the values ​​of the first row of the dynamic array Mark_R1.

[0102] Next, the terminal fills the values ​​in the first filling matrix Rows_M with the values ​​of the first row of the dynamic array Mark_R1.

[0103] 304. Using the first filling matrix Rows_M as the overall template, copy and create the second filling matrix Rows_MM.

[0104] Then, the terminal uses the first filling matrix Rows_M as the overall template to copy and create a second filling matrix Rows_MM with 1*W_Num (1 row, W_Num column).

[0105] 305. Iterate through the elements of the second filling matrix Rows_MM and put them into the first row of the dynamic array array Mark_R1.

[0106] Finally, the terminal iterates through the elements of the second filling matrix Rows_MM and puts them into the first row of the dynamic array Mark_R1, calculating the array length as Length1. Length1 is the length of the final array coordinates, and subsequently, Length1 rectangular bounding boxes will be generated.

[0107] 306. Generate the second row of dynamic array array Mark_R2 based on the first row of dynamic array array Mark_R1 and the height step size H_Step.

[0108] Next, the second row of the dynamic array array Mark_R2 is calculated by adding (H_Step-1) to each value in the first row of the dynamic array array Mark_R1. The calculation method is as follows:

[0109] Mark_R2 = Mark_R1 + H_Step-1

[0110] 307. Generate the first column dynamic array array based on the column start coordinate Start_Col, width size W_Size, and width step size W_Step, and record the second starting length of the first column dynamic array array Mark_C1.

[0111] 308. When the number of heights to be divided, H_Num, is greater than the preset value, a third filling matrix, Cols_M, is created based on the second starting length.

[0112] 309. Fill the values ​​in the third filling matrix Cols_M with the values ​​of the first column of the dynamic array array.

[0113] 310. Using the third filling matrix Cols_M as the overall template, copy and create the resulting fourth filling matrix Cols_MM.

[0114] 311. Iterate through the elements of the fourth filling matrix Cols_MM and put them into the first column of the dynamic array array Mark_C1.

[0115] 312. Generate the second dynamic array array Mark_C2 based on the first column dynamic array array Mark_C1 and the width step size W_Step.

[0116] Similarly, the calculation of the first column dynamic array array Mark_C1 and the second column dynamic array array Mark_C2 is the same as that of Mark_R1 and Mark_R2, respectively, and will not be elaborated here.

[0117] Please see Figure 4 This application provides an embodiment of an auxiliary image preprocessing method, comprising:

[0118] 401. Apply mean filtering to the auxiliary image using a filter with the second width and height dimensions.

[0119] In this embodiment, after the auxiliary image is generated, mean filtering is also required. Specifically, a filter of size H_Step*W_Step is used to perform mean filtering on the image. At the same time, it is important to ensure that the size of the filter is an odd number.

[0120] Please see Figure 5 This application provides an embodiment of a method for interpolating pixels in corner regions, comprising:

[0121] 501. The pixel points in the corner area of ​​the screen image after the shadow has been removed are interpolated using the harmonic compensation algorithm.

[0122] In this embodiment, after the terminal performs shadow correction, it also needs to interpolate the pixel values ​​in the corner areas of the shadow-corrected screen image using a harmonic compensation algorithm. Because the corner edges of an image are often filled using methods such as constant filling, mirroring, or cyclic symmetry, these methods are not ideal for the corner processing of the screen image in subsequent convolution filtering algorithms, especially for new types of displays (flexible folding screens). Therefore, this embodiment proposes a harmonic compensation algorithm to interpolate the pixel values ​​in the corner areas. This area will be smoothly filled and will transition naturally with the surrounding areas. That is, the image pixel values ​​in the corner areas satisfy the second derivative of Laplacian's equation being 0, i.e., satisfying the following equation:

[0123]

[0124] Where u is the screen image function equation. This is the Laplacian operator, where Ω is the specified region (internal point) of the corner, ∂(Ω) is the boundary between the corner region and the normal region of the original image, and f is the known pixel gray value on the boundary. By solving this equation, the interpolation u of all points within the corner region Ω can be obtained.

[0125] Please see Figure 6 This application provides an embodiment of a method for using a spatial filtering kernel matrix, including:

[0126] 601. Construct an adaptive spatial filtering kernel matrix based on the enhanced contrast distance, which is determined according to the defect to be detected.

[0127] 602. Perform convolution enhancement operation between the adaptive spatial filtering kernel matrix and the shaded screen image.

[0128] To inspect the screen image after shadow removal, an adaptive spatial filtering kernel matrix is ​​first constructed. This operator can generate different kernel factors according to the set defect type. It automatically changes its layer number and value to meet different needs for detecting different defect sizes and strengths. The purpose is to highlight the location of areas with large differences in pixel gray values ​​from those in a certain neighborhood, while minimizing the elimination of areas with similar gray values ​​to those in the neighborhood. The adaptive spatial filtering kernel matrix is ​​as follows:

[0129]

[0130] Here, N represents the enhancement contrast distance, which is the size setting of the defect to be detected. By automatically setting different enhancement distances, different kernel factors are formed to detect different defect types. By performing convolution operations between this adaptive filtering kernel matrix and the image, suspected defects in the screen image can be significantly enhanced, while non-defective background parts are weakened. The method for setting the enhancement contrast distance needs to be combined with the area threshold of different defects.

[0131] Please see Figure 7 This application provides an embodiment of a method for image segmentation accuracy analysis, comprising:

[0132] 701. Determine the Euclidean distance and tilt angle between the endpoints of the smallest bounding rectangle in the target area.

[0133] 702. Analyze the image segmentation accuracy based on the screen image resolution, image mapping value, mapping value ratio control threshold, and Euclidean distance.

[0134] 703. If the image segmentation accuracy does not meet the preset conditions, adjust the position of the acquisition device by adjusting the image segmentation accuracy and tilt angle, and re-acquire the screen image for detection until the preset conditions are met.

[0135] In this embodiment, to further prevent interference from other factors from causing deviations in the adaptive segmentation algorithm in step 101, the terminal calculates the minimum bounding rectangle of the extracted target region and measures the Euclidean distance between the four endpoints. (i=1,2,3,4) and tilt angle Q, assuming the screen image resolutions are cell_x and cell_y, the product of the screen image resolutions cell_x and cell_y and the image mapping value is denoted as... and Then we have:

[0136]

[0137]

[0138] Where S is the image mapping ratio control threshold (mapping value ratio control threshold).

[0139] If the expression exceeds the mapping value ratio control threshold, it indicates that the current screen image segmentation is abnormal. The algorithm sends a specified code to the software to control the motor axis to move in the Z-axis direction, and at the same time, it re-takes pictures and executes the above process until the above algorithm expression condition is met.

[0140] In this embodiment, the display screen under test is a flexible foldable screen. The foldable area of ​​this flexible foldable screen contains a microcircuit region. That is, the novel display screen targeted in this embodiment is a fusion of the foldable screen structure and the microcircuit layer. The display screen under test is folded to a predetermined degree during the acquisition of the screen image. The folded area is the target area to be detected, while the undisturbed part is uniformly determined as the background area. Defect detection is performed separately on the folded area.

[0141] Shadows appearing on the folded area are typically caused by the fact that during folding, the flexible display's folded area stretches, allowing some backlight light to pass through, while the microcircuit area reflects some external light. Furthermore, because each part of the folded area has different distances and angles relative to both the external and backlight sources, especially the angles, and photography is usually done perpendicularly, light spots are more likely to appear, and shadows are more likely to affect the edge areas (the edges of the folded area), leading to inaccurate edge positioning. However, since the flexible display folds with a fixed curvature, the edges of the folded area have the same curvature, resulting in a uniform effect from external light. This allows for improved edge positioning by calculating a mapping value ratio and controlling the threshold.

[0142] In this embodiment, the formula for calculating the proportional control threshold REPCT is as follows:

[0143]

[0144] Here, SSIM stands for Structural Similarity, which indicates the structural similarity between the segmentation result and the ideal template. For regional area deviation, This refers to the degree of relative deviation between the segmented region area and the ideal area. ECI stands for Edge Consistency Index; in this embodiment, ECI represents the degree of matching between edge pixels and reflectance features in the screen image. REI stands for Reflectance Edge Index; REI represents the degree of preservation of reflectance features in the edge region.

[0145] Please see Figure 8 This application provides an embodiment of a method for correcting screen images, comprising:

[0146] 801. Perform image correction on the screen image based on the endpoints of the minimum bounding rectangle of the target area, the preset ideal coordinates, and the tilt angle.

[0147] In this embodiment, after the terminal obtains a screen image that meets the image segmentation accuracy, it also needs to perform certain image corrections to solve the problem of screen tilt. Specifically, the terminal performs point-to-point mapping between the four endpoints calculated in step 501 and the preset ideal coordinates to obtain a homogeneous matrix, thereby correcting the tilted and rotated screen image.

[0148] Please see Figure 9 This application provides an embodiment of a defect extraction device for display screen images, comprising:

[0149] The determination unit 901 is used to acquire the screen image, perform adaptive iterative threshold segmentation on the screen image, and determine the target region.

[0150] The first analysis unit 902 is used to perform image segmentation accuracy analysis on the screen image based on the four endpoints of the minimum bounding rectangle of the target region. The image segmentation accuracy analysis results are used to determine the image segmentation quality of the target region in the screen image.

[0151] Optionally, the first analysis unit 902 specifically includes:

[0152] Determine the Euclidean distance and tilt angle between the endpoints of the smallest bounding rectangle in the target region.

[0153] The image segmentation accuracy is analyzed based on the screen image resolution, image mapping value, mapping value ratio control threshold, and Euclidean distance.

[0154] If the image segmentation accuracy does not meet the preset conditions, the position of the acquisition device is adjusted based on the image segmentation accuracy and tilt angle, and the screen image is re-acquired for detection until the preset conditions are met.

[0155] The correction unit 903 is used to correct the screen image based on the four endpoints when the image segmentation quality of the target region in the screen image meets the standard.

[0156] Optionally, the correction unit 903 specifically includes:

[0157] Image correction is performed on the screen image based on the endpoints of the minimum bounding rectangle of the target area, the preset ideal coordinates, and the tilt angle.

[0158] The generation unit 904 is used to generate four dynamic array coordinate arrays for the target region, and to perform shadow removal processing based on the four dynamic array coordinate arrays to generate a shadow-removed screen image. The four dynamic array coordinate arrays are the final row and column arrays of the single segmented image region to be divided.

[0159] Optionally, the generation unit 904 specifically includes:

[0160] The first generation module is used to convert the target region of the screen image into an image type, determine the starting coordinates of the rows and columns, and generate the second width and height dimensions of a single segmented image based on the number of segments to be segmented and the first width and height dimensions of the screen image.

[0161] The second generation module is used to generate four dynamic array coordinate arrays based on the row and column start coordinates, the first width and height dimensions, the number of segments to be divided, and the second width and height dimensions. The four dynamic array coordinate arrays are the final row and column arrays of a single segmented image region to be divided.

[0162] Optionally, the row and column start coordinates include the row start coordinate Start_Row and the column start coordinate Start_Col, the first width and height dimensions include the width dimension W_Size and the height dimension H_Size, the number of segments to be divided includes the width segment number W_Num and the height segment number H_Num, and the second width and height dimensions include the width step size W_Step and the height step size H_Step.

[0163] The second generation module specifically includes:

[0164] Generate the first row dynamic array array Mark_R1 based on the row start coordinate Start_Row, height size H_Size, and height step size H_Step, and record the first starting length of the first row dynamic array array Mark_R1.

[0165] When the number of widths to be divided, W_Num, is greater than the preset value, the first filling matrix, Rows_M, is created based on the first starting length.

[0166] Fill the values ​​in the first filling matrix Rows_M with the values ​​of the first row of the dynamic array Mark_R1.

[0167] The second filling matrix, Rows_MM, is created by copying the entire first filling matrix Rows_M as the base template.

[0168] Iterate through the elements of the second filling matrix Rows_MM and put them into the first row of the dynamic array Mark_R1.

[0169] The second dynamic array array Mark_R2 is generated based on the first row of dynamic array array Mark_R1 and the height step size H_Step.

[0170] Generate the first column dynamic array array based on the column start coordinate Start_Col, width size W_Size, and width step size W_Step, and record the second starting length of the first column dynamic array array Mark_C1.

[0171] When the number of heights to be divided, H_Num, is greater than the preset value, a third filling matrix, Cols_M, is created based on the second starting length.

[0172] Fill the values ​​in the third filling matrix Cols_M with the values ​​of the first column of the dynamic array array.

[0173] Using the third filling matrix Cols_M as the overall template, the fourth filling matrix Cols_MM is created by copying it.

[0174] Iterate through the elements of the fourth filling matrix Cols_MM and put them into the first column of the dynamic array Mark_C1.

[0175] The second dynamic array array Mark_C2 is generated based on the first column dynamic array array Mark_C1 and the width step size W_Step.

[0176] The third generation module is used to generate several minimum bounding rectangles and the overall minimum bounding rectangle based on the coordinate data of the four dynamic array coordinate arrays.

[0177] The calculation module is used to calculate the gain coefficient based on the grayscale information of several minimum bounding rectangles and the overall minimum bounding rectangle.

[0178] The fourth generation module is used to generate an auxiliary image based on the first width and height dimensions and the gain coefficient.

[0179] The filtering module is used to perform mean filtering on the auxiliary image using a filter with a size equal to the second width and height.

[0180] The fifth generation module is used to filter out shadows from the screen image after image type conversion based on the auxiliary image and gain coefficient, and then perform image type conversion to generate a shadow-free screen image.

[0181] The interpolation unit 905 performs interpolation calculations on the pixels in the corner areas of the de-shadowed screen image.

[0182] Optionally, the interpolation unit 905 specifically includes:

[0183] The harmonic compensation algorithm is used to interpolate the pixels in the corner areas of the screen image after the shadows have been removed.

[0184] Convolutional unit 906 is used to construct an adaptive spatial filter kernel matrix and perform convolution enhancement operations with the shaded screen image through the adaptive spatial filter kernel matrix.

[0185] Optionally, convolutional unit 906 specifically includes:

[0186] An adaptive spatial filtering kernel matrix is ​​constructed based on the enhanced contrast distance, which is determined according to the defect to be detected.

[0187] Enhancement operations are performed by convolution with the shaded screen image using an adaptive spatial filtering kernel matrix.

[0188] The integration processing unit 907 is used to perform threshold control processing on the screen image after the convolution enhancement operation is completed, and to integrate the defect area through grayscale morphology processing.

[0189] The second analysis unit 908 is used to extract and analyze defect features from the shaded screen image.

[0190] Please see Figure 10 This application provides a defect extraction device for display screen images, comprising:

[0191] Processor 1001, memory 1002, input / output unit 1003 and bus 1004.

[0192] The processor 1001 is connected to the memory 1002, the input / output unit 1003, and the bus 1004.

[0193] The memory 1002 stores a program, and the processor 1001 calls the program to execute it, such as... Figure 1 , Figure 2 and Figure 3 , Figure 4 , Figure 5 , Figure 6 , Figure 7 and Figure 8 Defect extraction methods in [the context of the text].

[0194] This application provides a computer-readable storage medium on which a program is stored, and when the program is executed on a computer, it performs the following... Figure 1 , Figure 2 and Figure 3 , Figure 4 , Figure 5 , Figure 6 , Figure 7 and Figure 8 Defect extraction methods in [the context of the text].

[0195] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0196] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between apparatuses or units through some interfaces, and may be electrical, mechanical, or other forms.

[0197] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0198] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0199] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

Claims

1. A method of defect extraction of a display panel image, characterized by, The method comprises the following steps: acquiring a screen image, performing adaptive iterative threshold segmentation processing on the screen image to determine a target region; performing image segmentation accuracy analysis on the screen image according to four end points of the minimum bounding rectangle of the target region, and using the image segmentation accuracy analysis result to determine the image segmentation quality of the target region in the screen image; when the image segmentation quality of the target region in the screen image meets the standard, correcting the screen image according to the four end points; generating four dynamic array coordinate arrays for the target region, and performing shadow removal processing on the screen image according to the four dynamic array coordinate arrays to generate a screen image with shadows removed, wherein the four dynamic array coordinate arrays are the terminal row and column arrays of a single divided image region to be divided; performing interpolation calculation on the pixel points of the edge corner region of the screen image with shadows removed; constructing an adaptive spatial filter kernel matrix, and performing convolution enhancement operation on the screen image with shadows removed through the adaptive spatial filter kernel matrix; after the convolution enhancement operation is completed, performing threshold control processing on the screen image with shadows removed, and integrating the defect region through gray-scale morphological processing; performing defect feature extraction and analysis on the screen image with shadows removed.

2. The defect extraction method according to claim 1, wherein The step of generating four dynamic array coordinate arrays for the target region and performing shadow removal processing on the screen image according to the four dynamic array coordinate arrays to generate a screen image with shadows removed comprises the following steps: performing image type conversion on the target region of the screen image, and determining the starting coordinates of rows and columns, generating the second width and height dimensions of a single divided image according to the number of divisions to be made and the first width and height dimensions of the screen image; generating four dynamic array coordinate arrays according to the starting coordinates of rows and columns, the first width and height dimensions, the number of divisions to be made, and the second width and height dimensions, wherein the four dynamic array coordinate arrays are the terminal row and column arrays of a single divided image region to be divided; generating a plurality of minimum bounding rectangle envelope boxes and an overall minimum bounding rectangle envelope box according to the coordinate data of the four dynamic array coordinate arrays; calculating a gain coefficient according to the gray-scale information of the plurality of minimum bounding rectangle envelope boxes and the overall minimum bounding rectangle envelope box; generating an auxiliary image according to the first width and height dimensions and the gain coefficient; removing shadows from the screen image after image type conversion according to the auxiliary image and the gain coefficient, and then performing image type conversion to generate a screen image with shadows removed.

3. The defect extraction method according to claim 2, wherein, The starting coordinates of rows and columns comprise a row starting coordinate Start_Row and a column starting coordinate Start_Col, the first width and height dimensions comprise a width dimension W_Size and a height dimension H_Size, the number of divisions to be made comprises a width division number W_Num and a height division number H_Num, and the second width and height dimensions comprise a width step size W_Step and a height step size H_Step. The step of generating four dynamic array coordinate arrays according to the starting coordinates of rows and columns, the first width and height dimensions, the number of divisions to be made, and the second width and height dimensions comprises the following steps: Generating a first dynamic array Mark_R1 according to the row start coordinate Start_Row, the height size H_Size, and the height step size H_Step, and recording a first start length length of the first dynamic array Mark_R1; When the width to be segmented number W_Num is greater than a preset value, creating a first filling matrix Rows_M according to the first start length length; Filling values in the first filling matrix Rows_M as values of the first dynamic array Mark_R1; Taking the first filling matrix Rows_M as a whole as a basic template, creating a second filling matrix Rows_MM by copying; Putting values in elements of the second filling matrix Rows_MM into the first dynamic array Mark_R1 by traversal; Generating a second dynamic array Mark_R2 according to the first dynamic array Mark_R1 and the height step size H_Step; Generating a first column dynamic array Mark_C1 according to the column start coordinate Start_Col, the width size W_Size, and the width step size W_Step, and recording a second start length length of the first column dynamic array Mark_C1; When the height to be segmented number H_Num is greater than a preset value, creating a third filling matrix Cols_M according to the second start length length; Filling values in the third filling matrix Cols_M as values of the first column dynamic array Mark_C1; Taking the third filling matrix Cols_M as a whole as a basic template, creating a fourth filling matrix Cols_MM by copying; Putting values in elements of the fourth filling matrix Cols_MM into the first column dynamic array Mark_C1 by traversal; Generating a second column dynamic array Mark_C2 according to the first column dynamic array Mark_C1 and the width step size W_Step.

4. The defect extraction method as claimed in claim 2, wherein, After the step of generating an auxiliary image according to the first width and height size and the gain coefficient, and before the step of generating a screen body image without shadow by performing image type conversion on the screen body image after shadow filtering, the defect extraction method further comprises: Performing mean filtering on the auxiliary image using a filter with a second width and height size.

5. The defect extraction method according to any one of claims 1 to 4, characterized in that, The step of performing interpolation calculation on the pixel points of the corner area of the screen body image without shadow comprises: Performing interpolation calculation on the pixel points of the corner area of the screen body image without shadow by a harmonic compensation algorithm.

6. The defect extraction method according to any one of claims 1 to 4, wherein, The step of constructing an adaptive spatial filter kernel matrix and performing convolution enhancement operation on the screen body image without shadow by the adaptive spatial filter kernel matrix comprises: Constructing an adaptive spatial filter kernel matrix according to a reinforced contrast distance, wherein the reinforced contrast distance is determined according to the to-be-detected defect; Performing convolution enhancement operation on the screen body image without shadow by the adaptive spatial filter kernel matrix.

7. The defect extraction method according to any one of claims 1 to 4, wherein, The step of performing image segmentation accuracy analysis on the screen body image according to the four end points of the minimum circumscribed rectangle of the target region comprises: Determining the Euclidean distance and the tilt angle between the end points of the minimum circumscribed rectangle on the target region; According to the screen body image resolution, the image mapping value, the mapping value proportion control threshold and the Euclidean distance, the image segmentation accuracy is analyzed; When the image segmentation accuracy does not meet the preset condition, the position of the acquisition device is adjusted through the image segmentation accuracy and the tilt angle, and the screen body image is re-acquired for detection until the preset condition is met.

8. The defect extraction method of claim 7, wherein, When the image segmentation quality of the target region in the screen body image meets the standard, the step of correcting the screen body image according to the four end points comprises: According to the end points of the minimum circumscribed rectangle of the target region, the preset ideal coordinates and the tilt angle, the screen body image is corrected.

9. An apparatus for extracting defects of a display panel image, characterized by comprising: Comprise: The determination unit is used for acquiring a screen body image, performing adaptive iterative threshold segmentation processing on the screen body image, and determining a target region; The first analysis unit is used for performing image segmentation accuracy analysis on the screen body image according to the four end points of the minimum circumscribed rectangle of the target region, and the image segmentation accuracy analysis result is used for determining the image segmentation quality of the target region in the screen body image; The correction unit is used for correcting the screen body image according to the four end points when the image segmentation quality of the target region in the screen body image meets the standard; The generation unit is used for generating four dynamic array coordinate arrays for the target region, and performing shadow removal processing according to the four dynamic array coordinate arrays to generate a screen body image after shadow removal, wherein the four dynamic array coordinate arrays are terminal row and column arrays of a single partition image region to be divided; The interpolation unit performs interpolation calculation on the pixel points of the edge corner region of the screen body image after shadow removal; The convolution unit is used for constructing an adaptive spatial filter kernel matrix, and performing convolution enhancement operation on the screen body image after shadow removal through the adaptive spatial filter kernel matrix; The integration processing unit is used for performing threshold control processing on the screen body image after shadow removal after the convolution enhancement operation is completed, and integrating the defect region through gray scale morphological processing; The second analysis unit is used for extracting and analyzing the defect features of the screen body image after shadow removal.

10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a program, and the program performs the defect extraction method according to any one of claims 1 to 8 when executed on the computer.

Citation Information

Patent Citations

  • Display screen repeated defect detection method and device and storage medium

    CN119444754A

  • Image defect detection method and device and storage medium

    CN120339289A