Methods, apparatus and computer-readable storage media for detecting diffractive optical elements

By calculating the difference between the infrared image to be detected and the standard infrared image, the problem of low DOE quality detection efficiency in infrared camera devices is solved, achieving fast and accurate DOE quality detection and ensuring human eye safety.

CN116152142BActive Publication Date: 2026-03-17TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-23
Publication Date
2026-03-17

AI Technical Summary

Technical Problem

Existing technologies lack effective means for efficient quality inspection of diffractive optical elements (DOEs) in infrared imaging devices, which may cause damage to the human eye when these elements are damaged.

Method used

By acquiring the infrared image to be detected and the standard infrared image, the difference between the two is calculated, and the quality of the diffractive optical element is inspected based on the difference and the preset difference, including dividing the image into sub-images, calculating pixel differences and weighted summation, and determining the detection result.

Benefits of technology

This technology enables rapid and accurate detection of DOE quality in infrared camera devices, improving detection efficiency and avoiding potential harm to the human eye caused by DOE damage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116152142B_ABST
    Figure CN116152142B_ABST
Patent Text Reader

Abstract

This application discloses a method, apparatus, and computer-readable storage medium for detecting diffractive optical elements. The method involves acquiring an infrared image of a target object (an image captured by an infrared camera device, including a diffractive optical element whose quality is to be tested); acquiring a standard infrared image of a target object (an image captured by a standard infrared camera device, including a diffractive optical element that has passed quality assessment); calculating the difference between the target infrared image and the standard infrared image; and performing quality testing on the diffractive optical element based on the difference and a preset difference, thereby obtaining the detection result. This method can significantly improve the efficiency of quality testing for diffractive optical elements.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of optical technology, specifically to a method, apparatus, and computer-readable storage medium for detecting diffractive optical elements. Background Technology

[0002] Facial recognition technology is a biometric identification technology that uses facial features to identify individuals. It is widely used in access control systems, attendance systems, and facial payment systems.

[0003] Facial recognition technology relies on infrared cameras to capture infrared images of faces. These cameras contain diffractive optical elements (DOEs), which not only finely control the phase distribution of the infrared laser wavefront but also reduce the intensity of the infrared laser, preventing damage to the eyes. When the DOE in an infrared camera malfunctions, the emitted infrared laser may pose a risk of eye damage.

[0004] Currently, there is a lack of effective testing methods for quality inspection of DOE. Summary of the Invention

[0005] This application provides a method, apparatus, and computer-readable storage medium for detecting diffractive optical elements. The method for detecting diffractive optical elements can effectively improve the accuracy of detection of diffractive optical elements in a recommendation system.

[0006] The first aspect of this application provides a method for detecting diffractive optical elements, the method comprising:

[0007] Acquire an infrared image to be detected, wherein the infrared image to be detected is an image of a preset object captured by an infrared camera device to be detected, and the infrared camera device to be detected includes a diffractive optical element to be tested with a mass to be tested;

[0008] Acquire a standard infrared image, which is an image of the preset object captured by a standard infrared camera device, the standard infrared camera device including a diffractive optical element that has passed quality assessment;

[0009] Calculate the difference between the infrared image to be detected and the standard infrared image;

[0010] The quality of the diffractive optical element under test is tested based on the difference degree and the preset difference degree to obtain the test result.

[0011] Accordingly, a second aspect of this application provides a detection device for diffractive optical elements, the device comprising:

[0012] The first acquisition unit is used to acquire an infrared image to be detected, wherein the infrared image to be detected is an image obtained by the infrared camera device to be detected capturing a preset object, and the infrared camera device to be detected includes a diffractive optical element whose quality is to be detected.

[0013] The second acquisition unit is used to acquire a standard infrared image, which is an image of the preset object captured by a standard infrared camera device. The standard infrared camera device includes a diffractive optical element that has passed quality assessment.

[0014] A calculation unit is used to calculate the difference between the infrared image to be detected and the standard infrared image;

[0015] The detection unit is used to perform quality detection on the diffractive optical element under test based on the difference degree and the preset difference degree, and obtain the detection result.

[0016] In some embodiments, the computing unit includes:

[0017] The sub-unit is used to divide the infrared image to be detected and the standard infrared image according to the same division rules to obtain multiple sub-images, wherein two sub-images at the same position constitute a sub-image pair;

[0018] A calculation subunit is used to calculate the difference between the infrared image to be detected and the standard infrared image based on the pixel differences between the sub-images contained in each sub-image pair.

[0019] In some embodiments, the computing subunit includes:

[0020] The acquisition module is used to acquire the first difference value in the pixel dimension of the two sub-images contained in each sub-image pair. The first difference value is the number of pixels whose pixel value difference at the same position in the two sub-images is greater than a preset threshold.

[0021] The calculation module is used to calculate the degree of difference between the infrared image to be detected and the standard infrared image based on the first difference value.

[0022] In some embodiments, the computing module includes:

[0023] The first acquisition submodule is used to acquire the weight coefficients of each sub-image pair;

[0024] The first calculation submodule is used to perform a weighted summation calculation on the first difference value based on the weight coefficient to obtain the degree of difference between the infrared image to be detected and the standard infrared image.

[0025] In some embodiments, the first acquisition submodule is further configured to:

[0026] Acquire a first infrared image of a natural scene captured by the standard infrared camera device;

[0027] A second infrared image of the preset object is obtained by the abnormal infrared camera device, and the quality of the diffractive optical element contained in the abnormal infrared camera device is found to be unqualified.

[0028] The first infrared image and the second infrared image are divided according to the division rules, and the first difference degree between the first infrared image and the standard infrared image and the second difference degree between the second infrared image and the standard infrared image are calculated based on the division results and the initial weight coefficients.

[0029] The initial weight coefficients are updated based on the first difference and the second difference to obtain the weight coefficients for each sub-image pair.

[0030] In some embodiments, the detection device for diffractive optical elements provided in this application further includes:

[0031] The second calculation submodule is used to recalculate the third difference degree between the second infrared image and the standard infrared image based on the weighting coefficient and the division result;

[0032] The first determining submodule is used to determine a preset difference degree for quality inspection of the diffractive optical element under test based on the third difference degree.

[0033] In some embodiments, the acquisition module includes:

[0034] The second acquisition submodule is used to acquire the pixel value of each pixel point in the two sub-images contained in each sub-image pair;

[0035] The third calculation submodule is used to calculate the pixel value difference between two corresponding pixels in the two sub-images to obtain multiple pixel value differences for each sub-image pair.

[0036] The second determining submodule is used to determine the number of pixel value differences greater than a preset threshold among the multiple pixel value differences in each sub-image pair, and to obtain the first difference value in the pixel dimension of the two sub-images contained in each sub-image pair.

[0037] In some embodiments, the detection unit includes:

[0038] The first determining subunit is used to determine that the test result of the diffractive optical element under test is unqualified when the difference degree is greater than a preset difference degree;

[0039] The second determining subunit is used to determine that the test result of the diffractive optical element under test is qualified when the difference degree is not greater than the preset difference degree.

[0040] In some embodiments, the detection device for diffractive optical elements provided in this application further includes:

[0041] The transmitting unit is configured to send a control command to the infrared camera device when the detection result indicates that the quality of the diffractive optical element under test is abnormal. The control command is used to instruct the infrared camera device to turn off the infrared laser.

[0042] A third aspect of this application also provides a computer-readable storage medium storing a plurality of instructions adapted for loading by a processor to perform steps in the detection method for a diffractive optical element provided in the first aspect of this application.

[0043] The fourth aspect of this application provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps in the detection method for diffractive optical elements provided in the first aspect of this application.

[0044] The fifth aspect of this application provides a computer program product, including a computer program / instructions, which, when executed by a processor, implement the steps in the detection method for diffractive optical elements provided in the first aspect.

[0045] The method for detecting diffractive optical elements provided in this application involves: acquiring an infrared image to be detected, which is an image of a preset object captured by an infrared camera device, the infrared camera device including a diffractive optical element whose quality is to be tested; acquiring a standard infrared image, which is an image of a preset object captured by a standard infrared camera device, the standard infrared camera device including a diffractive optical element that has passed quality assessment; calculating the difference between the infrared image to be detected and the standard infrared image; and performing quality testing on the diffractive optical element based on the difference and a preset difference to obtain a detection result.

[0046] Therefore, the detection method for diffractive optical elements provided in this application can calculate the pixel difference between the infrared image of the object under test obtained by the infrared camera device under test and a standard infrared image, and further determine whether the optical diffractive element in the infrared camera device under test is damaged based on the comparison result of the actual difference between the two and the preset difference. This method can quickly detect the quality of diffractive optical elements in infrared camera devices, improving the detection efficiency of diffractive optical element quality detection. Attached Figure Description

[0047] 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.

[0048] Figure 1 This is a schematic diagram of a scenario for detecting diffractive optical elements in this application;

[0049] Figure 2 This is a flowchart illustrating the detection method for the diffractive optical element provided in this application;

[0050] Figure 3 This is another schematic diagram of the detection method for the diffractive optical element provided in this application;

[0051] Figure 4 This is a schematic diagram of the structure of the detection device for the diffractive optical element provided in this application;

[0052] Figure 5 This is a schematic diagram of the structure of the computer device provided in this application. Detailed Implementation

[0053] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.

[0054] This invention provides a method, apparatus, and computer-readable storage medium for detecting diffractive optical elements. The detection method can be used in a detection apparatus for diffractive optical elements, which can be integrated into a computer device, which can be a terminal or a server. The terminal can be a mobile phone, tablet computer, laptop computer, smart TV, wearable smart device, personal computer (PC), or infrared camera, etc. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, Content Delivery Network (CDN), and big data and artificial intelligence platforms. The server can also be a node in a blockchain.

[0055] Please see Figure 1 This is a schematic diagram of a scenario for the detection method of diffractive optical elements provided in this application. As shown in the figure, computer device A acquires an infrared image 10 to be detected and a standard infrared image 20. The infrared image 10 is an image of a preset object captured by an infrared camera device, which includes a diffractive optical element whose quality is to be tested. The standard infrared image 20 is an image of the aforementioned preset object captured by a standard infrared camera device, which includes a diffractive optical element that has passed quality assessment. Then, the difference between the infrared image to be detected and the standard infrared image is calculated. Based on the calculated difference and a preset difference, the quality of the diffractive optical element under test is detected to obtain the detection result.

[0056] It should be noted that, Figure 1 The schematic diagram of the detection scenario for diffractive optical elements shown is merely an example. The detection scenario for diffractive optical elements described in the embodiments of this application is intended to more clearly illustrate the technical solution of this application and does not constitute a limitation on the technical solution provided in this application. As those skilled in the art will understand, with the evolution of detection scenarios for diffractive optical elements and the emergence of new business scenarios, the technical solution provided in this application is also applicable to similar technical problems.

[0057] The implementation scenarios described above will be explained in detail below.

[0058] In related technologies, because the infrared laser emitted by the infrared laser emitter mounted in an infrared camera has high energy, the wavefront phase distribution and energy of the infrared laser can be modulated and controlled through the DOE (Distributed Edge Electrode) in the infrared camera to prevent damage to the human eye. Therefore, if a DOE in an infrared camera fails to be detected in time, it can cause eye damage, thus requiring frequent quality checks. Currently, quality checks of the DOE require disassembling the infrared camera for detailed testing, which is highly inefficient.

[0059] Therefore, in order to solve the problem of low efficiency in DOE quality detection, this application provides a method for detecting DOE to improve the detection efficiency of DOE in infrared camera devices.

[0060] This application will describe the embodiments from the perspective of a detection device for diffractive optical elements, which can be integrated into a computer device. The computer device can be a terminal or a server. The terminal can be a mobile phone, tablet computer, laptop computer, smart TV, wearable smart device, personal computer (PC), or infrared camera device, etc. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery network (CDN) acceleration services, and big data and artificial intelligence platforms. Figure 2 The diagram shown is a flowchart illustrating the detection method for the diffractive optical element provided in this application. The method includes:

[0061] Step 101: Obtain the infrared image to be detected.

[0062] In this embodiment of the application, the infrared image to be detected is an infrared image of a preset object captured by an infrared camera device to be detected, and the infrared camera device to be detected includes a diffractive optical element whose quality is to be detected.

[0063] Specifically, the infrared camera device to be detected can be an infrared camera to be detected; the preset object can be any pre-set object, and in some embodiments, the preset object can be a calibration plate; the infrared image obtained by the infrared camera device from the preset object can be an infrared speckle image. The infrared image to be detected can be a single infrared image or multiple infrared images obtained by the infrared camera device from the preset object.

[0064] Step 102: Obtain a standard infrared image.

[0065] The DOE detection method provided in this application mainly involves comparing an infrared image captured by an infrared camera containing the DOE to be detected with a standard infrared image, and determining the quality of the DOE to be detected based on the comparison result.

[0066] The standard infrared image can be an image of a preset object captured by a standard infrared camera device. The DOE in the standard infrared camera device can be a quality-certified and qualified image. The resolution of the infrared images captured by the standard infrared camera device and the infrared camera device under test can be the same.

[0067] In some embodiments, standard infrared images can be captured using a calibration system. This calibration system may include a sliding rail, a servo motor and calibration plate fixedly mounted on the sliding rail, a base connected to and sliding on the sliding rail, a two-degree-of-freedom servo motor mounted on the base and capable of rotating at a certain angle, an infrared camera fixed to the two-degree-of-freedom servo motor, and a computer device connected to the infrared camera for data transmission. Here, the infrared camera is a quality-certified infrared camera, meaning that the DOE element in the infrared camera is of good quality.

[0068] During standard infrared image capture, the distance between the infrared camera and the calibration board can be adjusted by using a servo motor to adjust the position of the base, and the angular relationship between the infrared camera and the calibration board can be adjusted by a two-degree-of-freedom servo motor. Specifically, the standard infrared image can be a single image captured using this calibration system, or multiple infrared images captured at different distances and angles by adjusting the servo motor and the two-degree-of-freedom servo motor. After capturing each infrared image, the infrared camera sends the captured image to a computer for storage and processing.

[0069] The standard infrared image can be a single infrared image obtained by processing multiple infrared images taken at multiple distances and angles. The specific processing method can be to perform a weighted average of the pixel values ​​of each corresponding pixel position.

[0070] Step 103: Calculate the difference between the infrared image to be detected and the standard infrared image.

[0071] After acquiring the infrared image to be detected and the standard infrared image, the difference between the infrared image to be detected and the standard infrared image can be calculated, and the quality of the DOE element to be detected can be determined based on the calculated difference.

[0072] Specifically, the difference calculation between the infrared image to be detected and the standard infrared image can be performed, which can be either a pixel value difference calculation or a depth information difference calculation. The difference calculation can be performed from one or more different dimensions. The dimensions for difference calculation can be determined based on the influence of the DOE's functions on the infrared image parameters.

[0073] In some embodiments, calculating the difference between the infrared image to be detected and a standard infrared image includes:

[0074] 1. Divide the infrared image to be detected and the standard infrared image according to the same division rules to obtain multiple sub-images. Among them, two sub-images at the same position constitute a sub-image pair.

[0075] 2. Calculate the difference between the infrared image to be detected and the standard infrared image based on the pixel differences between the sub-images contained in each sub-image pair.

[0076] In this embodiment of the application, the pixel difference between the infrared image to be detected and the standard infrared image can be calculated by dividing the region, and then the degree of difference between the infrared image to be detected and the standard infrared image can be determined based on the calculated pixel difference between the region.

[0077] Specifically, the infrared image to be detected and the standard infrared image can be divided into multiple sub-images according to the same division rules. The division rules can be arbitrarily set. For example, the bottom edge of each infrared image can be used as the x-axis, and the left side of the infrared image as the y-axis. Then, both infrared images can be divided into 10 equal parts along the x-axis, resulting in 10 rectangular sub-images. Alternatively, each of the aforementioned 10 rectangular sub-images can be divided into 10 equal parts along the y-axis, thus obtaining 100 rectangular sub-images. It is understood that the two division methods exemplified above are regular divisions. In this embodiment, the infrared image to be detected and the standard infrared image can also be divided using an irregular division method to obtain multiple sub-images.

[0078] Since the infrared image to be detected and the standard infrared image have the same resolution and are divided using the same method, the resulting sub-images can be matched one-to-one according to their positions in the original image, with each pair of corresponding sub-images forming a sub-image pair. When the division method between the infrared image to be detected and the standard infrared image is regular, the corresponding two sub-images can be determined based on the coordinates of each sub-image (e.g., the center coordinates are the same). When the division method between the infrared image to be detected and the standard infrared image is irregular, the corresponding two sub-images can be determined based on the shape of each sub-image (e.g., the shapes are the same).

[0079] Then, for each sub-image pair, the pixel difference between the two sub-images contained in the sub-image pair can be calculated, and the difference between the infrared image to be detected and the standard infrared image can be calculated based on the pixel difference between the two sub-images.

[0080] The calculation of pixel differences between two sub-images within a sub-image pair can be either calculating the difference between the average pixel values ​​of all pixels in the sub-images, or calculating the number of pixels in the two sub-images whose corresponding pixel values ​​have a preset difference. A pixel value is a value assigned by the computer when an image is digitized; it represents the average brightness information of a small square (pixel) in the image. Popular image processing software typically uses an 8-bit binary number to represent the pixel value, meaning the pixel value is between 0 and 255.

[0081] In some embodiments, calculating the difference between the infrared image to be detected and the standard infrared image based on the pixel differences between the sub-images contained in each sub-image pair includes:

[0082] 2.1 Obtain the first difference value in the pixel dimension of the two sub-images contained in each sub-image pair. The first difference value is the number of pixels whose pixel value difference at the same position in the two sub-images is greater than a preset threshold.

[0083] 2.2 Calculate the degree of difference between the infrared image to be detected and the standard infrared image based on the first difference value.

[0084] In this embodiment, the pixel difference between two sub-images can be determined based on the number of pixels whose pixel values ​​differ from each other in the corresponding pixels of the two sub-images in a sub-image pair. Then, the difference between the infrared image to be detected and the standard infrared image is calculated based on the pixel difference of each sub-image pair. Specifically, multiple pixel pairs contained in the two sub-images of any target sub-image pair can be obtained first. For each pixel pair, the difference in pixel values ​​is calculated to see if it is greater than a preset threshold. If it is, the count is incremented by one. Then, all pixel pairs corresponding to the target sub-images are traversed to obtain the counting result, which is the pixel-dimension difference value between the two sub-images contained in the target sub-image pair.

[0085] Furthermore, each sub-image pair is traversed to obtain the first difference value in the pixel dimension of the two sub-images contained in each sub-image pair, and then the difference degree between the infrared image to be detected and the target infrared image is determined based on the first difference value corresponding to each sub-image pair.

[0086] In some embodiments, obtaining the first difference value in the pixel dimension between the two sub-images contained in each sub-image pair includes:

[0087] 2.1.1 Obtain the pixel value of each pixel in the two sub-images contained in each sub-image pair;

[0088] 2.1.2 Calculate the pixel value difference between two corresponding pixels in two sub-images to obtain multiple pixel value differences for each sub-image pair;

[0089] 2.1.3 Determine the number of pixel value differences greater than a preset threshold among the multiple pixel value differences in each sub-image pair, and obtain the first difference value in the pixel dimension of the two sub-images contained in each sub-image pair.

[0090] In this embodiment, calculating the first difference value in the pixel dimension between two sub-images in a sub-image pair can be achieved by first obtaining the pixel value of each pixel in the two sub-images. Then, multiple pixel pairs are determined based on the positional correspondence of the pixels in the two sub-images. For each pixel pair, the corresponding pixel value difference can be calculated. When the pixel value difference is greater than a preset threshold, the two pixels are determined to be different pixels. Then, the number of pixel pairs with a pixel value difference greater than the preset threshold is determined, and this number is determined as the first difference value in the pixel dimension of the sub-image pair.

[0091] In some embodiments, calculating the degree of difference between the infrared image to be detected and a standard infrared image based on a first difference value includes:

[0092] 2.2.1 Obtain the weight coefficients for each sub-image pair;

[0093] 2.2.2. The first difference value is weighted and summed based on the weight coefficient to obtain the difference degree between the infrared image to be detected and the standard infrared image.

[0094] In this embodiment, the difference between the infrared image to be detected and the standard infrared image can be obtained by weighted summation of the first difference values ​​of each sub-image pair based on the weight coefficients corresponding to each sub-image pair. That is, in this embodiment, the contribution of the difference values ​​of different sub-image pairs to the overall image difference is not necessarily the same. The contribution of each sub-image pair to the overall image difference can be adjusted based on the weight coefficients, thereby obtaining a more accurate difference. This makes the calculated difference between the infrared image to be detected and the standard infrared image more accurate.

[0095] In some embodiments, obtaining the weight coefficients for each sub-image pair includes:

[0096] A. Obtain the first infrared image of a natural scene captured by a standard infrared camera device;

[0097] B. Obtain the second infrared image of the preset object captured by the abnormal infrared camera device. The quality of the diffractive optical element contained in the abnormal infrared camera device is unqualified.

[0098] C. Divide the first infrared image and the second infrared image according to the division rules, and calculate the first difference between the first infrared image and the standard infrared image and the second difference between the second infrared image and the standard infrared image based on the division results and the initial weight coefficients.

[0099] D. Update the initial weight coefficients based on the first and second differences to obtain the weight coefficients for each sub-image pair.

[0100] In this embodiment, the weight coefficients corresponding to each sub-image pair obtained by the aforementioned partitioning rules can be calculated offline. Specifically, a first standard infrared image, a second standard infrared image, and an abnormal infrared image can be acquired offline. The first standard infrared image is an image obtained by a standard infrared camera capturing a preset object. The standard infrared camera includes a DOE (Distribution Object) that has passed quality assessment; therefore, the first standard infrared image can be the aforementioned standard infrared image. The second standard infrared image is an infrared image obtained by a standard infrared camera capturing a natural scene image, where the natural scene is different from the preset object. The second standard infrared image can be referred to as the first infrared image. The abnormal infrared image is an infrared image obtained by using an abnormal infrared camera to capture a preset object. The DOE of the abnormal infrared camera has failed quality assessment, meaning the DOE in the abnormal infrared camera is determined to be damaged. The abnormal infrared image can also be referred to as the second infrared image.

[0101] Then, the first standard infrared image, the second standard infrared image, and the abnormal infrared image are divided separately using a preset division rule to obtain three sets of sub-images. The resolution of the first standard infrared image, the second standard infrared image, and the abnormal infrared image can be the same, and the preset division rule can be the same as the aforementioned division rule for the standard infrared image and the infrared image to be detected. That is, the three sets of sub-images obtained by the aforementioned division can contain the same number of sub-images. Each division position corresponds to one target sub-image element in each of the three sets of sub-images, and these three sub-image elements constitute a sub-image group. In other words, dividing the first standard infrared image, the second standard infrared image, and the abnormal infrared image separately can obtain multiple sub-image groups, and each sub-image group contains three sub-images corresponding to three positions.

[0102] Furthermore, based on the data obtained above, a first degree of difference between the second standard infrared image and the first standard infrared image can be calculated, as well as a second degree of difference between the abnormal infrared image and the first standard infrared image.

[0103] Specifically, the process of calculating the first degree of difference may include the following steps:

[0104] a. Calculate the pixel-level difference between the sub-images at the same location in the first standard infrared image and the second standard infrared image;

[0105] b. Obtain the initial weight coefficients, and calculate the weighted difference values ​​based on the initial weight coefficients to obtain the first difference degree.

[0106] Specifically, the calculation process for the pixel-dimensional difference between sub-images at the same location can be the same as the calculation process for the pixel-dimensional difference between two sub-images in the aforementioned sub-image pair, and will not be repeated here. The initial weighting coefficient can be a randomly generated weighting coefficient. Based on this randomly generated weighting coefficient, multiple pixel-dimensional difference values ​​of sub-images at the same location in the first standard infrared image and the second standard infrared image are weighted and calculated to obtain the first difference degree between the first standard infrared image and the second standard infrared image.

[0107] Then, the second difference between the first standard infrared image and the anomalous infrared image is calculated based on the initial weighting coefficients using the same method.

[0108] After calculating the first difference degree and the second difference degree, the initial weight coefficients are updated based on the first difference degree and the second difference degree to obtain the new weight coefficients corresponding to each segmented region. These new weight coefficients are the weight coefficients corresponding to each sub-image pair.

[0109] In some embodiments, the detection method for diffractive optical elements provided in this application may further include:

[0110] E. Recalculate the third degree of difference between the second infrared image and the standard infrared image based on the weighting coefficients and the segmentation results;

[0111] F. Determine the preset difference degree for quality inspection of the diffractive optical element under test based on the third difference degree.

[0112] In this process, after recalculating the weight coefficients corresponding to each sub-image pair, the difference between the first standard infrared image and the abnormal infrared image can be recalculated using the updated weight coefficients. This difference can be called the third difference. Then, based on this third difference, a preset difference for quality inspection of the optical element to be inspected is determined.

[0113] The preset difference degree for quality inspection of the optical component under test is determined based on the third difference degree. This can be obtained by averaging multiple third difference degrees. Specifically, there can be multiple abnormal infrared images, each of which can correspond to a third difference degree. In other words, there can be multiple third difference degrees, which can be averaged to obtain the preset difference degree.

[0114] Step 104: Perform quality inspection on the diffractive optical element under test according to the difference degree and the preset difference degree, and obtain the inspection result.

[0115] In this process, after calculating the difference between the standard infrared image and the infrared image to be tested, the difference can be compared with a preset difference, and the quality test result of the optical element to be tested can be determined based on the comparison result.

[0116] In some embodiments, the quality of the diffractive optical element under test is inspected based on the difference degree and a preset difference degree to obtain the inspection result, including:

[0117] 1. When the difference is greater than the preset difference, the test result of the diffractive optical element to be tested is determined to be unqualified;

[0118] 2. When the difference is not greater than the preset difference, the test result of the diffractive optical element under test is determined to be qualified.

[0119] In this embodiment, the difference between the infrared image to be tested and the standard infrared image is compared with a preset difference value. The test result of the diffractive optical element to be tested is determined based on the comparison result. Specifically, the difference value is numerically compared with the preset difference value. When the difference value is greater than the preset difference value, the test result of the diffractive optical element to be tested is determined to be unqualified; when the difference value is not greater than the preset difference value, the test result of the diffractive optical element to be tested is determined to be qualified. The preset difference value can be the preset difference value calculated from the third difference value in step 103.

[0120] In some embodiments, the detection method for diffractive optical elements provided in this application may further include:

[0121] When the test results indicate that the quality of the diffractive optical element under test is abnormal, a control command is sent to the infrared camera device. The control command is used to instruct the infrared camera device to turn off the infrared laser.

[0122] In this embodiment, the diffractive optical element (DOE) can be subjected to real-time quality detection. Specifically, the detection device for the diffractive optical element can be integrated into the infrared camera device. This detection device can perform real-time quality detection on the DOE in the infrared camera device at preset time points or according to a preset detection frequency. When an abnormality in the DOE quality is detected, a control command is sent to the control module of the infrared camera device. This control command can be used to instruct the infrared camera device to shut down the infrared laser within it.

[0123] As described above, the detection method for diffractive optical elements provided in this application involves: acquiring an infrared image to be detected, which is an image of a preset object captured by an infrared camera device, the infrared camera device including a diffractive optical element whose quality is to be tested; acquiring a standard infrared image, which is an image of a preset object captured by a standard infrared camera device, the standard infrared camera device including a diffractive optical element that has passed quality assessment; calculating the difference between the infrared image to be detected and the standard infrared image; and performing quality testing on the diffractive optical element based on the difference and a preset difference to obtain a detection result.

[0124] Therefore, the detection method for diffractive optical elements provided in this application can calculate the pixel difference between the infrared image of the object under test obtained by the infrared camera device under test and a standard infrared image, and further determine whether the optical diffractive element in the infrared camera device under test is damaged based on the comparison result of the actual difference between the two and the preset difference. This method can quickly detect the quality of diffractive optical elements in infrared camera devices, improving the detection efficiency of diffractive optical element quality detection.

[0125] This application also provides a method for detecting diffractive optical elements, which can be used in a computer device, which can be a terminal or a server. Figure 3 The diagram shown is another flowchart illustrating the detection method for the diffractive optical element provided in this application. The method specifically includes:

[0126] Step 201: The computer device acquires a first standard infrared image, a second standard infrared image, and an abnormal infrared image.

[0127] The first standard infrared image can be an infrared image captured using a calibration system. The calibration system may include a sliding rail, a servo motor and calibration plate fixedly mounted on the sliding rail, a base connected to and sliding on the sliding rail, a two-degree-of-freedom servo motor mounted on the base and capable of rotating at a certain angle, an infrared camera device fixed to the two-degree-of-freedom servo motor, and a computer device connected to the infrared camera device for data transmission. Here, the infrared camera device is a quality-certified infrared camera device, meaning that the DOE element in the infrared camera device is of good quality. In some embodiments, multiple infrared images can be captured at multiple distances and angles by adjusting the servo motor and the two-degree-of-freedom servo motor, and then the captured multiple infrared images can be averaged according to pixel values ​​to obtain the first standard infrared image.

[0128] The second standard infrared image can be an infrared image of a natural landscape captured using the aforementioned standard infrared camera device. In some embodiments, the second standard infrared image can also be obtained by averaging multiple infrared images of a natural landscape captured using a standard infrared camera device, and then averaging these multiple infrared images of the natural landscape along the pixel value dimension.

[0129] The abnormal infrared image can be an infrared image obtained by replacing the standard infrared camera in the calibration system with an abnormal infrared camera. The abnormal infrared camera is defined as a DOE (Distribution Object) component that has been identified as damaged through quality assessment. Specifically, the damage to the DOE component can be caused by external force, high voltage, etc.

[0130] Among them, the first standard infrared image, the second standard infrared image, and the anomalous infrared image can be infrared images with the same resolution.

[0131] In this embodiment of the application, the infrared image can be an infrared speckle image.

[0132] Step 202: The computer device performs image segmentation on the first standard infrared image, the second standard infrared image, and the abnormal infrared image according to the same preset segmentation method.

[0133] After acquiring the first standard infrared image, the second standard infrared image, and the abnormal infrared image, these infrared images can be segmented using the same segmentation method to obtain multiple sub-images corresponding to each infrared image. Since the first standard infrared image, the second standard infrared image, and the abnormal infrared image have the same resolution and use the same segmentation method, the number of sub-images obtained from each infrared image segmentation is the same. Furthermore, each segmented region corresponds to a sub-image located at the same position in the first standard infrared image, the second standard infrared image, and the abnormal infrared image.

[0134] The segmentation method can be regular segmentation, such as segmenting into multiple rectangles, or irregular segmentation, such as segmenting into several irregularly shaped sub-images.

[0135] Step 203: The computer device obtains the initial weight coefficients corresponding to each segmented region.

[0136] The first standard infrared image, the second standard infrared image, and the abnormal infrared image are segmented using a preset segmentation method, dividing each infrared image into multiple segmented regions. Since the sub-images of different regions contribute differently to the image differences, initial weight coefficients can be obtained for each segmented region. The initial weight coefficients for each segmented region are the weight coefficients for the three sub-images corresponding to that segmented region.

[0137] In one embodiment, the bottom edge of each infrared image can be designated as the x-axis, and the left side of the infrared image as the y-axis. Then, each infrared image is divided into M equal parts along the x-axis, resulting in M ​​rectangular sub-images. The initial weight coefficient expression for each region can then be set as follows:

[0138] Wi= (x i –x0)*γ Formula (1)

[0139] Where Wi is the weight coefficient corresponding to the i-th segmentation region, x i Let x be the x-coordinate of the center of the i-th partition, x0 be the x-coordinate of the origin, and γ be a Gaussian random number.

[0140] Step 204: The computer device calculates the first difference between the first standard infrared image and the second standard infrared image, and the second difference between the first standard infrared image and the abnormal infrared image, based on the segmentation results and the initial weight coefficients.

[0141] After obtaining the initial weight coefficients corresponding to each segmented region, the first difference between the first standard infrared image and the second standard infrared image, as well as the second difference between the first standard infrared image and the abnormal infrared image, can be calculated based on the image segmentation results and the initial weight coefficients.

[0142] Calculating the first difference between the first standard infrared image and the second standard infrared image may include the following steps:

[0143] 1. Calculate the Hamming distance between the first standard infrared image and the second standard infrared image and the sub-image corresponding to each segmented region;

[0144] 2. The first difference between the first standard infrared image and the second standard infrared image is calculated based on the Hamming distance and the initial weight coefficients corresponding to each segmented region.

[0145] The regional Hamming distance between the first standard infrared image and the second standard infrared image can be calculated using the following formula:

[0146] d i =∑x[j]⊕y[j] Formula (2)

[0147] Where, d i Let be the Hamming distance between the two sub-images corresponding to the i-th segmented region, x[j] be the pixel value of the j-th pixel in the first standard infrared image and the sub-image corresponding to the i-th segmented region, and y[j] be the pixel value of the j-th pixel in the second standard infrared image and the sub-image corresponding to the i-th segmented region. ⊕ is the XOR operation, which indicates that the result is 1 when the difference in pixel values ​​is greater than a preset threshold, and 0 when the difference in pixel values ​​is not greater than the preset threshold.

[0148] After calculating the Hamming distance for each region, a weighted calculation is performed on the Hamming distances of each region based on the initial weighting coefficients to obtain the first difference between the first standard infrared image and the second standard infrared image. The specific calculation formula is as follows:

[0149] D1 = ∑d i * Wi formula (3)

[0150] Where D1 is the first degree of difference, d i Let Wi be the Hamming distance corresponding to the i-th segmentation region, and let Wi be the initial weight coefficient corresponding to the i-th segmentation region.

[0151] Then, the second difference D2 between the first standard infrared image and the anomalous infrared image is calculated using the same method.

[0152] Step 205: The computer device updates the initial weight coefficients based on the first difference degree and the second difference degree to obtain the target weight coefficients corresponding to each segmented region.

[0153] After calculating the first difference degree D1 and the second difference degree D2, the initial weight coefficients can be updated based on D1 and D2. The specific update formula is as follows:

[0154] w i =e^(-|iM / 2|)*(D1-D2) Formula (4)

[0155] Among them, w i Let M be the weight coefficient corresponding to the i-th segmented region in the updated target weight coefficients, and M be the number of sub-images obtained by segmenting any infrared image.

[0156] Step 206: The computer device recalculates the third difference between the first standard infrared image and the anomalous infrared image based on the segmentation results and the target weight coefficient.

[0157] Specifically, to calculate the third difference between the first standard infrared image and the abnormal infrared image, we can first calculate the regional Hamming distance between the first standard infrared image and the abnormal infrared image based on the aforementioned segmentation results, and then perform a weighted calculation on the regional Hamming distance based on the updated target weight coefficient to obtain the third difference between the first standard infrared image and the abnormal infrared image. Then, we can determine that the third difference is the preset difference.

[0158] In some embodiments, multiple first standard infrared images, multiple second standard infrared images, and multiple anomalous infrared images can be captured. These images are then divided into multiple groups of sample images, each group containing one standard infrared image, one second standard infrared image, and one anomalous infrared image. As described above, the initial weight coefficients can be updated once based on one standard infrared image, one second standard infrared image, and one anomalous infrared image, and a preset difference degree can be generated. Therefore, using multiple groups of sample images allows for multiple iterative updates of the weight coefficients, generating multiple preset difference degrees. In this embodiment, the final weight coefficient obtained after multiple iterative updates can be used as the target weight coefficient, and the average of the multiple preset difference degrees can be used as the final preset difference degree, which serves as the difference degree threshold for quality assessment of the DOE.

[0159] Step 207: The computer device acquires the infrared image to be detected and performs image segmentation on the infrared image to be detected according to a preset segmentation method.

[0160] The infrared image to be detected is an infrared image captured by replacing the standard infrared camera in the calibration system with the infrared camera to be detected. The DOE (DOE) in the infrared camera to be detected is the DOE to be tested for quality inspection. The resolution of the infrared image to be detected can also be the same as the resolution of the aforementioned first infrared image, second infrared image, and abnormal infrared image.

[0161] After acquiring the infrared image to be detected, the image to be detected can be segmented according to a preset image segmentation method to obtain multiple sub-images.

[0162] Step 208: The computer device calculates the target difference between the infrared image to be detected and the first standard infrared image based on the segmentation results of the infrared image to be detected, the segmentation results of the first standard infrared image, and the target weight coefficient.

[0163] Since the infrared image to be detected and the first standard infrared image have the same resolution and use the same segmentation method, the regional Hamming distance between the infrared image to be detected and the first standard infrared image can also be calculated. The method for calculating the regional Hamming distance has been described in detail in the foregoing embodiments and will not be repeated here.

[0164] After calculating the regional Hamming distance between the infrared image to be detected and the first standard infrared image, the regional Hamming distance can be weighted based on the updated target weight coefficient to obtain the target difference between the infrared image to be detected and the first standard infrared image.

[0165] Step 209: The test result of the DOE under test is determined by comparing the target difference degree of the computer equipment with the preset difference degree.

[0166] After calculating the target difference between the infrared image to be detected and the first standard infrared image, the target difference is compared with a preset difference. If the target difference is greater than the preset difference, the quality detection result of the DOE under test is determined to be abnormal; if the target difference is not greater than the preset difference, the quality detection result of the DOE under test is determined to be normal.

[0167] As described above, the detection method for diffractive optical elements provided in this application involves a computer device acquiring an infrared image to be detected, which is an image of a preset object captured by an infrared camera device, the infrared camera device including a diffractive optical element to be tested; acquiring a standard infrared image, which is an image of a preset object captured by a standard infrared camera device, the standard infrared camera device including a diffractive optical element that has passed quality assessment; calculating the difference between the infrared image to be detected and the standard infrared image; and performing quality detection on the diffractive optical element to be tested based on the difference and a preset difference, thereby obtaining the detection result.

[0168] Therefore, the detection method for diffractive optical elements provided in this application can calculate the pixel difference between the infrared image of the object under test obtained by the infrared camera device under test and a standard infrared image, and further determine whether the optical diffractive element in the infrared camera device under test is damaged based on the comparison result of the actual difference between the two and the preset difference. This method can quickly detect the quality of diffractive optical elements in infrared camera devices, improving the detection efficiency of diffractive optical element quality detection.

[0169] To better implement the above methods, this application also provides a detection device for diffractive optical elements, which can be integrated into a terminal or server.

[0170] For example, such as Figure 4 The diagram shown is a schematic representation of the structure of a detection device for a diffractive optical element provided in an embodiment of this application. The detection device may include a first acquisition unit 301, a second acquisition unit 302, a calculation unit 303, and a detection unit 304, as follows:

[0171] The first acquisition unit 301 is used to acquire an infrared image to be detected. The infrared image to be detected is an image of a preset object captured by the infrared camera device to be detected. The infrared camera device to be detected includes a diffractive optical element whose quality is to be detected.

[0172] The second acquisition unit 302 is used to acquire a standard infrared image, which is an image of a preset object captured by a standard infrared camera device. The standard infrared camera device includes a diffractive optical element that has passed quality assessment.

[0173] The calculation unit 303 is used to calculate the difference between the infrared image to be detected and the standard infrared image;

[0174] The detection unit 304 is used to perform quality detection on the diffractive optical element under test according to the difference degree and the preset difference degree, and obtain the detection result.

[0175] In some embodiments, the computing unit includes:

[0176] The sub-unit division is used to divide the infrared image to be detected and the standard infrared image according to the same division rules, so as to obtain multiple sub-images. Among them, two sub-images at the same position constitute a sub-image pair.

[0177] The computational subunit is used to calculate the degree of difference between the infrared image to be detected and the standard infrared image based on the pixel differences between the sub-images contained in each sub-image pair.

[0178] In some embodiments, the computing subunit includes:

[0179] The acquisition module is used to acquire the first difference value in the pixel dimension of the two sub-images contained in each sub-image pair. The first difference value is the number of pixels whose pixel value difference at the same position in the two sub-images is greater than a preset threshold.

[0180] The calculation module is used to calculate the degree of difference between the infrared image to be detected and the standard infrared image based on the first difference value.

[0181] In some embodiments, the computing module includes:

[0182] The first acquisition submodule is used to acquire the weight coefficients of each sub-image pair;

[0183] The first calculation submodule is used to perform a weighted summation calculation on the first difference value based on the weight coefficient to obtain the degree of difference between the infrared image to be detected and the standard infrared image.

[0184] In some embodiments, the first acquisition submodule is further configured to:

[0185] Acquire the first infrared image of a natural scene captured by a standard infrared camera device;

[0186] The second infrared image of a preset object is obtained by the abnormal infrared camera device. The quality of the diffractive optical element contained in the abnormal infrared camera device is unqualified.

[0187] The first infrared image and the second infrared image are divided according to the division rules. Based on the division results and the initial weight coefficients, the first difference between the first infrared image and the standard infrared image, and the second difference between the second infrared image and the standard infrared image are calculated.

[0188] The initial weight coefficients are updated based on the first and second differences to obtain the weight coefficients for each sub-image pair.

[0189] In some embodiments, the detection device for diffractive optical elements provided in this application further includes:

[0190] The second calculation submodule is used to recalculate the third difference between the second infrared image and the standard infrared image based on the weighting coefficients and the partitioning results;

[0191] The first determining submodule is used to determine the preset difference degree for quality inspection of the diffractive optical element under test based on the third difference degree.

[0192] In some embodiments, the acquisition module includes:

[0193] The second acquisition submodule is used to acquire the pixel value of each pixel point in the two sub-images contained in each sub-image pair;

[0194] The third calculation submodule is used to calculate the pixel value difference between two corresponding pixels in two sub-images, and obtain multiple pixel value differences for each sub-image pair;

[0195] The second determining submodule is used to determine the number of pixel value differences greater than a preset threshold among the multiple pixel value differences in each sub-image pair, and to obtain the first difference value in the pixel dimension of the two sub-images contained in each sub-image pair.

[0196] In some embodiments, the detection unit includes:

[0197] The first determining subunit is used to determine that the test result of the diffractive optical element under test is unqualified when the difference is greater than the preset difference.

[0198] The second determining subunit is used to determine that the test result of the diffractive optical element under test is qualified when the difference is not greater than the preset difference.

[0199] In some embodiments, the detection device for diffractive optical elements provided in this application further includes:

[0200] The transmitting unit is used to send a control command to the infrared camera device when the detection result indicates that the quality of the diffractive optical element under test is abnormal. The control command is used to instruct the infrared camera device to turn off the infrared laser.

[0201] In practice, each of the above units can be implemented as an independent entity or can be arbitrarily combined to be implemented as the same or several entities. For the specific implementation of each of the above units, please refer to the previous method embodiments, which will not be repeated here.

[0202] As described above, the detection device for diffractive optical elements provided in this application embodiment acquires an infrared image to be detected by a first acquisition unit 301. The infrared image to be detected is an image obtained by an infrared camera device to be detected capturing a preset object. The infrared camera device to be detected includes a diffractive optical element to be tested whose quality is to be tested. The second acquisition unit 302 acquires a standard infrared image. The standard infrared image is an image obtained by a standard infrared camera device capturing a preset object. The standard infrared camera device includes a diffractive optical element that has passed quality assessment. The calculation unit 303 calculates the difference between the infrared image to be detected and the standard infrared image. The detection unit 304 performs quality detection on the diffractive optical element to be tested based on the difference and the preset difference, and obtains the detection result.

[0203] Therefore, the detection method for diffractive optical elements provided in this application can calculate the pixel difference between the infrared image of the object under test obtained by the infrared camera device under test and a standard infrared image, and further determine whether the optical diffractive element in the infrared camera device under test is damaged based on the comparison result of the actual difference between the two and the preset difference. This method can quickly detect the quality of diffractive optical elements in infrared camera devices, improving the detection efficiency of diffractive optical element quality detection.

[0204] This application also provides a computer device, which can be a terminal or a server, such as... Figure 5 The diagram shown is a structural schematic of the computer device provided in this application. Specifically:

[0205] The computer device may include components such as a processing unit 401 with one or more processing cores, a storage unit 402 with one or more storage media, a power module 403, and an input module 404. Those skilled in the art will understand that... Figure 5 The computer device structure shown does not constitute a limitation on the computer device and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein:

[0206] The processing unit 401 is the control center of the computer device. It connects various parts of the computer device via various interfaces and lines. By running or executing software programs and / or modules stored in the storage unit 402, and by calling data stored in the storage unit 402, it performs various functions of the computer device and processes data, thereby performing overall detection of the computer device. Optionally, the processing unit 401 may include one or more processing cores; preferably, the processing unit 401 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processing unit 401.

[0207] Storage unit 402 can be used to store software programs and modules. Processing unit 401 executes various functional applications and data processing by running the software programs and modules stored in storage unit 402. Storage unit 402 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, and web page access), etc.; the data storage area may store data created based on the use of the computer device. In addition, storage unit 402 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, storage unit 402 may also include a memory controller to provide processing unit 401 with access to storage unit 402.

[0208] The computer equipment also includes a power supply module 403 that supplies power to various components. Preferably, the power supply module 403 can be logically connected to the processing unit 401 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply module 403 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0209] The computer device may also include an input module 404, which can be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.

[0210] Although not shown, the computer device may also include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processing unit 401 in the computer device loads the executable files corresponding to the processes of one or more applications into the storage unit 402 according to the following instructions, and the processing unit 401 runs the applications stored in the storage unit 402 to realize various functions, as follows:

[0211] Obtain the page parameters of the target page. The structure of the page parameters indicates the component layout structure of the target page, which includes multiple component layout levels. Determine the target level of the component to be generated in the component layout structure, as well as the component creation function corresponding to the target level. Determine the input parameters corresponding to the component creation function based on the page parameters. Create the page component corresponding to the target level based on the component creation function and the input parameters, and generate the associated component creation function. Based on the associated component creation function and the page parameters, generate the associated page components of the page component, resulting in a set of page components with a component layout structure.

[0212] It should be noted that the computer device provided in this application embodiment and the method in the above embodiment belong to the same concept. The specific implementation of each of the above operations can be found in the previous embodiments, and will not be repeated here.

[0213] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.

[0214] Therefore, embodiments of the present invention provide a computer-readable storage medium storing a plurality of instructions that can be loaded by a processor to execute steps in any of the methods provided in the embodiments of the present invention. For example, the instructions can execute the following steps:

[0215] Acquire an infrared image to be tested, which is an image of a preset object captured by an infrared camera device to be tested. The infrared camera device to be tested includes a diffractive optical element whose quality is to be tested. Acquire a standard infrared image, which is an image of a preset object captured by a standard infrared camera device. The standard infrared camera device includes a diffractive optical element whose quality has been qualified. Calculate the difference between the infrared image to be tested and the standard infrared image. Perform quality testing on the diffractive optical element to be tested based on the difference and a preset difference, and obtain the test result.

[0216] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.

[0217] The computer-readable storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0218] Since the instructions stored in the computer-readable storage medium can execute the steps of any of the methods provided in the embodiments of the present invention, the beneficial effects that any of the methods provided in the embodiments of the present invention can achieve can be realized, as detailed in the preceding embodiments, and will not be repeated here.

[0219] According to one aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a storage medium. A processor of a computer device reads the computer instructions from the storage medium and executes the computer instructions, causing the computer device to perform the methods provided in various optional implementations of the detection method for the diffractive optical element described above.

[0220] The detection method, apparatus, and computer-readable storage medium for diffractive optical elements provided in the embodiments of the present invention have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A method of detecting a diffractive optical element, characterized by, The method comprises: acquiring an infrared image to be detected, the infrared image to be detected being an image obtained by a preset object being photographed by an infrared camera to be detected, the infrared camera to be detected comprising a diffractive optical element to be detected whose quality is to be detected; acquiring a standard infrared image, the standard infrared image being an image obtained by the preset object being photographed by a standard infrared camera, the standard infrared camera comprising a diffractive optical element whose quality is identified as qualified; calculating a difference degree between the infrared image to be detected and the standard infrared image, comprising: dividing the infrared image to be detected and the standard infrared image according to the same division rule to obtain a plurality of sub-images respectively, wherein two sub-images at the same position form a sub-image pair; acquiring a first difference value of two sub-images contained in each sub-image pair in the pixel dimension, the first difference value being the number of pixel points whose pixel value difference is greater than a preset threshold; and calculating the difference degree between the infrared image to be detected and the standard infrared image according to the first difference value; performing quality detection on the diffractive optical element to be detected according to the difference degree and a preset difference degree to obtain a detection result.

2. The method of claim 1, wherein, The calculation of the difference degree between the infrared image to be detected and the standard infrared image according to the first difference value comprises: acquiring a weight coefficient of each sub-image pair; performing weighted summation calculation on the first difference value based on the weight coefficient to obtain the difference degree between the infrared image to be detected and the standard infrared image.

3. The method of claim 2, wherein, The acquisition of the weight coefficient of each sub-image pair comprises: acquiring a first infrared image obtained by a natural scene being photographed by the standard infrared camera; acquiring a second infrared image obtained by the preset object being photographed by an abnormal infrared camera, the diffractive optical element contained in the abnormal infrared camera being identified as unqualified in quality; dividing the first infrared image and the second infrared image based on the division rule, and calculating a first difference degree between the first infrared image and the standard infrared image and a second difference degree between the second infrared image and the standard infrared image based on the division result and an initial weight coefficient; updating the initial weight coefficient according to the first difference degree and the second difference degree to obtain the weight coefficient of each sub-image pair.

4. The method of claim 3, wherein, The method further comprises: re-calculating a third difference degree between the second infrared image and the standard infrared image based on the weight coefficient and the division result; determining the preset difference degree for the quality detection of the diffractive optical element to be detected according to the third difference degree.

5. The method of claim 1, wherein, The acquisition of the first difference value of two sub-images contained in each sub-image pair in the pixel dimension comprises: acquiring a pixel value of each pixel point on the two sub-images contained in each sub-image pair; calculating a pixel value difference of two pixel points at the corresponding positions of the two sub-images to obtain a plurality of pixel value differences of each sub-image pair; determining the number of pixel value differences greater than a preset threshold in the plurality of pixel value differences of each sub-image pair to obtain the first difference value of two sub-images contained in each sub-image pair in the pixel dimension.

6. The method of claim 1, wherein, The quality of the to-be-tested diffractive optical element is detected according to the difference degree and a preset difference degree, and a detection result is obtained. When the difference degree is greater than the preset difference degree, it is determined that the detection result of the to-be-tested diffractive optical element is unqualified. When the difference degree is not greater than the preset difference degree, it is determined that the detection result of the to-be-tested diffractive optical element is qualified.

7. The method of claim 1, wherein, The method further comprises: When the detection result indicates that the quality of the to-be-tested diffractive optical element is abnormal, a control instruction is sent to the infrared camera device, and the control instruction is used to instruct the infrared camera device to turn off an infrared laser.

8. A device for detecting a diffractive optical element, characterized in that The device comprises: A first acquisition unit is configured to acquire a to-be-detected infrared image, the to-be-detected infrared image being an image obtained by a to-be-detected infrared camera device shooting a preset object, and the to-be-detected infrared camera device comprising a to-be-tested diffractive optical element whose quality is to be detected. A second acquisition unit is configured to acquire a standard infrared image, the standard infrared image being an image obtained by a standard infrared camera device shooting the preset object, and the standard infrared camera device comprising a diffractive optical element whose quality is qualified. A calculation unit is configured to calculate a difference degree between the to-be-detected infrared image and the standard infrared image. A detection unit is configured to detect the quality of the to-be-tested diffractive optical element according to the difference degree and a preset difference degree, and obtain a detection result. The calculation unit comprises: A division subunit is configured to divide the to-be-detected infrared image and the standard infrared image according to the same division rule, and obtain a plurality of sub-images, wherein two sub-images at the same position form a sub-image pair. An acquisition module is configured to acquire a first difference value of two sub-images contained in each sub-image pair in the pixel dimension, the first difference value being the number of pixel points whose pixel value difference is greater than a preset threshold. A calculation module is configured to calculate the difference degree between the to-be-detected infrared image and the standard infrared image according to the first difference value.

9. The apparatus of claim 8, wherein, The calculation module comprises: A first acquisition sub-module is configured to acquire a weight coefficient of each sub-image pair. A first calculation sub-module is configured to perform weighted summation calculation on the first difference value based on the weight coefficient, and obtain the difference degree between the to-be-detected infrared image and the standard infrared image.

10. The apparatus of claim 9, wherein, The first acquisition sub-module is further configured to: Acquire a first infrared image obtained by the standard infrared camera device shooting a natural scene. Acquire a second infrared image obtained by an abnormal infrared camera device shooting the preset object, the diffractive optical element contained in the abnormal infrared camera device being unqualified in quality. Divide the first infrared image and the second infrared image based on the division rule, and calculate a first difference degree between the first infrared image and the standard infrared image and a second difference degree between the second infrared image and the standard infrared image based on the division result and an initial weight coefficient. Update the initial weight coefficient according to the first difference degree and the second difference degree, and obtain the weight coefficient of each sub-image pair.

11. The apparatus of claim 10, wherein, The detection device of the diffractive optical element further comprises: A second calculating sub-module is configured to recalculate a third difference between the second infrared image and the standard infrared image based on the weight coefficient and the division result. A first determining sub-module is configured to determine a preset difference for quality detection of the to-be-tested diffractive optical element according to the third difference.

12. The apparatus of claim 8, wherein, The acquisition module comprises: A second acquisition sub-module is configured to acquire pixel values of each pixel point on two sub-images included in each sub-image pair. A third calculating sub-module is configured to calculate pixel value differences between two pixel points at corresponding positions of the two sub-images, to obtain a plurality of pixel value differences of each sub-image pair. A second determining sub-module is configured to determine a number of pixel value differences greater than a preset threshold in the plurality of pixel value differences of each sub-image pair, to obtain a first difference value in a pixel dimension of the two sub-images included in each sub-image pair.

13. The apparatus of claim 8, wherein, The detection unit comprises: A first determining sub-unit is configured to determine that a detection result of the to-be-tested diffractive optical element is unqualified when the difference is greater than a preset difference. A second determining sub-unit is configured to determine that the detection result of the to-be-tested diffractive optical element is qualified when the difference is not greater than the preset difference.

14. The apparatus of claim 8, wherein, The diffractive optical element detection device further comprises: A sending unit is configured to send a control instruction to the infrared camera device when the detection result indicates that the quality of the to-be-tested diffractive optical element is abnormal, where the control instruction is used to instruct the infrared camera device to turn off an infrared laser.

15. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a plurality of instructions, which are adapted to be loaded by the processor to execute steps in the diffractive optical element detection method of any one of claims 1 to 7.

16. A computer device, comprising: The computer readable storage medium stores a plurality of instructions, which are adapted to be loaded by the processor to execute steps in the diffractive optical element detection method of any one of claims 1 to 7.

17. A computer program product comprising computer programs / instructions, characterized in that, The computer readable storage medium stores a plurality of instructions, which are adapted to be loaded by the processor to execute steps in the diffractive optical element detection method of any one of claims 1 to 7.

Citation Information

Patent Citations

  • Detection method, detection device, computer equipment and computer readable storage medium

    CN108198175A