Imaging quality evaluation method and device of diffractive optical waveguide, storage medium and electronic equipment

By setting reference markers and grayscale distribution curves in diffractive waveguide imaging technology, defects such as halos, trailing, and ghosting can be identified and quantified, solving the problem of quantifying optical imaging defects in existing technologies and improving user experience and manufacturing quality.

CN120931601APending Publication Date: 2025-11-11SEEV OPTOELECTRONICS TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511050631.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-29
Publication Date
2025-11-11

AI Technical Summary

Technical Problem

Existing diffractive waveguide imaging technology suffers from optical imaging defects in AR displays, such as dispersion, image trailing, and halo, which lead to a decline in the quality of the user's visual experience. Traditional optical evaluation indicators cannot accurately quantify these defects.

Method used

By setting benchmark marks in the test image to determine the test area, constructing a grayscale distribution curve based on grayscale values, and using a feature-matching defect detection algorithm to identify and quantify defects such as halos, trails, and shadows, an automated and accurate defect assessment is achieved.

Benefits of technology

It improves the accuracy and efficiency of defect identification, reduces labor costs, provides accurate assessment of defect severity, supports production process optimization, and enhances the manufacturing quality of diffractive waveguides.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120931601A_ABST
    Figure CN120931601A_ABST
Patent Text Reader

Abstract

The invention discloses a diffraction optical waveguide imaging quality evaluation method and device, a storage medium and electronic equipment, and the method comprises the steps: determining a test region in a test image based on a reference mark corresponding to the test image and a defect type corresponding to the reference mark; wherein the test image is transmitted by using the diffraction optical waveguide to be tested as an optical channel; based on the gray values corresponding to the pixels in the test area, determining a gray distribution curve corresponding to the test area; based on the gray level distribution curve and a defect detection algorithm corresponding to the defect type, identifying and quantifying the defect type existing in the test image; wherein the defect type comprises at least one of halo, trailing and smear. According to the technical scheme, the imaging defect of the diffraction optical waveguide can be recognized, and accurate quantification of the imaging defect is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of optical technology, and specifically to an imaging quality assessment method, apparatus, storage medium, and electronic device for a diffractive waveguide. Background Technology

[0002] The rapid development of Augmented Reality (AR) technology has greatly promoted innovative research in related display technologies and solutions. Diffractive waveguides, as one of the key technologies for realizing AR displays, have attracted widespread attention due to their advantages such as thinness, wide field of view, and mass production potential. However, in the process of achieving mature applications, diffractive waveguide technology still faces many challenges from optical imaging defects, such as dispersion effects, image trailing, and halos, which significantly reduce the quality of the user's visual experience.

[0003] Currently, the industry's evaluation of the imaging performance of new display devices such as diffractive waveguides mainly relies on traditional optical evaluation metrics, such as contrast ratio and modulation transfer function. These metrics can directly reflect the quality of the device's imaging, but they cannot accurately quantify the factors that affect the imaging quality. Summary of the Invention

[0004] This application provides a method, apparatus, storage medium, and electronic device for evaluating the imaging quality of diffractive waveguides, which can identify imaging defects in diffractive waveguides and achieve accurate quantification of imaging defects.

[0005] According to a first aspect of this application, an imaging quality assessment method for a diffractive waveguide is provided, the method comprising:

[0006] Based on the reference mark corresponding to the test image and the defect type corresponding to the reference mark, a test area is determined in the test image; wherein, the test image is transmitted by the diffractive waveguide under test as the optical channel;

[0007] Based on the gray values ​​corresponding to the pixels in the test area, determine the gray distribution curve corresponding to the test area;

[0008] Based on the grayscale distribution curve and the defect detection algorithm corresponding to the defect type, the defect types present in the test image are identified and quantified; wherein, the defect types include at least one of: halo, trailing, and ghosting.

[0009] According to a second aspect of this application, an imaging quality assessment apparatus for a diffractive waveguide is provided, the apparatus comprising:

[0010] The test area determination module is used to determine the test area in the test image based on the reference mark corresponding to the test image and the defect type corresponding to the reference mark; wherein the test image is transmitted by the diffraction waveguide under test as the optical channel;

[0011] The grayscale distribution determination module is used to determine the grayscale distribution curve corresponding to the test area based on the grayscale values ​​corresponding to the pixels in the test area.

[0012] The defect identification and quantization module is used to identify and quantify the defect types present in the test image based on the grayscale distribution curve and the defect detection algorithm corresponding to the defect type; wherein the defect types include at least one of: halo, trailing and shadow.

[0013] According to a third aspect of the present invention, embodiments of this application provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the imaging quality assessment method for diffractive waveguides as described in embodiments of this application.

[0014] According to a fourth aspect of the present invention, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the imaging quality assessment method for diffractive waveguides as described in the embodiments of the present application.

[0015] According to a fifth aspect of this application, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the imaging quality assessment method for diffractive waveguides as described in embodiments of this application.

[0016] This application's technical solution locates the test area by setting reference marks corresponding to the defect type in the test image, avoiding the computational redundancy of full-image scanning. This enables on-demand defect detection, significantly improving the targeting and efficiency of the detection. A grayscale distribution curve is constructed based on the grayscale values ​​of pixels within the test area, transforming subjective optical defect phenomena such as halos, trailing, and ghosting into objective, quantifiable data representations, providing a precise basis for assessing defect severity. This application employs defect detection algorithms matched to the characteristics of different defect types, such as halos, trailing, and ghosting, for defect identification and quantification. This differentiated processing mechanism significantly improves the accuracy and reliability of defect identification. It achieves a high degree of automation from area localization and feature extraction to defect judgment, reducing the manual cost of defect detection. The defect quantification results obtained by this application can directly serve the diagnosis and optimization loop of the production process, contributing to the continuous improvement of the manufacturing quality of diffractive waveguides.

[0017] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this application, nor is it intended to limit the scope of this application. Other features of this application will become readily apparent from the following description. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying 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.

[0019] Figure 1 This is a flowchart of the imaging quality assessment method for diffractive waveguides provided in Embodiment 1;

[0020] Figure 2 This is a schematic diagram of an imaging defect according to an embodiment of this application;

[0021] Figure 3 This is a schematic diagram of reference markings provided according to Embodiment 1 of this application;

[0022] Figure 4 This is a schematic diagram showing the determination of the test area based on the embodiments of this application;

[0023] Figure 5 This is a flowchart of the imaging quality assessment method for diffractive waveguides provided in Embodiment 2;

[0024] Figure 6 This is a schematic diagram of a target pixel determination scheme provided according to an embodiment of this application;

[0025] Figure 7 This is a flowchart of the imaging quality assessment method for diffractive waveguides provided in Embodiment 3;

[0026] Figure 8 The grayscale distribution curve and grayscale difference curve used for identifying and quantizing the trailing effect according to embodiments of this application;

[0027] Figure 9 This is a schematic diagram of the imaging quality assessment device for the diffractive waveguide provided in Embodiment 4 of this application;

[0028] Figure 10 This is a schematic diagram of the structure of an electronic device provided in Embodiment 5 of this application. Detailed Implementation

[0029] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0030] It should be noted that the terms "first," "second," "target," and "candidate," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0031] Example 1

[0032] Figure 1 This is a flowchart of the imaging quality assessment method for diffractive waveguides provided in Embodiment 1. This embodiment is applicable to the assessment of the imaging quality of diffractive waveguides. The method is executed by the imaging quality assessment model of the diffractive waveguide, and can be executed by the imaging quality assessment device of the diffractive waveguide. The imaging quality assessment device of the diffractive waveguide is implemented in hardware and / or software and can be integrated into the electronic device running this system.

[0033] like Figure 1 As shown, the method includes:

[0034] S110. Based on the reference mark corresponding to the test image and the defect type corresponding to the reference mark, determine the test area in the test image; wherein, the test image is transmitted by the diffractive waveguide under test as the optical channel.

[0035] S120. Based on the gray values ​​corresponding to the pixels in the test area, determine the gray distribution curve corresponding to the test area.

[0036] S130. Based on the grayscale distribution curve and the defect detection algorithm corresponding to the defect type, the defect type present in the test image is identified and quantified; wherein, the defect type includes at least one of: halo, trailing and shadow.

[0037] Diffractive waveguides are an AR display technology that utilizes diffraction gratings and total internal reflection to transmit light, transmitting virtual images to the human eye through a nanoscale grating structure. The diffractive waveguide under test refers to the diffractive waveguide for which imaging quality assessment is required.

[0038] This application uses test images to evaluate the imaging quality of diffractive waveguides. The test images are grayscale images acquired in a darkroom, and are transmitted through the diffractive waveguide under test as the optical channel. Imaging defects in the diffractive waveguide under test will be reflected in the test images. By identifying and quantifying the defects present in the test images, the imaging quality of the diffractive waveguide under test can be evaluated.

[0039] The test image includes reference markers, which are used to locate test regions within the image. The reference markers are related to the defect type; their distribution and number may differ depending on the defect type. The test regions, located using the reference markers, are used to quantify imaging defects in the test image. A test region is a local area within the test image. The number of test regions included in the test image is related to the number of reference markers. Optionally, each reference marker in the test image corresponds to at least one test region.

[0040] Optionally, pixel indices are determined for pixels in the test area based on their distribution locations. A grayscale distribution curve is plotted for the test area using the pixel index as the x-axis and the grayscale value corresponding to the pixel index as the y-axis. This grayscale distribution curve transforms subjective optical defect phenomena into objective, quantifiable data representations. The grayscale distribution curve forms the data basis for developing the defect detection algorithm. The defect detection algorithm is used to identify and quantify the types of defects present in the test image. The defect detection algorithm is related to the defect type; different defect types exhibit different behaviors in the test image, leading to variations in the defect detection algorithms used. Optionally, defect types include at least one of: halo, trailing, and ghosting. Halo and trailing often occur simultaneously in the test image, manifesting as an asymmetric diffusion effect in the highlighted area. Figure 2 This is a schematic diagram of an imaging defect according to an embodiment of this application. See also... Figure 2 In part (a) of the image, the trailing effect manifests as a directional artifact in the test image. Simply put, when a trailing effect occurs, the light spot extends in one direction, while when a halo occurs, the light spot spreads out evenly in all directions. The trailing effect is characterized by blurred local boundaries; see [link to previous section]. Figure 2 In part (b) of the test image, multiple ghostings appear along one direction.

[0041] Therefore, the first defect detection algorithm can be used to detect halos and trails. This algorithm filters defect feature pixels by pre-defined grayscale ranges and combines spatial location mapping with analysis of region extension direction to quantify halo intensity and identify trail direction. Due to the influence of halos and other factors, trails are relatively difficult to identify. Therefore, the second defect detection algorithm is used for trails. This algorithm uses differential calculation to locate grayscale abrupt change boundaries and combines spatial mapping with grayscale comparison to define the trail region and quantify its intensity.

[0042] This application's technical solution locates the test area by setting reference marks corresponding to the defect type in the test image, avoiding the computational redundancy of full-image scanning. This enables on-demand defect detection, significantly improving the targeting and efficiency of the detection. A grayscale distribution curve is constructed based on the grayscale values ​​of pixels within the test area, transforming subjective optical defect phenomena such as halos, trailing, and ghosting into objective, quantifiable data representations, providing a precise basis for assessing defect severity. This application employs defect detection algorithms matched to the characteristics of different defect types, such as halos, trailing, and ghosting, for defect identification and quantification. This differentiated processing mechanism significantly improves the accuracy and reliability of defect identification. It achieves a high degree of automation from area localization and feature extraction to defect judgment, reducing the manual cost of defect detection. The defect quantification results obtained in this application can directly serve the diagnosis and optimization loop of the production process, contributing to the continuous improvement of the manufacturing quality of diffractive waveguides.

[0043] In an optional embodiment, if the defect type is the halo or the trailing effect, the reference marker is distributed at any position in the test image; if the defect type is the ghosting effect, the reference marker is distributed at the center of the test image.

[0044] Halo and trailing have a global impact. Setting reference markers at any position in the test image allows for on-demand detection of halo and trailing in the test image. Optionally, reference markers can be set at the image center and / or four corners of the test image. By forming a spatial sampling grid with the image center and four corners, the entire display screen can be sampled to understand the overall halo and trailing situation. Furthermore, multiple reference markers can cover different propagation directions, and the trailing direction can be accurately located through regional extension direction analysis.

[0045] The effects of ghosting are regionally concentrated; ghosting in the image center directly causes blurry text or image edges, ruining the user experience. When the defect type is ghosting, a baseline marker is set at the center of the test image. Optionally, the baseline marker in the test image can be identified using a threshold segmentation method.

[0046] The shape of the reference mark is not limited here and should be determined based on actual business needs. Optionally, if the defect type is halo or trailing, the reference mark should be set to a dot shape; if the defect type is shadow, the reference mark should be set to a rectangle.

[0047] Figure 3 This is a schematic diagram of the reference markings provided according to Embodiment 1 of this application. Figure 3 Part (a) in the text corresponds to the case where the defect type is halo and / or tail. Figure 3 Part (b) corresponds to the case where the defect type is ghosting. The five highlighted areas distributed at the center and four corners of the image in part (a) serve as reference markers. The highlighted rectangle located at the center of the image in part (b) serves as the reference marker. It is worth noting that... Figure 3 The reference marks shown are for illustrative purposes only and do not limit the technical solution of this application.

[0048] In an optional embodiment, determining the test area in the test image based on the reference mark corresponding to the test image and the defect type corresponding to the reference mark includes: if the defect type corresponding to the reference mark is the halo or the trailing, then taking the center of the region of the reference mark as a reference, extracting rectangular regions in the test image along at least two predetermined directions; and determining the extracted rectangular regions as the test areas in the test image; wherein the length of the short side of the test area is less than or equal to the width of the reference mark, and the length of the long side is less than or equal to the distance between two adjacent reference marks.

[0049] When the defect type corresponding to the reference mark is halo or tail, the center of the reference mark area is used as the reference, optionally, the center of the reference mark area is used as the center of the test area, and rectangular areas are cropped in the test image along at least two predetermined directions. The cropped rectangular areas are determined as the test area in the test image. Cropping rectangular areas along at least two predetermined directions with the center of the reference mark area as the reference, multi-directional coverage is used to achieve cross-validation of the radial diffusion or directional extension features of the halo or tail, avoiding missed detections caused by single-directional sampling.

[0050] The specific number and orientation of the predetermined directions are determined based on actual business needs and are not limited here. Higher evaluation accuracy in actual business needs requires more predetermined directions. Generally, using the test image as a reference, directions parallel to the horizontal and vertical boundaries of the image can be set as predetermined directions. For applications requiring higher evaluation accuracy, directions parallel to the main and secondary diagonals of the image can be further added as predetermined directions.

[0051] In this design, the shorter side of the test area is less than or equal to the width of the reference mark. This forces the narrow boundary of the test area to precisely match the physical size of the reference mark, effectively suppressing background noise interference and providing a clean data source for the grayscale distribution curve. The longer side is less than or equal to the distance between two adjacent reference marks. It is important to note that the test area cannot extend beyond the image boundary of the test image. This prevents region overlap and constrains the analysis scale within the optical path of adjacent marks, preserving the complete extension characteristics of the defect while avoiding cross-mark interference.

[0052] Figure 4 This is a schematic diagram showing the determination of the test area according to the embodiments of this application. Figure 3 Based on part (a), the following explanation is given regarding the reference marker located at the center of the image. With the direction parallel to the horizontal and vertical boundaries of the image set as a predetermined direction, the extracted test area is as follows: Figure 4 The red rectangle in section (a) shows the sampled test area. With the directions parallel to the main and secondary diagonals of the image added as predetermined directions, the extracted test area is as follows: Figure 4 The red rectangle in section (b) is shown.

[0053] The above technical solution provides a practical test area determination scheme for cases where the defect type is halo or trailing. Through directional interception and size constraint mechanism, it significantly improves the positioning accuracy and feature extraction efficiency of defect detection.

[0054] In an optional embodiment, determining the test area in the test image based on the reference mark corresponding to the test image and the defect type corresponding to the reference mark includes: if the defect type corresponding to the reference mark is the ghosting, then a rectangular area obtained by cropping along the ghosting direction in the test image with the center of the region of the reference mark as the reference is determined as the test area in the test image; or, a rectangular area obtained by cropping along the vertical boundary of the image with the center of the region of the reference mark as the reference is used as the initial area; the initial area is rotated at least twice with the reference area as the rotation center at a set angle to obtain at least two supplementary areas; the initial area and the at least two supplementary areas are determined as the test area in the test image; wherein the length of the short side of the test area is less than or equal to the length of the reference mark.

[0055] When the defect type is a ghosting, determining the direction of the test area requires further consideration of whether the ghosting direction is known.

[0056] When the direction of the motion blur is known, a rectangular area is cropped from the test image along the direction of the motion blur, using the center of the reference mark as a reference. This rectangular area is defined as the test region in the test image. The test region should cover the motion blur area as much as possible, but the length of the long side of the test region must not exceed the image boundary of the test image. The length of the short side of the test region is less than or equal to the length of the reference mark, forcing the narrow boundary of the test region to strictly match the physical scale of the mark and suppressing irrelevant background noise.

[0057] The approach of directly truncating a rectangular area along the trailing direction precisely aligns with the physical extension path of the defect, ensuring that the test area fully covers the typical attenuation gradient of the trailing shadow and avoiding feature loss due to directional deviation.

[0058] When the direction of the motion blur is unknown, firstly, using the center of the reference mark's region as a reference, optionally, the center of the reference mark's region as the starting boundary of the test region, a rectangular region is cropped from the test image along the vertical boundary of the image as the initial region. The initial region is a rectangular area cropped along the horizontal boundary of the image, using the center of the reference mark's region as a reference. This rectangular region serves as the basic observation window, covering the horizontal edge region of the reference mark and capturing horizontal grayscale abrupt changes.

[0059] Then, the initial region is rotated at least twice around the center of the reference mark region at a set angle to obtain at least two supplementary regions. The preset angle is determined based on actual business needs and is not limited here. There are at least two supplementary regions; the specific number of supplementary regions is not limited here but determined based on actual business needs. A supplementary region refers to at least two rectangular regions with different orientations obtained by rotating the initial region multiple times around the same reference mark region center at a set angle. This design of generating supplementary regions through multi-angle rotation can construct multi-directional detection channels, effectively solving the detection problem when the motion blur direction is unknown or there is multi-directional blur, and significantly improving the generalization ability in complex scenes. Optionally, the initial region and supplementary regions can be defined as test regions in the test image.

[0060] The above technical solution, through directional sampling and multi-angle coverage strategies, forms a complementary detection paradigm for trailing defects with known and unknown trailing directions or multiple directions, which significantly optimizes the ability to capture trailing defects and the robustness of detection.

[0061] In an optional embodiment, determining the grayscale distribution curve corresponding to the test area based on the grayscale values ​​corresponding to the pixels in the test area includes: grouping the pixels in the test area into columns in a direction perpendicular to the extension of the test area, and numbering the pixel groups to obtain the pixel indices corresponding to the pixels in the test area; and using the pixel indices and the grayscale mean corresponding to the pixel indices as the abscissa and ordinate of the grayscale distribution curve, respectively, to draw the grayscale distribution curve corresponding to the test image.

[0062] Optionally, the test area is a rectangular region. The longer side extends along the test area, and the shorter side extends perpendicularly to it. Pixels in the test area are grouped column-wise along the shorter side, with each column forming a pixel group. The pixel groups are then numbered sequentially along the longer side to obtain the pixel indices corresponding to the pixels in the test area. In other words, pixels within a pixel group share the same pixel index. A pixel index is a unique location identifier for a pixel in the test image, used to establish the correspondence between grayscale values ​​and spatial locations.

[0063] The average grayscale value of a pixel group is obtained by averaging the grayscale values ​​of the pixels within that group. The average grayscale value of a pixel group is then correlated with its corresponding pixel index to determine the average grayscale value for that pixel index.

[0064] Using the pixel index as the x-axis and the mean gray level corresponding to the pixel index as the y-axis, a gray-level distribution curve is plotted for the test area.

[0065] The above technical solution significantly improves the efficiency and accuracy of defect analysis through vertical segmentation and grayscale compression. By vertically grouping pixels along the extension direction of the test area, the two-dimensional image space is compressed into a one-dimensional computable sequence. A grayscale distribution curve is then plotted based on the pixel index and the corresponding grayscale mean, allowing the grayscale distribution curve to simultaneously carry statistical features and spatial location information, providing data support for subsequent defect identification and quantification. The grayscale mean corresponding to the pixel grouping effectively suppresses single-pixel noise interference, highlighting the macroscopic grayscale change patterns caused by defects. This strengthens the robustness of defect feature extraction while compressing the data volume, ultimately achieving efficient and high-confidence quantitative identification.

[0066] Example 2

[0067] Figure 5 This is a flowchart of the imaging quality assessment method for diffractive waveguides provided in Embodiment 2. This embodiment is a further optimization based on the above embodiments.

[0068] like Figure 5 As shown, the method includes:

[0069] S210. Based on the reference mark corresponding to the test image and the defect type corresponding to the reference mark, determine the test area in the test image; wherein, the test image is transmitted by the diffractive waveguide under test as an optical channel; the defect type includes at least one of: halo, trailing, and shadow.

[0070] S220. Based on the grayscale values ​​corresponding to the pixels in the test area, determine the grayscale distribution curve corresponding to the test area.

[0071] S230. If the defect type is the halo or the trailing, then based on the upper and lower limits of the preset grayscale range, determine the target pixels whose grayscale values ​​are between the upper and lower limits of the range on both sides of the maximum value of the grayscale distribution curve.

[0072] Wherein, the upper limit of the interval is n times the maximum value in the grayscale distribution curve, and the lower limit of the interval is m times the maximum value in the grayscale distribution curve, where n is [0.5, 1) and m is (0, 0.5). The specific values ​​of n and m are not limited here and are determined according to business needs. For example, n is 0.9 and m is 0.1. When the maximum value in the grayscale distribution curve is 255, the upper limit of the interval is 255 × 0.9 = 229.5, and the lower limit of the interval is 255 × 0.1 = 25.5. The method of setting the upper and lower limits of the interval provided in this application can ensure that even if the test image has a certain degree of overexposure, the halo and trailing in the test image can be accurately identified.

[0073] Figure 6 This is a schematic diagram of a target pixel determination scheme provided according to an embodiment of this application. Figure 6 The curve shown is the grayscale distribution curve of the test area. The horizontal axis of the curve is the pixel index, and the vertical axis is the grayscale value. Target pixels with grayscale values ​​between the upper and lower limits of the interval on both sides of the maximum value are indicated by red curly braces.

[0074] In this system, the grayscale value of the target pixel lies between the lower and upper limits of the interval, and it is the defect feature pixel corresponding to the halo and / or trailing defects. The target pixel is uniquely identified by its pixel index. The grayscale distribution curve is a convex function. By comparing the ordinate of the grayscale curve with the preset grayscale interval, the target pixels whose grayscale values ​​lie between the upper and lower limits of the interval are determined on both sides of the maximum value of the grayscale distribution curve.

[0075] S240. Based on the correspondence between the pixel index in the grayscale distribution curve and the pixel position in the test area, determine the target pixel in the test area.

[0076] The pixel index is determined based on the distribution position of pixels in the test area. Taking the correspondence between the pixel index in the grayscale distribution curve and the pixel position in the test area as a reference, the pixel index of the target pixel can be used to locate the target pixel in the test area.

[0077] S250. Based on the target pixels in the test area, determine the trailing direction and halo intensity in the test image.

[0078] Based on the distribution of target pixels in the test area, the extension length of the light spot relative to the test area can be determined, and the extension direction can be used to further distinguish between halos and trails. Trails appear as directional artifacts in the test image; simply put, when trails occur, the light spot extends in one direction, while when halos occur, the light spot spreads out evenly in all directions.

[0079] The extension direction of the test area provides a physical spatial reference, and the trailing direction can be quantified based on the extension direction of the test area.

[0080] This application's technical solution utilizes a set multiple interval to weight the maximum value in the grayscale distribution curve, generating upper and lower limits for the interval. This replaces the traditional fixed threshold method, allowing the selection of target pixels to flexibly adapt to changes in overall brightness and contrast of different images, enhancing robustness to fluctuations in lighting conditions. By establishing a mapping relationship between pixel indices and physical locations, abstract grayscale statistical information is accurately transformed into the actual spatial distribution of target pixels in the test area, laying the foundation for subsequent spatial feature analysis of defects. Finally, by combining the extension direction of the test area with the distribution location of target pixels, the morphological differences between halos and trails can be effectively distinguished. This not only achieves accurate classification and identification of two similar high-brightness defects but also directly outputs quantitative indicators with engineering value, namely halo intensity and trail direction, providing intuitive and operable key data for production process diagnosis and product quality control.

[0081] In an optional embodiment, determining the trailing direction and halo intensity in the test image based on the target pixels in the test area includes: determining the direction in which the target pixels in the test area extend the longest as the trailing direction in the test image; determining the target pixels corresponding to the trailing direction as trailing pixels, and determining the trailing intensity in the test image based on the number of pixels and the pixel size of the trailing pixels; determining the other pixels in the target pixels besides the trailing pixels as halo pixels, and determining the halo intensity of the test image based on the number of pixels and the pixel size of the halo pixels.

[0082] The extension length of the target pixel in the test region can be determined based on the index span of the pixel index; the larger the index span, the longer the extension length of the target pixel in the test region. The direction in which the target pixel extends the longest in the test region is determined as the trailing direction in the test image.

[0083] The target pixels corresponding to the trailing direction are defined as trailing pixels, which are target pixels located in the trailing direction. The trailing intensity in the test image is determined based on the number and size of the trailing pixels. The pixel size is related to the resolution of the test image.

[0084] The target pixels include halo pixels in addition to trailing pixels. Optionally, all pixels in the target pixels other than trailing pixels can be designated as halo pixels. The pixel index of the halo pixels determines the pixel span corresponding to the halo in the test image, and the pixel span determines the number of halo pixels. The pixel size of the test image is determined according to its resolution, thus obtaining the pixel size of the halo pixels.

[0085] The intensity of the light source in the test image is determined based on the number of pixels and the pixel size of the halo pixels.

[0086] For example, based on the pixel index of the halo pixels, the pixel spans corresponding to the halo in the test image are determined to be 100, 98, and 102, respectively. Therefore, the average number of halo pixels can be determined to be... The halo intensity in the test image is determined by multiplying the average number of halo pixels by the pixel size of the halo pixels.

[0087] The above technical solution intelligently distinguishes between two types of high-brightness defects—trailing and halo—based on the physical distribution characteristics of target pixels. It uses the longest extension direction as the criterion for determining the trailing direction, accurately capturing the morphological essence of linear defects. By establishing a pixel reuse mechanism, trailing pixels are first extracted to calculate the trailing intensity, quantifying the scale of abnormal brightness aggregation using pixel count and pixel size. The remaining target pixels are then automatically classified as halo pixels, achieving simultaneous output of parameters for both types of defects in a single detection. The halo intensity is quantified based on the pixel count and pixel size of the halo pixels. While ensuring the accuracy of defect classification, it outputs three-dimensional quantitative indicators for trailing direction, trailing intensity, and halo intensity, forming a comprehensive process diagnostic data chain covering defect morphology, scale, and location.

[0088] Example 3

[0089] Figure 7 This is a flowchart of the imaging quality assessment method for diffractive waveguides provided in Embodiment 3. This embodiment is a further optimization based on the above embodiments.

[0090] like Figure 7 As shown, the method includes:

[0091] S310. Based on the reference mark corresponding to the test image and the defect type corresponding to the reference mark, determine the test area in the test image; wherein, the test image is transmitted by the diffractive waveguide under test as an optical channel; the defect type includes at least one of: halo, trailing, and ghosting.

[0092] S320. Based on the grayscale values ​​corresponding to the pixels in the test area, determine the grayscale distribution curve corresponding to the test area.

[0093] S330. If the defect type is the ghosting, then based on the pixel index in the grayscale distribution curve, the grayscale values ​​corresponding to adjacent pixels are differentially calculated to obtain the grayscale difference curve corresponding to the test area.

[0094] Motion trails appear as bands of gradually changing brightness, with a noticeable grayscale gradient parallel to the direction of the trail. The grayscale values ​​of adjacent pixels in the motion trail region change smoothly but continuously. Differential operations can amplify these subtle changes, generating differential curves with distinct peaks or peaks.

[0095] The gray-level difference curve is a curve generated by calculating the difference in gray-level values ​​corresponding to adjacent pixel indices. It is used to quantify the intensity of gray-level abrupt changes between adjacent pixels, highlighting the edge transition features of motion blur. The horizontal axis of the gray-level difference curve represents the pixel index, and the vertical axis represents the gray-level difference corresponding to that pixel index.

[0096] S340. Based on the trough positions in the gray-level difference curve and the pixel indices in the gray-level difference curve and the correspondence between the pixel indices and the pixel positions in the test area, determine the trailing region in the test image.

[0097] In this context, the trough position in the gray-level difference curve refers to the pixel index corresponding to the local minimum point on the gray-level difference curve. The brightness distribution of the trail exhibits a trapezoidal characteristic, with abrupt changes in gray-level at both boundaries corresponding to the peak positions of the gray-level difference curve, and uniform gray-level in the central area corresponding to the trough positions of the gray-level difference curve.

[0098] The correspondence between pixel indices and pixel positions in the test area is used to convert the pixel indices corresponding to valley positions into physical spatial positions. Locating the ghosting region through valley values ​​can exclude non-ghosting highlight areas. By detecting multiple valley positions, it is possible to simultaneously locate multiple ghosting areas. Here, the ghosting region refers to the area in the test image where ghosting defects occur.

[0099] Figure 8 The grayscale distribution curve and grayscale difference curve used for identifying and quantizing the trailing effect according to embodiments of this application are provided. Figure 8Part (a) shows the grayscale distribution curve of the test area when the defect type is ghosting. Figure 8 Part (b) is the gray-level difference curve obtained by performing a difference operation on the gray-level distribution curve shown in part (a). The positions marked by the red dashed lines in parts (a) and (b) are the trough positions.

[0100] S350. Based on the gray value corresponding to the valley position and the maximum value in the gray value distribution curve, determine the motion blur intensity in the test image.

[0101] The maximum value in the grayscale distribution curve represents the grayscale baseline of the brightest part within the test area. Motion intensity is an indicator used to quantify the significance of motion blur; a higher intensity value indicates a slower decay of motion blur brightness and a more severe motion blur. Motion intensity depends on the level of residual brightness in the central area.

[0102] Optionally, if there are at least two trough positions, the gray values ​​corresponding to each trough position are averaged, and the ratio of the average gray value to the maximum value in the gray distribution curve is determined as the motion blur intensity in the test image.

[0103] This application's technical solution generates a gray-level difference curve based on the gray-level difference between adjacent pixels, transforming the unique gradient characteristics of motion blur into quantifiable trough morphological features, thus improving the accuracy of motion blur defect detection. Utilizing the trough positions as natural markers of the core transition zone of the motion blur, and based on the correspondence between pixel indices and pixel positions in the test area, it achieves a precise conversion from abstract curves to physical coordinates. This not only calibrates the spatial range of the motion blur region but also avoids interference from isolated noise points. The motion blur intensity is quantified by using the gray-level value corresponding to the trough position and the maximum value in the gray-level distribution curve, reflecting both the absolute level of the residual brightness of the motion blur and eliminating the influence of overall image brightness fluctuations. This application's technical solution reduces the complexity of motion blur recognition, localization, and quantization while improving the accuracy of motion blur detection.

[0104] In an optional embodiment, after determining the trailing region in the test image, the method further includes: filtering the trailing region to obtain a significant region based on a preset grayscale threshold and the grayscale values ​​corresponding to the pixels in the trailing region; and updating the trailing region in the test image based on the significant region.

[0105] The preset grayscale threshold is used to filter out motion blur areas and is a grayscale threshold specifically designed for these areas. The preset grayscale threshold is W times the maximum value in the grayscale distribution curve, where W is (0, 0.5). The specific value of W is not limited here and is determined based on actual business needs. For example, W is 0.2. When the maximum value in the grayscale distribution curve is 255, the preset grayscale threshold is 255 × 0.2 = 51.

[0106] Optionally, the average grayscale values ​​of the pixels in the trailing region are taken to obtain the mean grayscale value of the trailing region. Trailing regions with a mean grayscale value greater than or equal to a preset grayscale threshold are identified as salient regions. A salient region refers to a trailing region with significant visual impact. Salient regions are used as trailing regions in the test image, while trailing regions with a mean grayscale value less than the preset grayscale threshold are removed to eliminate positioning errors during the initial localization of trailing regions, such as removing normal dark areas that are mistakenly identified as trailing regions.

[0107] The aforementioned technical solution utilizes a preset grayscale threshold to perform secondary screening of the motion blur region, effectively eliminating weak motion blur or noise interference with substandard grayscale values, and accurately identifying salient regions with significant visual impact. This screening process significantly reduces the false detection rate and avoids meaningless processing of non-salient artifacts. The global motion blur region is updated in reverse based on high-confidence salient regions, achieving dynamic optimization and focusing of the motion blur region. This not only significantly improves the accuracy of the final motion blur region location but also greatly reduces the computational load of subsequent processing by eliminating a large number of non-critical pixels, optimizing the overall execution efficiency of the algorithm while ensuring the complete preservation of core motion blur features.

[0108] Example 4

[0109] Figure 9 This is a schematic diagram of the imaging quality evaluation device for diffractive waveguides provided in Embodiment 4 of this application. This embodiment is applicable to the evaluation of the imaging quality of diffractive waveguides. The device is implemented by software and / or hardware and can be integrated into electronic devices such as smart terminals.

[0110] like Figure 9 As shown, the imaging quality assessment device 400 for diffractive waveguides may include:

[0111] The test area determination module 410 is used to determine the test area in the test image based on the reference mark corresponding to the test image and the defect type corresponding to the reference mark; wherein the test image is transmitted by the diffraction waveguide under test as the optical channel;

[0112] The grayscale distribution determination module 420 is used to determine the grayscale distribution curve corresponding to the test area based on the grayscale values ​​corresponding to the pixels in the test area.

[0113] The defect identification and quantization module 430 is used to identify and quantify the defect types present in the test image based on the grayscale distribution curve and the defect detection algorithm corresponding to the defect type; wherein, the defect type includes at least one of: halo, trailing and shadow.

[0114] This application's technical solution locates the test area by setting reference marks corresponding to the defect type in the test image, avoiding the computational redundancy of full-image scanning. This enables on-demand defect detection, significantly improving the targeting and efficiency of the detection. A grayscale distribution curve is constructed based on the grayscale values ​​of pixels within the test area, transforming subjective optical defect phenomena such as halos, trailing, and ghosting into objective, quantifiable data representations, providing a precise basis for assessing defect severity. This application employs defect detection algorithms matched to the characteristics of different defect types, such as halos, trailing, and ghosting, for defect identification and quantification. This differentiated processing mechanism significantly improves the accuracy and reliability of defect identification. It achieves a high degree of automation from area localization and feature extraction to defect judgment, reducing the manual cost of defect detection. The defect quantification results obtained in this application can directly serve the diagnosis and optimization loop of the production process, contributing to the continuous improvement of the manufacturing quality of diffractive waveguides.

[0115] Optionally, if the defect type is the halo or the trailing effect, the reference marker is distributed at any position in the test image; if the defect type is the ghosting effect, the reference marker is distributed at the center of the test image.

[0116] Optionally, the test area determination module 410 includes: a first area extraction submodule, used to extract rectangular areas in the test image along at least two predetermined directions, based on the center of the area of ​​the reference mark, if the defect type corresponding to the reference mark is the halo or the trailing effect; the first test area determination submodule is used to determine the extracted rectangular areas as the test areas in the test image; wherein the length of the short side of the test area is less than or equal to the width of the reference mark, and the length of the long side is less than or equal to the distance between two adjacent reference marks.

[0117] Optionally, the test area determination module 410 includes: a second area extraction submodule, configured to determine a rectangular area extracted along the shadow direction in the test image, with the center of the area of ​​the reference mark as the reference, as the test area in the test image if the defect type corresponding to the reference mark is the ghosting; or, an initial area determination submodule, configured to take a rectangular area extracted along the vertical boundary of the image in the test image, with the center of the area of ​​the reference mark as the reference, as the initial area; an initial area rotation submodule, configured to rotate the initial area at least twice with the reference area as the rotation center at a set angle to obtain at least two supplementary areas; and a second test area determination submodule, configured to determine the initial area and the at least two supplementary areas as the test area in the test image; wherein the length of the short side of the test area is less than or equal to the length of the reference mark.

[0118] Optionally, the defect identification quantization module 430 includes: a first pixel determination submodule, used to determine, based on the upper and lower limits of a preset grayscale interval, a target pixel whose grayscale value is between the upper and lower limits of the grayscale distribution curve on both sides of the maximum value; a second pixel determination submodule, used to determine the target pixel in the test area based on the correspondence between the pixel index in the grayscale distribution curve and the pixel position in the test area; and a halo and trailing identification submodule, used to determine the trailing direction and halo intensity in the test image based on the target pixel in the test area; wherein the upper limit of the interval is n times the maximum value in the grayscale distribution curve, and the lower limit of the interval is m times the maximum value in the grayscale distribution curve, where n is [0.5, 1) and m is (0, 0.5).

[0119] Optionally, the halo and trailing recognition submodule includes: a trailing direction determination unit, used to determine the direction in which the target pixel in the test area extends the longest as the trailing direction in the test image; a trailing intensity determination unit, used to determine the target pixel corresponding to the trailing direction as the trailing pixel, and determine the trailing intensity in the test image based on the number of pixels and the pixel size of the trailing pixel; and a halo intensity quantization unit, used to determine the other pixels in the target pixel besides the trailing pixel as halo pixels, and determine the halo intensity of the test image based on the number of pixels and the pixel size of the halo pixels.

[0120] Optionally, the defect identification quantization module 430 further includes: a gray-level difference calculation submodule, used to perform difference calculation on the gray-level values ​​corresponding to adjacent pixels based on the pixel index in the gray-level distribution curve if the defect type is the ghosting, to obtain a gray-level difference curve corresponding to the test area; a ghosting region determination submodule, used to determine the ghosting region in the test image based on the trough position in the gray-level difference curve and the correspondence between the pixel index in the gray-level difference curve and the pixel position in the test area; and a ghosting intensity determination submodule, used to determine the ghosting intensity in the test image based on the gray-level value corresponding to the trough position and the maximum value in the gray-level distribution curve.

[0121] Optionally, the device further includes: a salient region determination module, configured to, after determining the trailing region in the test image, filter the trailing region to obtain a salient region based on a preset grayscale threshold and the grayscale value corresponding to the pixel in the trailing region; and a trailing region update module, configured to update the trailing region in the test image based on the salient region.

[0122] Optionally, the grayscale distribution determination module 420 includes: a pixel index determination submodule, used to group the pixels in the test area in a column-by-column direction perpendicular to the extension direction of the test area, and number the pixel groups to obtain the pixel index corresponding to the pixels in the test area; and a grayscale distribution determination submodule, used to draw the grayscale distribution curve corresponding to the test image by using the pixel index and the grayscale mean corresponding to the pixel index as the horizontal and vertical coordinates of the grayscale distribution curve, respectively.

[0123] The imaging quality assessment device for diffractive waveguides provided in the embodiments of the invention can execute the imaging quality assessment method for diffractive waveguides provided in any embodiment of this application, and has the corresponding performance modules and beneficial effects for executing the imaging quality assessment method for diffractive waveguides.

[0124] Example 5

[0125] According to embodiments of this application, this application also provides an electronic device, a readable storage medium, and a computer program product.

[0126] Figure 10 A schematic diagram of an electronic device 510, which can be implemented using an embodiment, is shown. The electronic device 510 includes at least one processor 511 and a memory, such as a read-only memory (ROM) 512, a random access memory (RAM) 513, etc., communicatively connected to the at least one processor 511. The memory stores computer programs executable by the at least one processor. The processor 511 can perform various appropriate actions and processes based on the computer program stored in the ROM 512 or loaded from storage unit 518 into the RAM 513. The RAM 513 may also store various programs and data required for the operation of the electronic device 510. The processor 511, ROM 512, and RAM 513 are interconnected via a bus 514. An input / output (I / O) interface 515 is also connected to the bus 514.

[0127] Multiple components in electronic device 510 are connected to I / O interface 515, including: input unit 516, such as keyboard, mouse, etc.; output unit 517, such as various types of displays, speakers, etc.; storage unit 518, such as disk, optical disk, etc.; and communication unit 519, such as network card, modem, wireless transceiver, etc. Communication unit 519 allows electronic device 510 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0128] Processor 511 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 511 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 511 performs the various methods and processes described above, such as the imaging quality assessment method for diffractive waveguides.

[0129] In some embodiments, the imaging quality assessment method for diffractive waveguides can be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 518. In some embodiments, part or all of the computer program can be loaded and / or mounted on electronic device 510 via ROM 512 and / or communication unit 519. When the computer program is loaded into RAM 513 and executed by processor 511, one or more steps of the imaging quality assessment method for diffractive waveguides described above can be performed. Alternatively, in other embodiments, processor 511 can be configured to perform the imaging quality assessment method for diffractive waveguides by any other suitable means (e.g., by means of firmware).

[0130] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0131] Computer programs used to implement the methods of this application may be written in any combination of one or more programming languages. These computer programs may be provided to the processor of a general-purpose computer, a special-purpose computer, or other programmable diffractive waveguide imaging quality assessment device, such that when executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0132] In the context of this application, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0133] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0134] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., an imaging quality assessment server acting as a diffractive waveguide), or middleware components (e.g., an application server), or frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication (e.g., a communication network) of any form or medium. Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0135] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0136] This application also discloses a computer program product, which includes a computer program that, when executed by a processor, implements the imaging quality assessment method for diffractive waveguides provided in any embodiment of this application. This program product shares the same inventive concept as the imaging quality assessment methods for diffractive waveguides disclosed in the embodiments of this application, and therefore will not be described in detail here.

[0137] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this application can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this application can be achieved, and this is not limited herein.

[0138] The specific embodiments described above do not constitute a limitation on the scope of protection of this application. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the scope of protection of this application.

Claims

1. A method for evaluating the imaging quality of a diffractive waveguide, characterized in that, The method includes: Based on the reference mark corresponding to the test image and the defect type corresponding to the reference mark, a test area is determined in the test image; wherein, the test image is transmitted by the diffractive waveguide under test as the optical channel; Based on the gray values ​​corresponding to the pixels in the test area, determine the gray distribution curve corresponding to the test area; Based on the grayscale distribution curve and the defect detection algorithm corresponding to the defect type, the defect types present in the test image are identified and quantified; wherein, the defect types include at least one of: halo, trailing, and ghosting.

2. The method according to claim 1, characterized in that, If the defect type is the halo or the trailing effect, the reference marker is distributed at any position in the test image; if the defect type is the ghosting effect, the reference marker is distributed at the center of the test image.

3. The method according to claim 1 or 2, characterized in that, The step of determining the test area in the test image based on the reference markers corresponding to the test image and the defect types corresponding to the reference markers includes: If the defect type corresponding to the reference mark is the halo or the trailing, then rectangular areas are respectively cut out in the test image along at least two predetermined directions, with the center of the region of the reference mark as the reference. The captured rectangular region is defined as the test region in the test image; wherein the length of the short side of the test region is less than or equal to the width of the reference mark, and the length of the long side is less than or equal to the distance between two adjacent reference marks.

4. The method according to claim 1 or 2, characterized in that, The step of determining the test area in the test image based on the reference markers corresponding to the test image and the defect types corresponding to the reference markers includes: If the defect type corresponding to the reference mark is the trailing shadow, then the rectangular area obtained by cropping along the trailing shadow direction in the test image, with the center of the area of ​​the reference mark as the reference, will be determined as the test area in the test image; or... The initial region is a rectangular region obtained by cropping the test image along the vertical boundary of the image, with the center of the region marked by the reference point as the reference. The initial region is rotated at least twice around the reference region as the rotation center at a set angle to obtain at least two supplementary regions. The initial region and the at least two supplementary regions are determined as the test region in the test image; Wherein, the length of the shorter side of the test area is less than or equal to the length of the reference mark.

5. The method according to claim 1, characterized in that, The method of identifying and quantifying the defect types present in the test image based on the grayscale distribution curve and the defect detection algorithm corresponding to the defect type includes: If the defect type is the halo or the trailing, then based on the upper and lower limits of the preset grayscale range, the target pixels whose grayscale values ​​are between the upper and lower limits of the range on both sides of the maximum value of the grayscale distribution curve are determined. Based on the correspondence between the pixel index in the grayscale distribution curve and the pixel position in the test area, the target pixel in the test area is determined; Based on the target pixels in the test area, determine the trailing direction and halo intensity in the test image; Wherein, the upper limit of the interval is n times the maximum value in the gray-scale distribution curve, and the lower limit of the interval is m times the maximum value in the gray-scale distribution curve, where n is [0.5, 1) and m is (0, 0.5).

6. The method according to claim 5, characterized in that, Determining the trailing direction and halo intensity in the test image based on the target pixels in the test area includes: The direction in which the target pixel extends the longest in the test area is determined as the trailing direction in the test image; The target pixel corresponding to the trailing direction is determined as the trailing pixel, and the trailing intensity in the test image is determined based on the number of pixels and the pixel size of the trailing pixel. The pixels other than the trailing pixels in the target pixels are identified as halo pixels, and the halo intensity of the test image is determined based on the number and size of the halo pixels.

7. The method according to claim 1, characterized in that, The method for identifying and quantifying the defect types present in the test image based on the grayscale distribution curve and the defect detection algorithm corresponding to the defect type further includes: If the defect type is the ghosting, then based on the pixel index in the grayscale distribution curve, the grayscale values ​​corresponding to adjacent pixels are differentially calculated to obtain the grayscale difference curve corresponding to the test area. Based on the trough positions in the gray-level difference curve and the pixel indices in the gray-level difference curve and the correspondence between the pixel indices and the pixel positions in the test area, the trailing regions in the test image are determined. The intensity of the motion blur in the test image is determined based on the gray value corresponding to the valley position and the maximum value in the gray value distribution curve.

8. The method according to claim 7, characterized in that, After determining the ghosting region in the test image, the method further includes: Based on a preset grayscale threshold and the grayscale values ​​corresponding to pixels in the trailing region, the trailing region is filtered to obtain a significant region; Based on the salient region, the trailing region in the test image is updated.

9. The method according to claim 1, characterized in that, The step of determining the grayscale distribution curve corresponding to the test area based on the grayscale values ​​corresponding to the pixels in the test area includes: In a direction perpendicular to the test area, the pixels in the test area are grouped by column, and the pixel index corresponding to the pixel in the test area is obtained by numbering the pixel group. The pixel index and the mean gray level corresponding to the pixel index are used as the horizontal and vertical coordinates of the gray level distribution curve, respectively, to plot the gray level distribution curve corresponding to the test image.

10. An imaging quality assessment device for a diffractive waveguide, characterized in that, The device includes: The test area determination module is used to determine the test area in the test image based on the reference mark corresponding to the test image and the defect type corresponding to the reference mark; wherein the test image is transmitted by the diffraction waveguide under test as the optical channel; The grayscale distribution determination module is used to determine the grayscale distribution curve corresponding to the test area based on the grayscale values ​​corresponding to the pixels in the test area. The defect identification and quantization module is used to identify and quantify the defect types present in the test image based on the grayscale distribution curve and the defect detection algorithm corresponding to the defect type; wherein the defect types include at least one of: halo, trailing and shadow.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by the processor, the program implements the imaging quality assessment method for diffractive waveguides as described in any one of claims 1-9.

12. An electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the imaging quality assessment method for the diffractive waveguide as described in any one of claims 1-9.