Screen image sharpening method and device based on multi-scale attention, and storage medium
By employing a multi-scale attention-based screen image sharpening method, the problem of balancing dark details and overall brightness structure in existing technologies is solved, enabling effective capture of multi-scale defects and noise suppression, thereby improving the accuracy of display defect detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-21
- Publication Date
- 2026-07-14
AI Technical Summary
Existing screen image sharpening methods cannot effectively balance dark details and overall brightness structure, resulting in the loss of weak contrast information. Furthermore, single-scale sharpening models are difficult to capture multi-scale screen defects, and noise is easily amplified, reducing the accuracy of display defect detection.
A screen image sharpening method based on multi-scale attention is adopted. It generates two-dimensional sharpening weights by extracting multi-scale feature layers, gray-scale differences and spatial distribution attention weights, performs feature enhancement and adaptive weight allocation, generates multi-scale fusion feature maps, and finally generates sharpened images through deconvolution layer processing.
It improves the accuracy of display defect detection, enhances the visibility of defects in low-brightness areas, prevents noise from being falsely amplified, and avoids over-sharpening of bright areas, adapting to different brightness uniformity and display panel imaging differences.
Smart Images

Figure CN122066608B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of display screen inspection, and in particular to a screen image sharpening method and apparatus, and storage medium based on multi-scale attention. Background Technology
[0002] With technological innovation, new display technologies are constantly being updated and iterated. As a core link in the display industry chain, display quality inspection technology continues to receive attention, especially the defect detection of micron-level pixels on the display surface, which has become a key factor determining the quality of display products.
[0003] The pixel precision of new displays is gradually increasing, and the arrangement of pixels is becoming more and more precise and complex. This makes it easy for defects of different scales to appear in the automatic optical inspection of new displays (such as OLED, Micro-LED, flexible foldable screens, etc.), such as bright spots, dark spots, dead pixels, line defects, dark spots, color shift areas, and dot matrix abnormalities. However, due to the uneven distribution of screen brightness, differences in response characteristics, and the extremely low light intensity in the dark areas, many defects have extremely low contrast, and small dot matrix defects are almost invisible in the dark areas.
[0004] Among existing sharpening methods, Unsharp Mask (USM) sharpening is insufficient for enhancing weak defects on the display, but significantly enhances noise. Laplacian sharpening, while sensitive to brightness gradients, offers almost no enhancement for small defects in dark areas and is unstable in high-noise regions. Depth sharpening methods based on single-scale convolution cannot simultaneously capture both dark details and overall brightness structure, resulting in the loss of weak contrast information. High-contrast filtering sharpening suffers from insufficient local frame construction and cannot effectively handle weak pixel-like anomalies. Furthermore, the lack of semantic guidance and failure to consider the semantic requirements of screen detection (prioritizing the preservation of pixel array edges and defect region textures) leads to poor compatibility between the sharpening results and subsequent defect detection algorithms, resulting in decreased detection accuracy.
[0005] Furthermore, the new screen defects have multi-scale characteristics, making it difficult for a single-scale sharpening model to simultaneously capture the edges of tiny defects and the contours of large-area display unevenness. Secondly, noise (such as photosensitive noise and display response noise) is easily amplified, which makes it impossible for images after conventional sharpening to effectively capture different defects, thereby reducing the accuracy of display defect detection. Summary of the Invention
[0006] This application discloses a screen image sharpening method and apparatus based on multi-scale attention, as well as a readable storage medium, for improving the accuracy of display screen defect detection.
[0007] In a first aspect, embodiments of this application provide a screen image sharpening method based on multi-scale attention, comprising:
[0008] The screen to be tested is captured to generate a test image;
[0009] Multi-scale feature layer extraction is performed on the detected image in the effective display area to obtain a multi-scale feature map set, which includes several scale feature maps divided according to different predefined feature size standards.
[0010] Extract pixel information from the effective display area of the detected image, and generate grayscale difference attention weights for each pixel based on the pixel information;
[0011] Determine the distance weight of each pixel within the effective display area, and generate spatial distribution attention weights by combining the local grayscale variance of the local area where the pixel is located. The distance weight represents the degree of distance between each pixel and the center coordinates of the effective display area.
[0012] Two-dimensional sharpening weights are generated based on grayscale difference attention weights and spatial distribution attention weights;
[0013] Based on the two-dimensional sharpening weights, feature enhancement processing is performed on the multi-scale feature map set to generate a multi-scale enhanced feature map set.
[0014] An adaptive weight allocation process is performed on the features at each scale in the multi-scale enhanced feature map set to obtain a multi-scale fused feature map set.
[0015] By processing the multi-scale fused feature map set through deconvolution layers, a sharpened image of the effective display area is generated.
[0016] Optionally, pixel information includes grayscale mean and grayscale standard deviation;
[0017] The steps of extracting pixel information from the effective display area of the detected image and generating grayscale difference attention weights for each pixel based on the pixel information specifically include:
[0018] Calculate the mean and standard deviation of gray levels in the effective display area of the detected image;
[0019] The grayscale mean and grayscale standard deviation are used to generate a point-domain grayscale difference coefficient for each pixel in the effective display area;
[0020] Based on the point-domain grayscale difference coefficient, a grayscale difference attention weight is generated for each pixel in the effective display area.
[0021] Optionally, the steps of determining the distance weight of each pixel within the effective display area and generating spatial distribution attention weights by combining the local grayscale variance of the local region where the pixel is located specifically include:
[0022] A distance weight is generated for each pixel within the effective display area based on the center coordinates and diagonal distance of the effective display area.
[0023] The defect density coefficient is generated based on the local gray-level variance of the local area where the pixel is located. The defect density coefficient represents the density of abrupt changes in the gray-level values of the pixels in that local area.
[0024] Spatial distribution attention weights are generated for each pixel within the effective display area based on the defect density coefficient and distance weight.
[0025] Optionally, the screen under test is a display screen with a functional circuit layer having a reflective area inside the pixel layer;
[0026] The steps for generating the defect density coefficient based on the local grayscale variance of the local region where the pixel is located specifically include:
[0027] Obtain the global maximum gradient energy and global maximum local variance of the effective display area;
[0028] A set of local gradient energy is generated based on the gradient parameters of each pixel in the effective display area;
[0029] Calculate the reflection suppression weight for each pixel in the effective display area based on the global maximum gradient energy, the suppression intensity parameter, and the local gradient energy set;
[0030] The defect density coefficient is calculated based on the global maximum local variance and the reflection suppression weight.
[0031] Optionally, the steps of adaptively assigning weights to the features at each scale in the multi-scale enhanced feature map set to obtain the multi-scale fused feature map set specifically include:
[0032] The scale priority weight is generated based on the defect scale-yield index of the screen under test. The defect scale-yield index represents the degree of impact of defects of different scales on the yield of the screen under test.
[0033] Defect distribution density weights are generated based on the defect frequency index of the screen under test. The defect frequency index represents the frequency of occurrence of defects of different scales in the production process of the corresponding type of display screen under test.
[0034] Defect difference weights are generated based on the defect-background difference index of the screen under test. The defect-background difference index represents the difficulty of identifying defects of different scales on the screen under test.
[0035] Multi-scale fusion weights are generated based on scale priority weights, defect distribution density weights, and defect difference weights.
[0036] Based on the multi-scale fusion weights, feature fusion processing is performed on N feature maps of different scales in the multi-scale enhanced feature set to generate a multi-scale fused feature map set.
[0037] Optionally, after the step of processing the multi-scale fused feature map set through deconvolution layers to generate a sharpened image of the effective display area, the screen image sharpening method further includes:
[0038] Determine the border and background areas of the image to be sharpened;
[0039] Low-pass filtering is applied to the border area and the background area.
[0040] Optionally, the step of extracting multi-scale feature maps from the detected image within the effective display area to obtain a multi-scale feature map set specifically includes:
[0041] The detected image is input into a preset screen semantic segmentation model to generate an effective display area mask;
[0042] A multi-scale feature extraction network is constructed, and the effective display region mask and detection image are input into the multi-scale feature extraction network;
[0043] The effective display area of the detected image is determined by a multi-scale feature extraction network, and multi-scale defect features are extracted from the effective display area to generate a set of several scale feature maps divided according to different predefined feature size standards.
[0044] Batch normalization is performed on each scale feature map in the multi-scale feature map set.
[0045] Optionally, after the step of acquiring an image of the screen to be tested and generating a detection image, and before the step of extracting multi-scale feature layers from the detection image in the effective display area to obtain a multi-scale feature map set, the screen image sharpening method further includes:
[0046] The pixels of the detected image are normalized.
[0047] The normalized detection image is subjected to median filtering for noise reduction.
[0048] Secondly, embodiments of this application provide a screen image sharpening device based on multi-scale attention, comprising:
[0049] The image acquisition unit is used to acquire images of the screen under test and generate a test image.
[0050] The multi-scale feature extraction unit is used to extract multi-scale features from the detection image in the effective display area and obtain a set of multi-scale feature maps. The set of multi-scale feature maps includes several scale feature maps divided according to different predefined feature size standards.
[0051] The grayscale difference attention weight generation unit is used to extract pixel information in the effective display area of the detected image and generate grayscale difference attention weights for each pixel based on the pixel information.
[0052] The spatial distribution attention weight generation unit is used to determine the distance weight of each pixel within the effective display area, and to generate spatial distribution attention weights by combining the local grayscale variance of the local area where the pixel is located. The distance weight represents the degree of distance between each pixel and the center coordinates of the effective display area.
[0053] The first weight fusion processing unit is used to generate two-dimensional sharpening weights based on grayscale difference attention weights and spatial distribution attention weights.
[0054] The feature enhancement processing unit is used to perform feature enhancement processing on the multi-scale feature map set based on the two-dimensional sharpening weight map to generate a multi-scale enhanced feature set.
[0055] The second weight fusion processing unit is used to perform adaptive weight allocation processing on the features of each scale in the multi-scale enhanced feature map set to obtain the multi-scale fused feature map set.
[0056] The output unit is used to process the multi-scale fused feature map set through deconvolution layers to generate a sharpened image of the effective display area.
[0057] Optionally, pixel information includes grayscale mean and grayscale standard deviation;
[0058] The grayscale difference attention weight generation unit is specifically used for:
[0059] Calculate the mean and standard deviation of gray levels in the effective display area of the detected image;
[0060] The grayscale mean and grayscale standard deviation are used to generate a point-domain grayscale difference coefficient for each pixel in the effective display area;
[0061] Based on the point-domain grayscale difference coefficient, a grayscale difference attention weight is generated for each pixel in the effective display area.
[0062] Optionally, the spatially distributed attention weight generation unit is specifically used to include:
[0063] The distance weight generation module is used to generate distance weights for each pixel in the effective display area based on the center coordinates and diagonal distance of the effective display area.
[0064] The defect density coefficient generation module is used to generate a defect density coefficient based on the local gray-level variance of the local area where the pixel is located. The defect density coefficient represents the density of abrupt changes in the gray-level values of the pixels in that local area.
[0065] The spatial distribution attention weight generation module is used to generate spatial distribution attention weights for each pixel within the effective display area based on the defect density coefficient and distance weight.
[0066] Optionally, the screen under test is a display screen with a functional circuit layer having a reflective area inside the pixel layer;
[0067] The defect density coefficient generation module is specifically used for:
[0068] Obtain the global maximum gradient energy and global maximum local variance of the effective display area;
[0069] A set of local gradient energy is generated based on the gradient parameters of each pixel in the effective display area;
[0070] Calculate the reflection suppression weight for each pixel in the effective display area based on the global maximum gradient energy, the suppression intensity parameter, and the local gradient energy set;
[0071] The defect density coefficient is calculated based on the global maximum local variance and the reflection suppression weight.
[0072] Optionally, the second weight fusion processing unit is specifically used to include:
[0073] The scale priority weight is generated based on the defect scale-yield index of the screen under test. The defect scale-yield index represents the degree of impact of defects of different scales on the yield of the screen under test.
[0074] Defect distribution density weights are generated based on the defect frequency index of the screen under test. The defect frequency index represents the frequency of occurrence of defects of different scales in the production process of the corresponding type of display screen under test.
[0075] Defect difference weights are generated based on the defect-background difference index of the screen under test. The defect-background difference index represents the difficulty of identifying defects of different scales on the screen under test.
[0076] Multi-scale fusion weights are generated based on scale priority weights, defect distribution density weights, and defect difference weights.
[0077] Based on the multi-scale fusion weights, feature fusion processing is performed on N feature maps of different scales in the multi-scale enhanced feature set to generate a multi-scale fused feature map set.
[0078] Optionally, the output unit may also include:
[0079] The border region and background region determination unit is used to determine the border region and background region of the sharpened image;
[0080] The low-pass filter processing unit is used to perform low-pass filtering on the border area and the background area.
[0081] Optionally, the multi-scale feature extraction unit is specifically used to include:
[0082] The detected image is input into a preset screen semantic segmentation model to generate an effective display area mask;
[0083] A multi-scale feature extraction network is constructed, and the effective display region mask and detection image are input into the multi-scale feature extraction network;
[0084] The effective display area of the detected image is determined by a multi-scale feature extraction network, and multi-scale defect features are extracted from the effective display area to generate a set of several scale feature maps divided according to different predefined feature size standards.
[0085] Batch normalization is performed on each scale feature map in the multi-scale feature map set.
[0086] Optionally, the screen image sharpening device also includes:
[0087] The normalization processing unit is used to normalize the pixels of the detection image generated by the image acquisition unit;
[0088] The median filtering and noise reduction processing unit is used to perform median filtering and noise reduction processing on the normalized detection image.
[0089] Thirdly, embodiments of this application provide a computer-readable storage medium on which a program is stored, which, when executed on a computer, performs the screen image sharpening method as described in the first aspect and any optional screen image sharpening method of the first aspect.
[0090] As can be seen from the above technical solutions, the embodiments of this application have the following advantages:
[0091] In this application, the screen to be tested is first image acquired to generate a detection image. Multi-scale feature layer extraction is performed on the detection image within the effective display area to obtain a multi-scale feature map set, which includes several scale feature maps divided according to different predefined feature size standards. Pixel information of the detection image within the effective display area is extracted, and gray-level difference attention weights are generated for each pixel based on this information. Distance weights for each pixel within the effective display area are determined, and spatial distribution attention weights are generated by combining these weights with the local gray-level variance of the pixel's local region. The distance weights represent the distance between each pixel and the center coordinates of the effective display area. Two-dimensional sharpening weights are generated based on the gray-level difference attention weights and the spatial distribution attention weights. Feature enhancement processing is performed on the multi-scale feature map set based on these two-dimensional sharpening weights to generate a multi-scale enhanced feature map set. Adaptive weight allocation processing is performed between the features of each scale in the multi-scale enhanced feature map set to obtain a multi-scale fused feature map set. The multi-scale fused feature map set is then processed through a deconvolution layer to generate a sharpened image of the effective display area.
[0092] By performing multi-scale feature extraction on the detected image, defect features at different scales are first extracted onto different scale feature maps. Next, based on pixel information within the effective display area of the detected image, grayscale difference attention weights are generated according to the grayscale difference between each pixel and the overall image. Then, the local grayscale variance of the effective display area and the distance weight of each pixel within that area are determined, and spatial distribution attention weights are generated based on the local grayscale variance. A two-dimensional sharpening weight map is then generated based on the grayscale difference attention weights and the spatial distribution attention weights to construct a dual-branch attention mechanism. Grayscale difference attention dynamically adjusts weights based on the grayscale difference between defective and normal pixels, while spatial distribution attention allocates sharpening intensity based on the distance between pixels and the center of the screen and the defect density. After feature enhancement processing of the multi-scale feature map set using the two-dimensional sharpening weight map, feature fusion processing is performed on the enhanced feature set. Finally, a deconvolution layer is used to process the fused features, generating a sharpened image. This achieves the effect of increasing the weight of defective areas while suppressing the weight of normal areas, thus improving the accuracy of display defect detection. Attached Figure Description
[0093] 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.
[0094] Figure 1This is a schematic diagram of the multi-scale attention screen image sharpening method of this application;
[0095] Figure 2 A schematic diagram illustrating the method for generating grayscale difference attention weights in this application;
[0096] Figure 3 A schematic diagram of the method for generating spatially distributed attention weights for this application;
[0097] Figure 4 A schematic diagram of the method for generating the defect density coefficient for this application;
[0098] Figure 5 A schematic diagram illustrating the method for generating a sharpened image according to this application;
[0099] Figure 6 This is a schematic diagram of the image sharpening processing method of this application;
[0100] Figure 7 This is a schematic diagram of the method for obtaining multi-scale feature maps in this application;
[0101] Figure 8 This is a schematic diagram of the image processing method for the detection method of this application;
[0102] Figure 9 This is a schematic diagram of the screen image sharpening device with multi-scale attention according to this application. Detailed Implementation
[0103] 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 may 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.
[0104] 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.
[0105] 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.
[0106] 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]."
[0107] 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.
[0108] 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.
[0109] Among existing sharpening methods, Unsharp Mask (USM) sharpening is insufficient for enhancing weak defects on the display, but significantly enhances noise. Laplacian sharpening, while sensitive to brightness gradients, offers almost no enhancement for small defects in dark areas and is unstable in high-noise regions. Depth sharpening methods based on single-scale convolution cannot simultaneously capture both dark details and overall brightness structure, resulting in the loss of weak contrast information. High-contrast filtering sharpening suffers from insufficient local frame construction and cannot effectively handle weak pixel-like anomalies. Furthermore, the lack of semantic guidance and failure to consider the semantic requirements of screen detection (prioritizing the preservation of pixel array edges and defect region textures) leads to poor compatibility between the sharpening results and subsequent defect detection algorithms, resulting in decreased detection accuracy.
[0110] Furthermore, the new screen defects have multi-scale characteristics, making it difficult for a single-scale sharpening model to simultaneously capture the edges of tiny defects and the contours of large-area display unevenness. Secondly, noise (such as photosensitive noise and display response noise) is easily amplified, which makes it impossible for images after conventional sharpening to effectively capture different defects, thereby reducing the accuracy of display defect detection.
[0111] Based on this, this application discloses a multi-scale attention screen image sharpening method, apparatus and storage medium for improving the accuracy of display screen defect detection.
[0112] This method significantly improves the visibility of defects in low-brightness and dark areas, prevents inherent screen noise (such as pixel noise and sensor noise) from being amplified as defects, and can enhance subtle dot matrix anomalies without destroying the display structure. It also avoids over-sharpening artifacts in bright areas and can adapt to imaging differences in different brightness uniformity and different types of display panels.
[0113] 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.
[0114] 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.
[0115] Please see Figure 1 This application provides an embodiment of a multi-scale attention-based screen image sharpening method, comprising:
[0116] 101. Acquire an image of the screen to be tested and generate a test image;
[0117] First, the terminal places the screen under test on the acquisition platform. A pressing device then illuminates the screen, enabling it to display the defect detection image. The acquisition device then captures the image of the screen under test, generating a detection image. This detection image can have a resolution ≥1920×1080 and a bit depth of 8-16 bits.
[0118] 102. Perform multi-scale feature layer extraction on the effective display area of the detected image to obtain a multi-scale feature map set, which includes several scale feature maps divided according to different predefined feature size standards.
[0119] The terminal performs multi-scale feature layer extraction on the detected image to obtain a multi-scale feature map set. The purpose is to first construct an extraction network based on the defect type of the screen to be tested, and then perform multi-scale defect extraction in a targeted manner so that subsequent targeted enhancement can be performed on feature maps of different scales. The specific method of obtaining the multi-scale feature map set will be described in detail in the following embodiments.
[0120] 103. Extract pixel information of the detected image in the effective display area, and generate grayscale difference attention weights for each pixel based on the pixel information;
[0121] The terminal extracts pixel information from the effective display area of the detected image, performs grayscale difference analysis using this information, and generates a grayscale difference attention weight for each pixel based on this grayscale difference. By analyzing the presence of defects in pixels through the grayscale dimension, a weight index is generated, which is then used for targeted enhancement of feature maps at different scales. The specific method for generating the grayscale difference attention weight will be described in detail in subsequent embodiments.
[0122] 104. Determine the distance weight of each pixel within the effective display area, and generate spatial distribution attention weights by combining the local grayscale variance of the local area where the pixel is located. The distance weight represents the degree of distance between each pixel and the center coordinates of the effective display area.
[0123] The terminal determines the local grayscale variance of the effective display area, generates distance weights based on the pixel positions and the center coordinates of the effective display area, and then generates spatial distribution attention weights for different pixels based on the local grayscale variance and the distance weights. The detailed method for generating spatial distribution attention weights will be described in detail in subsequent embodiments.
[0124] 105. Generate two-dimensional sharpening weights based on grayscale difference attention weights and spatial distribution attention weights;
[0125] In this embodiment, the terminal generates a two-dimensional sharpening weight for each pixel based on grayscale difference attention weight and spatial distribution attention weight, thereby generating a two-dimensional sharpening weight map. The formula for two-dimensional attention fusion is as follows:
[0126]
[0127] in, Represents the attention weight for grayscale differences. Represents spatial distribution attention weights. This is the balance coefficient (range: 0.4-0.6). yes and The linear fusion coefficient, whose core function is to adjust the contribution ratio of defect gray-level abrupt changes and defect spatial distribution in the sharpening weight, when... When the value approaches 1, the algorithm prioritizes sharpening based on grayscale differences, that is, focusing on enhancing defects with high grayscale contrast compared to normal areas, such as dark scratches and bright spots. When the value approaches 0, the algorithm prioritizes sharpening based on "spatial distribution," that is, it focuses on enhancing areas with high spatial incidence, such as the center of the screen and areas with dense defects.
[0128] 106. Perform feature enhancement processing on the multi-scale feature map set according to the two-dimensional sharpening weights to generate a multi-scale enhanced feature map set;
[0129] The terminal will combine the multi-scale feature maps in the multi-scale augmented feature set with the attention weight maps respectively. Multiplying these results in the targeted augmented multi-scale features, i.e., the multi-scale augmented features. (Attention weight map) A dual-branch attention mechanism of grayscale difference attention and spatial distribution attention is formed. Grayscale difference attention dynamically adjusts the weight based on the grayscale difference between defective and normal pixels, while spatial distribution attention allocates sharpening intensity according to the distance between the pixel and the center area of the screen and the defect density, so as to achieve the effect of increasing the weight of defective areas and suppressing the weight of normal areas.
[0130] 107. Perform adaptive weight allocation processing on the features of each scale in the multi-scale enhanced feature map set to obtain a multi-scale fused feature map set;
[0131] 108. A sharpened image of the effective display area is generated by processing the multi-scale fused feature map set through deconvolution layers.
[0132] After all the multi-scale feature maps have been enhanced, the next step is to fuse the feature maps and use a deconvolution layer to restore the fused feature maps to their original size as the detection image.
[0133] In this embodiment, firstly, an image of the screen to be tested is acquired to generate a test image. Multi-scale feature layer extraction is performed on the test image within the effective display area to obtain a multi-scale feature map set, which includes several scale feature maps divided according to different predefined feature size standards. Pixel information of the test image within the effective display area is extracted, and gray-level difference attention weights are generated for each pixel based on this information. Distance weights for each pixel within the effective display area are determined, and spatial distribution attention weights are generated by combining these weights with the local gray-level variance of the pixel's local area. The distance weights represent the distance between each pixel and the center coordinates of the effective display area. Two-dimensional sharpening weights are generated based on the gray-level difference attention weights and the spatial distribution attention weights. Feature enhancement processing is performed on the multi-scale feature map set based on these two-dimensional sharpening weights to generate a multi-scale enhanced feature map set. Adaptive weight allocation processing is performed between the features of each scale in the multi-scale enhanced feature map set to obtain a multi-scale fused feature map set. The multi-scale fused feature map set is then processed through a deconvolution layer to generate a sharpened image of the effective display area.
[0134] By performing multi-scale feature extraction on the detected image, defect features at different scales are first extracted onto different feature maps. Next, based on pixel information within the effective display area of the detected image, grayscale difference attention weights are generated according to the grayscale difference between each pixel and the overall image. Then, the local grayscale variance of the effective display area and the distance weight of each pixel within that area are determined, and spatial distribution attention weights are generated based on the local grayscale variance. A two-dimensional sharpening weight map is then generated based on the grayscale difference attention weights and the spatial distribution attention weights to construct a dual-branch attention mechanism. Grayscale difference attention dynamically adjusts weights based on the grayscale difference between defective and normal pixels, while spatial distribution attention allocates sharpening intensity based on the distance between pixels and the center of the screen and the defect density. After feature enhancement processing of the multi-scale feature map set using the two-dimensional sharpening weight map, feature fusion processing is performed on the enhanced feature set. Finally, a deconvolution layer is used to process the fused features and generate a sharpened image. This achieves the effect of increasing the weight of defective areas while suppressing the weight of normal areas, thus improving the accuracy of display defect detection.
[0135] Please see Figure 2 This application provides an embodiment of a method for generating grayscale difference attention weights, wherein pixel information includes grayscale mean and grayscale standard deviation, including:
[0136] 201. Calculate the mean and standard deviation of gray levels in the effective display area of the detected image;
[0137] 202. Generate a point-domain grayscale difference coefficient for each pixel within the effective display area based on the grayscale mean and grayscale standard deviation;
[0138] 203. Generate grayscale difference attention weights for each pixel within the effective display area based on the point-domain grayscale difference coefficient.
[0139] In this embodiment, the terminal first calculates the average grayscale value of the effective display area in the detected image. and grayscale standard deviation .
[0140] The point-to-domain grayscale difference coefficient is calculated for each pixel using the following formula:
[0141]
[0142] in, To effectively display the grayscale values of pixels (x, y) within the region.
[0143] Next, the terminal uses a weighting formula and combines the point-domain grayscale difference coefficient, sensitivity coefficient, and grayscale standard deviation. To effectively display each pixel within the region, grayscale difference attention weights are generated. The weighting formula is as follows:
[0144]
[0145] Where k is the sensitivity coefficient, the larger the value, the more sensitive it is to changes in grayscale (the preferred value range is 1.5-3.0). Time weight approaches 1 (focus on sharpening). The time weight approaches 0.3 (weak sharpening).
[0146] Please see Figure 3 This application provides an embodiment of a method for generating spatially distributed attention weights, comprising:
[0147] 301. Generate distance weights for each pixel within the effective display area based on the center coordinates and diagonal distance of the effective display area;
[0148] The terminal first determines the center coordinates of the effective display area of the screen under test based on the effective display area mask M1. .
[0149] 302. Generate a defect density coefficient based on the local gray-level variance of the local area where the pixel is located. The defect density coefficient represents the density of abrupt changes in the gray-level values of the pixels in the local area.
[0150] 303. Generate spatial distribution attention weights for each pixel within the effective display area based on the defect density coefficient and distance weight.
[0151] Calculate the coordinates from pixel (x, y) to the center. The distance is given by the following formula:
[0152]
[0153] Next, calculate the distance weights using the following formula:
[0154]
[0155] Where D is half the diagonal length of the effective display area.
[0156] Next, the terminal generates a defect density coefficient based on the local grayscale variance of the effective display area. The defect density coefficient represents the density of grayscale value abrupt changes in different areas. Then, based on the defect density coefficient and distance weight, a spatial distribution attention weight is generated for each pixel within the effective display area. The formula is as follows:
[0157]
[0158] in, The defect density coefficient is obtained by combining the defect density map (specifically calculated through local variance) with the terminal, increasing the weight of regions with high defect density by approximately 20%–50%, thus yielding the spatial distribution attention weight and the defect density coefficient. It is a normalization index based on the calculation of local variance of an image, and its value ranges from 0 to 0.5. When the defect scale is not complex, the defect density coefficient can be used. Determined as a fixed coefficient. Defect density coefficient. This reflects the density of grayscale value abrupt changes within a local area of the effective display area where the current pixel is located. Because millimeter-level defects (such as scratches and dark spots) have significant grayscale differences compared to normal screen areas, the denser the defect area, the greater the local grayscale variance, and the higher the defect density coefficient. When the defect density coefficient... When the value is close to 0.5, it indicates that the local area has a dense abrupt change in gray level (which is likely a region with concentrated defects, such as multiple scratches converging or dense dark spots). When the defect density coefficient... When the value is close to 0, it indicates that the local area has uniform gray level (no defects or only a single minor defect).
[0159] Please see Figure 4 This application provides an embodiment of a method for generating defect density coefficients, wherein the screen under test is a display screen having a functional circuit layer with a reflective area disposed within the inner layer of the pixel layer, comprising:
[0160] 401. Obtain the global maximum gradient energy and global maximum local variance of the effective display area;
[0161] 402. Generate a set of local gradient energy based on the gradient parameters of each pixel in the effective display area;
[0162] 403. Calculate the reflection suppression weight for each pixel in the effective display area based on the global maximum gradient energy, suppression intensity parameters, and local gradient energy set;
[0163] 404. Calculate the defect density coefficient based on the global maximum local variance and the reflection suppression weight.
[0164] In new displays, to adapt to different production environments, internal circuits controlling various functions are often placed within the pixel layer. The metal chips within these internal circuits may affect pixel intensity through reflection. This reflection effect can lead to detection errors in the grayscale of pixels in the effective display area of the screen under test, causing deviations in the calculation of the defect density coefficient. In this embodiment, reflection suppression can be achieved through gradient energy. The specific terminal needs to obtain the global maximum gradient energy and global maximum local variance of the effective display area. First, a set of local gradient energy is generated based on the gradient parameters of each pixel in the effective display area. The formula is as follows:
[0165]
[0166] in, and These are the gradients in the horizontal x and vertical y directions at pixel (x, y), respectively, which can be calculated using the Sobel operator.
[0167] Next, we will start with the local gradient energy set. Determining the global maximum gradient energy .
[0168] The terminal also needs to calculate the local grayscale variance. The formula is as follows:
[0169]
[0170] Among them, M N is the area of the local region window (when the local region is irregular, a more precise point-by-point calculation is used). This represents the average grayscale value of a local area window. This represents the grayscale values of each pixel within a local region window. The resulting local gradient energy set is then calculated. According to the local gradient energy set Generate the global maximum local variance.
[0171] Next, the terminal calculates the reflection suppression weight for each pixel in the effective display area based on the global maximum gradient energy, the suppression strength parameter, and the local gradient energy set. The formula is as follows:
[0172]
[0173] in, For local gradient energy, The global maximum gradient energy, This is the reflectivity suppression strength coefficient, used to control the rate at which the gradient energy decays with respect to the weights. The larger the value, the more the local area overlaps with the reflection area, and the more the reflection suppression weight increases. The faster the decay. Conversely, when The smaller the value, the weaker the reflection suppression effect. The reflectivity suppression intensity coefficient needs to be determined based on the reflectivity of the metal reflective area of the internal circuitry on the display layer of the screen under test. The stronger the reflectivity of the metal reflective area, the larger the reflectivity suppression intensity coefficient, and vice versa. Finally, the terminal calculates the defect density coefficient based on the global maximum local variance and the reflection suppression weight, using the following formula:
[0174]
[0175] in, The global maximum reflection suppression weight, The reflectivity suppression intensity coefficient is determined by the sum of the reflectivity of the metal reflection area and the screen under test, which is the largest local gray-level variance in the global range. Then, the accurate defect density coefficient is calculated based on the reflectivity suppression intensity coefficient, which can truly reflect the defect density in the local area.
[0176] Please see Figure 5 This application provides an embodiment of a method for generating a sharpened image, comprising:
[0177] 501. Generate scale priority weights based on the defect scale-yield index of the screen under test. The defect scale-yield index represents the degree of influence of defects of different scales on the yield of the screen under test.
[0178] 502. Generate defect distribution density weights based on the defect frequency index of the screen under test. The defect frequency index represents the frequency of occurrence of defects of different scales in the production process of the corresponding type of display screen under test.
[0179] 503. Generate defect difference weights based on the defect-background difference index of the screen under test. The defect-background difference index represents the difficulty of identifying defects of different scales on the screen under test.
[0180] 504. Generate multi-scale fusion weights based on scale priority weights, defect distribution density weights, and defect difference weights;
[0181] In this embodiment, before fusing feature maps of different scales, weights need to be set for each scale. The purpose of fusion is that each scale's defect feature branch can only accurately capture defects of a certain size of display screen, but is "insensitive" to defects of other sizes. Even after attention enhancement, this scale limitation still exists. For example, in a conventional flat screen, the micro-scale branch (1-3mm) can accurately capture tiny scratches after enhancement, but has almost no response to display unevenness of 6-10mm. The large-scale branch (6-10mm) can highlight the uneven structure after enhancement, but will "ignore" tiny scratches of 1-3mm. If the fusion weights are not adjusted (e.g., direct average fusion), large defect features may mask small defect features, such as strong features of display unevenness covering tiny scratches, or small defect features having an excessively high proportion and large defects not being sufficiently sharpened.
[0182] In this embodiment, the terminal dynamically adjusts the fusion weights of features at each scale through a gating mechanism. Specifically, fusion weights are set according to preset scale levels, for example, at three scale levels, ω_1 is the micro-scale branch, ω_2 is the meso-scale branch, and ω_3 is the macro-scale branch, which must satisfy ω_1+ω_2+ω_3=1. Simultaneously, the allocation must also follow three principles: priority principle, distribution density principle, and recognition difficulty principle.
[0183] Regarding the priority principle: The terminal generates a priority weight based on the defect scale-yield index of the screen under test. The defect scale-yield index represents the degree to which defects of different scales affect the yield of the screen under test. In the testing standard, the scale corresponding to "core display defects that affect product yield and user experience" has the highest weight. Specifically, when a certain type of defect will seriously affect the product yield of the screen under test, the scale corresponding to this type of defect will be assigned a higher weight.
[0184] Regarding the distribution density principle: The terminal generates defect distribution density weights based on the defect frequency index of the screen under test. The defect frequency index represents the frequency of occurrence of defects of different scales during the production process of the corresponding type of display screen under test. Defects with higher occurrence frequencies have higher weights than defects with lower occurrence frequencies.
[0185] Regarding the principle of recognition difficulty: The terminal generates defect difference weights based on the defect-background difference index of the screen under test. The defect-background difference index represents the recognition difficulty of defects of different scales on the screen under test. For scales corresponding to "defects with low background discrimination and easy to miss on the screen under test", the weights are appropriately increased to compensate for recognition shortcomings.
[0186] Next, the weights of each scale are classified and normalized so that ω_1+ω_2+ω_3=1. For example, micro-scale features can usually obtain a fusion weight allocation of 0.4-0.5, meso-scale features can obtain a fusion weight allocation of 0.3-0.4, and macro-scale features can obtain a fusion weight allocation of 0.1-0.2, but this application is not limited to these.
[0187] 505. Based on the multi-scale fusion weights, perform feature fusion processing on N feature maps of different scales in the multi-scale enhanced feature set to generate a multi-scale fused feature map set.
[0188] Next, the terminal performs feature fusion processing on N feature maps of different scales in the multi-scale enhanced feature set according to the multi-scale fusion weights, generating a multi-scale fused feature map set. Then, the image size of the fused feature image is restored through a deconvolution layer to generate a sharpened image. The resulting sharpened image can better highlight features of different degrees on the screen under test and suppress non-defect areas.
[0189] Please see Figure 6 This application provides an embodiment of a method for sharpening images, comprising:
[0190] 601. Determine the border area and background area of the image to be sharpened;
[0191] 602. Perform low-pass filtering on the border area and background area.
[0192] The terminal determines the border region and background region of the sharpened image, and specifically performs low-pass filtering on the border region (M2) and background region (M3) to improve the quality of the final sharpened image output.
[0193] Please see Figure 7 This application provides an embodiment of a method for obtaining multi-scale feature maps, comprising:
[0194] 701. Input the detected image into the preset screen semantic segmentation model to generate an effective display area mask;
[0195] In this embodiment, the terminal processes the detected image through a screen semantic segmentation model. For example, the screen semantic segmentation model is based on a lightweight U-Net and outputs three types of semantic masks: effective display area mask M1, border area mask M2, and background area mask M3. The three types of masks can determine different regions in the detected image, so as to facilitate targeted processing of different regions.
[0196] 702. Construct a multi-scale feature extraction network, and input the effective display region mask and detection image into the multi-scale feature extraction network;
[0197] 703. The effective display area of the detected image is determined by a multi-scale feature extraction network, and multi-scale defect features are extracted from the effective display area to generate a set of several scale feature maps divided according to different predefined feature size standards.
[0198] 704. Perform batch normalization on each scale feature map in the multi-scale feature map set.
[0199] After the effective display area mask is generated, the terminal inputs the preprocessed detection image and the effective display area mask M1 into the pre-constructed multi-scale feature extraction network for convolution processing, so as to process the defect features at different scales.
[0200] For example, for a screen under test with defects at three scales, a three-level feature extraction network needs to be constructed: micro-scale branch, meso-scale branch, and macro-scale branch.
[0201] The micro-scale branch, with a 3×3 kernel and a stride of 1, is used to extract high-frequency features such as scratches and tiny bright spots. The meso-scale branch, with a 5×5 kernel, a stride of 1, and padding of 2, is used to extract contour features such as dark spots and pixel failure blocks. The macro-scale branch, with a 7×7 kernel, a stride of 1, and padding of 4, is used to extract structural features of uneven displays and large-area defects.
[0202] By designing a three-level feature extraction network of "micro-scale-meso-macro-scale", which is adapted to defects of different sizes, the network achieves synchronous enhancement of defect details at multiple scales through a scale-adaptive fusion strategy.
[0203] Next, the terminal performs batch normalization on the output feature maps of each scale branch to avoid gradient vanishing.
[0204] Please see Figure 8 This application provides an embodiment of a processing method for detecting images, comprising:
[0205] 801. Normalize the pixels of the detected image;
[0206] 802. Perform median filtering noise reduction on the normalized detection image.
[0207] After the terminal acquires the detection image of the screen to be tested, it needs to perform a series of preprocessing steps on the detection image. Specifically, the terminal needs to normalize the detection image so that each pixel value of the detection image is mapped to the [0, 1] interval. Next, the terminal uses adaptive median filtering to perform preliminary noise reduction on the detection image, preserving the defect edges while suppressing high-frequency noise.
[0208] Please see Figure 9 This application provides an embodiment of a multi-scale attention-based screen image sharpening device, comprising:
[0209] The image acquisition unit 901 is used to acquire images of the screen under test and generate a test image;
[0210] The multi-scale feature extraction unit 902 is used to extract multi-scale features from the detection image in the effective display area to obtain a set of multi-scale feature maps. The set of multi-scale feature maps includes several scale feature maps divided according to different predefined feature size standards.
[0211] The grayscale difference attention weight generation unit 903 is used to extract pixel information of the detected image in the effective display area and generate grayscale difference attention weights for each pixel based on the pixel information.
[0212] The spatial distribution attention weight generation unit 904 is used to determine the distance weight of each pixel within the effective display area, and to generate the spatial distribution attention weight by combining the local grayscale variance of the local area where the pixel is located. The distance weight represents the degree of distance between each pixel and the center coordinates of the effective display area.
[0213] The first weight fusion processing unit 905 is used to generate two-dimensional sharpening weights based on grayscale difference attention weights and spatial distribution attention weights.
[0214] The feature enhancement processing unit 906 is used to perform feature enhancement processing on the multi-scale feature map set according to the two-dimensional sharpening weight map to generate a multi-scale enhanced feature set.
[0215] The second weight fusion processing unit 907 is used to perform adaptive weight allocation processing on the features of each scale in the multi-scale enhanced feature map set to obtain the multi-scale fused feature map set.
[0216] Output unit 908 is used to process the multi-scale fused feature map set through deconvolution layers to generate a sharpened image of the effective display area.
[0217] Optionally, pixel information includes grayscale mean and grayscale standard deviation;
[0218] The grayscale difference attention weight generation unit 903 is specifically used for including:
[0219] Calculate the mean and standard deviation of gray levels in the effective display area of the detected image;
[0220] The grayscale mean and grayscale standard deviation are used to generate a point-domain grayscale difference coefficient for each pixel in the effective display area;
[0221] Based on the point-domain grayscale difference coefficient, a grayscale difference attention weight is generated for each pixel in the effective display area.
[0222] Optionally, the spatially distributed attention weight generation unit 904 is specifically used to include:
[0223] The distance weight generation module is used to generate distance weights for each pixel in the effective display area based on the center coordinates and diagonal distance of the effective display area.
[0224] The defect density coefficient generation module is used to generate a defect density coefficient based on the local gray-level variance of the local area where the pixel is located. The defect density coefficient represents the density of abrupt changes in the gray-level values of the pixels in that local area.
[0225] The spatial distribution attention weight generation module is used to generate spatial distribution attention weights for each pixel within the effective display area based on the defect density coefficient and distance weight.
[0226] Optionally, the screen under test is a display screen with a functional circuit layer having a reflective area inside the pixel layer;
[0227] The defect density coefficient generation module is specifically used for:
[0228] Obtain the global maximum gradient energy and global maximum local variance of the effective display area;
[0229] A set of local gradient energy is generated based on the gradient parameters of each pixel in the effective display area;
[0230] Calculate the reflection suppression weight for each pixel in the effective display area based on the global maximum gradient energy, the suppression intensity parameter, and the local gradient energy set;
[0231] The defect density coefficient is calculated based on the global maximum local variance and the reflection suppression weight.
[0232] Optionally, the second weighted fusion processing unit 907 is specifically used to include:
[0233] The scale priority weight is generated based on the defect scale-yield index of the screen under test. The defect scale-yield index represents the degree of impact of defects of different scales on the yield of the screen under test.
[0234] Defect distribution density weights are generated based on the defect frequency index of the screen under test. The defect frequency index represents the frequency of occurrence of defects of different scales in the production process of the corresponding type of display screen under test.
[0235] Defect difference weights are generated based on the defect-background difference index of the screen under test. The defect-background difference index represents the difficulty of identifying defects of different scales on the screen under test.
[0236] Multi-scale fusion weights are generated based on scale priority weights, defect distribution density weights, and defect difference weights.
[0237] Based on the multi-scale fusion weights, feature fusion processing is performed on N feature maps of different scales in the multi-scale enhanced feature set to generate a multi-scale fused feature map set.
[0238] Optionally, the output unit may also include:
[0239] The border region and background region determination unit is used to determine the border region and background region of the sharpened image;
[0240] The low-pass filter processing unit is used to perform low-pass filtering on the border area and the background area.
[0241] Optionally, the multi-scale feature extraction unit 902 is specifically used to include:
[0242] The detected image is input into a preset screen semantic segmentation model to generate an effective display area mask;
[0243] A multi-scale feature extraction network is constructed, and the effective display region mask and detection image are input into the multi-scale feature extraction network;
[0244] The effective display area of the detected image is determined by a multi-scale feature extraction network, and multi-scale defect features are extracted from the effective display area to generate a set of several scale feature maps divided according to different predefined feature size standards.
[0245] Batch normalization is performed on each scale feature map in the multi-scale feature map set.
[0246] Optionally, the screen image sharpening device also includes:
[0247] The normalization processing unit is used to normalize the pixels of the detection image generated by the image acquisition unit;
[0248] The median filtering and noise reduction processing unit is used to perform median filtering and noise reduction processing on the normalized detection image.
[0249] 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.
[0250] 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.
[0251] 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.
[0252] 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 screen image sharpening method based on multi-scale attention, characterized in that, include: The screen to be tested is captured to generate a test image; Multi-scale feature layer extraction is performed on the detected image in the effective display area to obtain a multi-scale feature map set, which includes several scale feature maps divided according to different predefined feature size standards. Extract the pixel information of the detected image in the effective display area, and generate grayscale difference attention weights for each pixel based on the pixel information; Determine the distance weight of each pixel within the effective display area, and generate a spatial distribution attention weight by combining the local grayscale variance of the local area where the pixel is located. The distance weight represents the degree of distance between each pixel and the center coordinates of the effective display area. A two-dimensional sharpening weight is generated based on the grayscale difference attention weight and the spatial distribution attention weight; The multi-scale feature map set is subjected to feature enhancement processing based on the dual-dimensional sharpening weights to generate a multi-scale enhanced feature map set. An adaptive weight allocation process is performed on the features at each scale in the multi-scale enhanced feature map set to obtain a multi-scale fused feature map set. The multi-scale fused feature map set is processed by a deconvolution layer to generate a sharpened image of the effective display area.
2. The screen image sharpening method according to claim 1, characterized in that, The pixel information includes the grayscale mean and grayscale standard deviation; The step of extracting pixel information of the detected image in the effective display area and generating grayscale difference attention weights for each pixel based on the pixel information specifically includes: Calculate the mean gray level and standard deviation of the effective display area in the detected image; The grayscale mean and the grayscale standard deviation are used to generate a point-domain grayscale difference coefficient for each pixel in the effective display area; Based on the point-domain grayscale difference coefficient, a grayscale difference attention weight is generated for each pixel within the effective display area.
3. The screen image sharpening method according to claim 1, characterized in that, The step of determining the distance weight of each pixel within the effective display area and generating spatial distribution attention weights by combining the local grayscale variance of the local region where the pixel is located specifically includes: A distance weight is generated for each pixel within the effective display area based on the center coordinates and diagonal distance of the effective display area. A defect density coefficient is generated based on the local gray-level variance of the local region where the pixel is located. The defect density coefficient represents the density of abrupt changes in the gray-level values of the pixels in the local region. Spatial distribution attention weights are generated for each pixel within the effective display area based on the defect density coefficient and the distance weight.
4. The screen image sharpening method according to claim 3, characterized in that, The screen under test is a display screen with a functional circuit layer having a reflective area inside the pixel layer. The step of generating the defect density coefficient based on the local grayscale variance of the local region where the pixel is located specifically includes: Obtain the global maximum gradient energy and global maximum local variance of the effective display area; A local gradient energy set is generated based on the gradient parameters of each pixel in the effective display area; Calculate the reflection suppression weight for each pixel in the effective display area based on the global maximum gradient energy, the suppression intensity parameter, and the local gradient energy set; The defect density coefficient is calculated based on the global maximum local variance and the reflection suppression weight.
5. The screen image sharpening method according to claim 1, characterized in that, The step of performing adaptive weight allocation processing on the features of each scale in the multi-scale enhanced feature map set to obtain the multi-scale fused feature map set specifically includes: A scale priority weight is generated based on the defect scale-yield index of the screen under test. The defect scale-yield index represents the degree of influence of defects of different scales on the yield of the screen under test. A defect distribution density weight is generated based on the defect frequency index of the screen under test, wherein the defect frequency index represents the frequency of occurrence of defects of different scales in the production process of the corresponding type of display screen of the screen under test. Defect difference weights are generated based on the defect-background difference index of the screen under test, whereby the defect-background difference index represents the difficulty of identifying defects of different scales on the screen under test. Multi-scale fusion weights are generated based on the scale priority weights, defect distribution density weights, and defect difference weights. Based on the multi-scale fusion weights, feature fusion processing is performed on N feature maps of different scales in the multi-scale enhanced feature set to generate the multi-scale fused feature map set.
6. The screen image sharpening method according to claim 5, characterized in that, After the step of processing the multi-scale fused feature map set through a deconvolution layer to generate a sharpened image of the effective display area, the screen image sharpening method further includes: Determine the border region and background region of the sharpened image; Low-pass filtering is performed on the border area and the background area.
7. The screen image sharpening method according to any one of claims 1 to 6, characterized in that, The step of extracting multi-scale feature maps from the detected image in the effective display area to obtain a multi-scale feature map set specifically includes: The detected image is input into a preset screen semantic segmentation model to generate an effective display area mask; A multi-scale feature extraction network is constructed, and the effective display area mask and the detection image are input into the multi-scale feature extraction network; The effective display area of the detected image is determined by the multi-scale feature extraction network, and multi-scale defect features are extracted from the effective display area to generate a set of several scale feature maps divided according to different predefined feature size standards. Each scale feature map in the multi-scale feature map set is subjected to batch normalization.
8. The screen image sharpening method according to any one of claims 1 to 6, characterized in that, After the step of acquiring an image of the screen to be tested and generating a detection image, and before the step of extracting multi-scale feature layers from the detection image in the effective display area to obtain a multi-scale feature map set, the screen image sharpening method further includes: The pixels of the detected image are normalized. The normalized detection image is then subjected to median filtering for noise reduction.
9. A screen image sharpening device based on multi-scale attention, characterized in that, include: The image acquisition unit is used to acquire images of the screen under test and generate a test image. A multi-scale feature extraction unit is used to extract multi-scale features from the detection image in the effective display area to obtain a multi-scale feature map set, wherein the multi-scale feature map set includes several scale feature maps divided according to different predefined feature size standards. The grayscale difference attention weight generation unit is used to extract pixel information of the detected image in the effective display area and generate grayscale difference attention weight for each pixel based on the pixel information. A spatial distribution attention weight generation unit is used to determine the distance weight of each pixel within the effective display area, and generate a spatial distribution attention weight by combining the local grayscale variance of the local area where the pixel is located. The distance weight represents the degree of distance between each pixel and the center coordinates of the effective display area. The first weight fusion processing unit is used to generate a two-dimensional sharpening weight based on the grayscale difference attention weight and the spatial distribution attention weight. The feature enhancement processing unit is used to perform feature enhancement processing on the multi-scale feature map set according to the dual-dimensional sharpening weight map to generate a multi-scale enhanced feature set. The second weight fusion processing unit is used to perform adaptive weight allocation processing on the features of each scale in the multi-scale enhanced feature map set to obtain the multi-scale fused feature map set. The output unit is used to process the multi-scale fused feature map set through a deconvolution layer to generate a sharpened image of the effective display area.
10. A computer storage medium, characterized in that, The computer-readable storage medium contains a program that, when executed on a computer, performs the screen image sharpening method as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Screen color correction method and device and storage medium
CN120071859A
Insulator defect detecting and positioning method and system based on cross-scale feature fusion
CN120471997A