Software testing method and system for contrast transfer function of low-light image intensifier
By designing a software testing system for the contrast transfer function of low-light image intensifiers, the problem of undeveloped existing testing systems was solved, realizing automated and personalized testing requirements, improving the real-time performance and accuracy of testing, and promoting the digitalization of quality monitoring and production management of image intensifiers.
Patent Information
- Application Number
- CN202511148210.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-16
- Publication Date
- 2025-11-14
AI Technical Summary
The lack of a software testing system for the contrast transfer function of low-light image intensifiers has hampered the digitalization of image intensifier quality monitoring and production management.
A software testing method and system for the contrast transfer function of a low-light image intensifier is designed, including modules for parameter configuration, illumination adjustment, autofocus, region extraction, and function generation. The system obtains ESF, LSF, and MTF through image processing, generates and stores CTF curves and related data, and realizes automated and personalized testing requirements.
It improves the real-time performance and accuracy of the testing process, simplifies the operation process, enhances the level of testing automation and accuracy, supports quality monitoring and performance evaluation of enhancers, and promotes the digital and intelligent upgrading of the testing process.
Smart Images

Figure CN120956874A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of software testing technology, and relates to a software testing method and system for the contrast transfer function of a low-light image intensifier. Background Technology
[0002] An image intensifier is a multi-band vacuum electronic imaging device that can detect, enhance, and image targets irradiated by ultraviolet light, visible light, near-infrared light, X-rays, and gamma rays.
[0003] Image intensifiers are the core components of low-light night vision equipment. With the development of my country's military and technology, image intensifiers have gone through the zero generation, first generation, second generation, third generation, super second generation and fourth generation. While the cathode sensitivity and limit resolution have been greatly improved, the size has been reduced.
[0004] The contrast transfer function (CTF) of an image intensifier is an important indicator of its ability to transfer image contrast; it is defined as the image intensifier's ability to preserve and transfer the contrast of an input image. The CTF and modulation transfer function are related through contrast transfer theory. Currently, testing equipment for the CTF of low-light image intensifiers has been developed in China, but the software for this testing system has not yet been researched.
[0005] To improve the quality control and production management of image intensifiers, many night vision device manufacturers are pursuing a future development direction of digitizing and automating the measurement of image intensifier performance parameters using existing automation, optical engineering, computer applications, and image processing technologies. Existing image intensifier modulation transfer function testing systems also provide the necessary theoretical foundation for the research of low-light image intensifier contrast transfer function testing systems.
[0006] The development of a software testing system for the contrast transfer function of low-light image intensifiers not only enables quantitative testing of the contrast transfer function of low-light image intensifiers, but also provides technical support for the smooth implementation of comprehensive image quality testing projects for image intensifiers. Summary of the Invention
[0007] To address the problems existing in the background technology, this invention proposes a software testing method and system for the contrast transfer function of a low-light image intensifier.
[0008] To achieve the above objectives, the technical solution adopted by the present invention is as follows: a software testing method for the contrast transfer function of a low-light image intensifier, comprising the following steps: Automatically match and configure light source parameters, equipment operating parameters, and relative position parameters based on image intensifier type and target type; The aperture adjustment step size is dynamically adjusted based on historical illumination data using a filtering model to ensure that the illuminance reaches the set value. Use coarse adjustment to lock in the approximate focus position, and use fine adjustment to lock in the high-precision focus position; Define the test area; For different target types, ESF, LSF and MTF are obtained through image processing, and CTF curves and related data are generated and stored.
[0009] Specifically, the on / off state of the corresponding light source is switched according to the type of image intensifier, and the aperture parameters, power supply parameters and operating parameters of the light source and the image acquisition equipment are set simultaneously to adjust the relative positions of the image intensifier, the image acquisition equipment and the target. Adjust the aperture parameters and the operating parameters of the image acquisition equipment according to the target type.
[0010] Specifically, the aperture is first directly adjusted and then fine-tuned. The filtering model dynamically corrects the adjustment step size through cumulative analysis of historical illumination data to reduce illumination fluctuations.
[0011] Specifically, in the coarse adjustment stage, the image intensifier is moved step by step and images are acquired. The entropy method is used to determine the sharpness of the focus area in order to lock the approximate focus position. During the fine-tuning stage, the image intensifier is moved step by step near the approximate focal position and images are acquired. The sharpness assessment value is calculated by combining the gradient variance method with sliding window scanning to lock the high-precision focal position.
[0012] Specifically, the step-by-step movement distance in the coarse adjustment stage is greater than that in the fine adjustment stage, and the number of images acquired in the coarse and fine adjustment stages is the same.
[0013] Specifically, when defining the test area, a straight line detection algorithm is used to identify the target edge, and a fixed area is determined as the test area based on the center point of the edge.
[0014] Specifically, the LSF of the blade target, slit target, or cross target is processed by Fourier transform to obtain the MTF; When targeting a blade edge, the ESF is obtained by averaging the pixels along the blade edge in the test area, and the LSF is obtained by differentiating it. When targeting slit or cross targets, the LSF is obtained by averaging the pixels along the edge of the slit in the test area.
[0015] Another aspect of the present invention provides a software testing system for the contrast transfer function of a low-light image intensifier, comprising: a parameter configuration module, an illumination adjustment module, an autofocus module, a region extraction module, and a function generation module; The parameter configuration module is used to perform parameter adaptation operations; The illumination adjustment module is used to perform illumination calibration operations; The autofocus module is used to perform step-by-step focusing operations; The region extraction module is used to delineate the test area in the acquired image; The function generation module is used to perform image processing to obtain ESF, LSF and MTF, generate and store CTF curves and related data.
[0016] Specifically, the function generation module includes a data processing unit and a storage unit; The data processing unit is used to perform pixel averaging, differentiation, and Fourier transform processing on the test area to generate CTF curves; The storage unit is used to save CTF curves and related data.
[0017] Specifically, the autofocus module includes a shift control unit and a sharpness evaluation unit; The displacement control unit is used to drive the step-by-step movement for focusing during the coarse and fine adjustment stages; The sharpness assessment unit is used to calculate the sharpness assessment value by combining the entropy method and the gradient variance method with sliding window scanning.
[0018] Compared with existing technologies, this invention has the following advantages: By achieving high frame rate and high-definition display of the system output images, the real-time performance and detail integrity of image observation during testing are ensured; the system's adaptive initialization eliminates the need for manual configuration, reducing operational errors and improving startup efficiency; it provides CTF testing options based on different targets, flexibly adapting to diverse testing needs and enhancing system versatility; it achieves automatic control of target switching, illumination adjustment, and image focusing, significantly simplifying the operation process and improving the level of testing automation and accuracy; it adds a manual selection function for the region of interest, balancing the efficiency of automated testing with the flexibility of personalized needs; and it simultaneously achieves objective testing and visualization of the contrast transfer function of the low-light image intensifier, ensuring the accuracy and readability of test results, providing reliable technical support for the quality monitoring and performance evaluation of the image intensifier, and effectively promoting the digital and intelligent upgrading of the testing process. Attached Figure Description
[0019] Figure 1 This is a software testing system interface diagram of the contrast transfer function of the low-light image intensifier of the present invention; Figure 2 This is a hardware connection block diagram of the low-light image intensifier contrast transfer function testing system of the present invention; Figure 3 This is a general block diagram of the software testing method and system for the contrast transfer function of the low-light image intensifier of the present invention; Figure 4 This is an image showing the effect of manually cropping the focus area of the knife-edge target, slit target, and cross target of the low-light image intensifier of the present invention. Figure 5 This is a flowchart of the image coarse adjustment algorithm of the present invention; Figure 6 This is a flowchart of the image sharpness estimation algorithm for image fine-tuning in this invention; Figure 7 This is the estimated image sharpness result of the 20 frames in this invention; Figure 8 These are the focused images of the knife-edge target, slit target, and cross target of the low-light image intensifier of the present invention; Figure 9 This is a theoretical analysis diagram of obtaining the ESF curve of the blade target according to the present invention; Figure 10 This is a theoretical analysis diagram of obtaining the LSF curve of the slit target according to the present invention; Figure 11 This is a flowchart of the process for obtaining the MTF curve of the blade target according to the present invention; Figure 12 This is a flowchart of the invention for obtaining the MTF curves of the slit and the cross-shaped target; Figure 13 These are screenshots of some CTF test data stored in this invention; Figure 14 This is a CTF test curve of a cross-shaped target of the present invention; Figure 15 This is the overall operation flowchart of the software testing system for the contrast transfer function of the low-light image intensifier of the present invention. Detailed Implementation
[0020] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0021] like Figures 1-15 As shown, the technical solution adopted by the present invention is as follows: a software testing system for the contrast transfer function of a low-light image intensifier, comprising: a parameter configuration module, an illumination adjustment module, an autofocus module, a region extraction module, and a function generation module.
[0022] The parameter configuration module is used to perform parameter adaptation operations.
[0023] The illumination adjustment module is used to perform illumination calibration operations.
[0024] The autofocus module is used to perform step-by-step focusing operations.
[0025] The region extraction module is used to perform region determination operations.
[0026] The function generation module is used to perform feature transformation operations.
[0027] Specifically, the autofocus module includes a shift control unit and a sharpness evaluation unit; The displacement control unit is used to drive the image intensifier to move step by step during the coarse and fine adjustment stages.
[0028] The sharpness assessment unit is used to calculate the sharpness assessment value by combining the entropy method, the gradient variance method, and sliding window scanning.
[0029] The function generation module includes a data processing unit and a storage unit.
[0030] The data processing unit is used to perform pixel averaging, differentiation, and Fourier transform on the test area to generate CTF curves.
[0031] The storage unit is used to save CTF curves and related data.
[0032] Meanwhile, this invention also provides a software testing method for the contrast transfer function of a low-light image intensifier, comprising the following steps: The system automatically matches and configures light source parameters, equipment operating parameters, and relative position parameters based on the image intensifier type and target type.
[0033] By combining the filtering model with historical illumination data, the aperture adjustment step size is dynamically adjusted to ensure that the illuminance reaches the set value.
[0034] Coarse adjustment is used to lock in the approximate focus position, and then fine adjustment is used to lock in the high-precision focus position.
[0035] Define the test area.
[0036] For different target types, ESF, LSF and MTF are obtained through image processing. CTF curves are then generated based on the theoretical relationship between MTF and CTF, and the curves and related data are stored.
[0037] Specifically, the on / off state of the corresponding light source is switched according to the type of image intensifier, and the aperture parameters, power supply parameters and operating parameters of the image acquisition device (camera) of the light source are set simultaneously to adjust the relative positions of the image intensifier, the image acquisition device and the target.
[0038] Adjust the aperture parameters and the operating parameters of the image acquisition equipment according to the target type.
[0039] Specifically, switching the light source's on / off state is as follows: Turn on the halogen lamp and its motorized shutter. Simultaneously set the light source's aperture parameters, i.e., the initial value of the halogen lamp's motorized aperture diameter. Set the power supply parameters to the current and voltage values of the digital power supply channel connected to the halogen lamp and the channel connected to the image intensifier. Set the image acquisition device's operating parameters to the camera's grayscale stretching factor and exposure time. Adjust the relative distance between the image intensifier, the image acquisition device, and the target to the set value using the motorized displacement controller.
[0040] The parameter configuration module adjusts the aperture diameter of the corresponding image intensifier and the camera exposure time for different target types.
[0041] When the target is identified as a knife edge, the diameter of the halogen tungsten lamp motorized aperture and the camera exposure time are adjusted to adapt to edge feature extraction and ensure accurate acquisition of ESF.
[0042] When the target is identified as a slit target or a cross target, the parameters are adjusted accordingly to avoid overexposure of the slit area or interference from diffraction light, thereby improving the accuracy of LSF and MTF calculations.
[0043] Furthermore, after placing the image intensifier, the integrating sphere controller first activates the motorized shutter of the halogen lamp, sets the diameter of the halogen lamp's motorized aperture to 4.0mm, and sets the current connected to the halogen lamp via the first channel of the digital power supply to 1.7A and the voltage to 12V, so that the illuminance within the integrating sphere meets the low-light image intensifier test standard (10). -3 ~10 -1 lx).
[0044] Next, the second channel of the digital power supply connected to the image intensifier was set to a current of 0.1A and a voltage of 3V to power on the image intensifier. The camera's grayscale stretching factor was set to 100~3000 and the exposure time to 40ms, making the test target visible.
[0045] Finally, the electric displacement controller adjusts the two electric displacement devices so that the image intensifier is 20cm and 25cm away from the camera and the target, respectively.
[0046] When switching the blade target, the diameter of the motorized aperture of the halogen tungsten lamp is corrected to 1.8mm, and the camera exposure time is corrected to 300ms.
[0047] When switching between a slit or a crosshair target, the diameter of the motorized aperture of the halogen tungsten lamp is corrected to 4.0 mm, and the camera exposure time is corrected to 100 ms.
[0048] When the software starts, the blade target test for the low-light image intensifier is the system default option. By clicking the corresponding button on the software interface, such as selecting the image intensifier type or target type from the drop-down list, adaptive initialization settings for different device combinations can be achieved.
[0049] First, the aperture is directly adjusted and then fine-tuned. The filtering model dynamically corrects the adjustment step size by accumulating and analyzing historical illumination data to reduce illumination fluctuations.
[0050] By directly adjusting the diameter of the motorized aperture with an accuracy of 0.1mm, the illuminance quickly approaches the user-set value. The fine-tuning stage involves adjusting the diameter of the motorized aperture with an accuracy of 0.05mm, further bringing the illuminance closer to the set value.
[0051] The filtering model is based on historical illumination data, including the illuminance measurements, aperture adjustment amounts, and illuminance changes after each adjustment, and performs cumulative analysis to dynamically correct the step size of subsequent aperture adjustments.
[0052] If historical data shows a large deviation in illuminance, the adjustment step size is increased to accelerate the approximation speed; if the deviation is small, the adjustment step size is decreased to avoid over-adjustment, thereby reducing the fluctuation of illuminance around the set value and maintaining illuminance stability.
[0053] The system first calibrates the illuminance within the integrating sphere to determine the aperture diameter data, which has a linear relationship with the actual illuminance. After the user inputs the illuminance, in addition to providing direct feedback on the aperture diameter (accuracy of 0.1 mm), the system also fine-tunes the aperture diameter by reading the illuminance meter value (accuracy of 0.05 mm). To address the light source attenuation caused by prolonged operation of the integrating sphere and potential errors in the data collected by the illuminance meter, a Kalman filter prediction model is introduced. This model dynamically adjusts the adjustment step size of the motorized aperture based on historical illuminance data, improving the stability of the illuminance within the integrating sphere. After these processing steps, the system's average illuminance adjustment time is reduced from 5-8 minutes to less than 1 minute compared to traditional methods.
[0054] After parameter adaptation is complete, the system controls the image acquisition device to achieve continuous image reading and real-time display. The image acquisition device continuously reads the output image from the image intensifier and refreshes it on the main display interface of the software, allowing users to observe the image status in real time.
[0055] This process not only allows users to intuitively monitor the imaging effect of the test object, but also provides basic data support for subsequent step-by-step focusing: the continuously read image sequence serves as a sample for sharpness determination in the coarse and fine adjustment stages, ensuring that changes in key areas of the image can be dynamically tracked during the focusing process.
[0056] Once the step-by-step focusing is complete, the system switches to single-frame acquisition mode to capture the image in the current clear state for subsequent operations. The single-frame image is transmitted to the region extraction module as raw data for manually delineating test areas or automatically identifying target edges, laying the foundation for accurately acquiring test areas and ultimately supporting the calculation of ESF, LSF, MTF, and CTF in the feature conversion stage.
[0057] To ensure real-time performance, the image focus target is not the entire image but a specific region. Research indicates that the edge of a blade or the slit is a key area for determining image sharpness, hereinafter referred to as the focus area. Since the tilt angle of the blade edge or the azimuth angle of the slit is not fixed during each test, to obtain the focus area, Hough line detection must first be performed on the original image to obtain the tilt angle of the blade or slit line. Then, the image is rotated to a normalized state (i.e., the blade or slit is vertical). Finally, the focus area is manually cropped as the image focus target.
[0058] The manual cropping effect of the focus area of the knife-edge target, slit target, and cross-shaped target images of the low-light image intensifier is as follows: Figure 4 As shown, the focus area is represented by a green rectangle.
[0059] A coarse-fine dual-stage focusing strategy is proposed, which first performs coarse focusing between the camera and the image intensifier, and then performs fine focusing between the image intensifier and the target. The software controls the image acquisition device to capture 40 frames of images sequentially: first 20 frames in the coarse focusing stage, and then 20 frames in the fine focusing stage.
[0060] In the coarse adjustment stage, the image intensifier is moved step by step and images are acquired. The entropy method is used to determine the sharpness of the focus area in order to lock the approximate focus.
[0061] The image intensifier is first moved back to its initial adjustment position, and then moved step by step along a set direction, acquiring one image frame after each certain distance, for a total of a preset number of image frames. During this process, each image frame is first rotated to normalize the blade edge or slit, and then the focus area in the image, i.e., the area at the blade edge or slit, is extracted. Finally, the entropy method is used to determine the sharpness of the focus area.
[0062] The image entropy value of the focused area is calculated as a sharpness evaluation value. The higher the entropy value, the richer the details in the area and the sharper the image. Based on the sharpness evaluation values of each frame, the coordinate position corresponding to the image frame with the highest entropy value is selected as the approximate focus position. Then, the image intensifier is controlled to move to this position to complete the approximate focus locking.
[0063] Furthermore, in the coarse adjustment stage, the image intensifier is first moved back 3mm, and then one image frame is acquired every 0.3125mm, for a total of 20 steps, generating 20 frames for the coarse adjustment stage. Afterward, the image intensifier is moved back to the starting position. During this process, rotation correction, focus area extraction, and entropy value determination are performed on each frame to determine the image sharpness evaluation value. Then, the focus index is locked, and the image intensifier is controlled to move to that index position. The algorithm flowchart for image coarse adjustment is as follows: Figure 5 As shown.
[0064] In the fine-tuning stage, the image intensifier is moved step by step near the coarse-tuned focus and images are acquired. The sharpness assessment value is calculated by combining the gradient variance method with sliding window scanning to lock the high-precision focus.
[0065] Near the approximate focal position locked in the coarse adjustment stage, the image intensifier is first controlled to move backward along the set direction to the initial position of fine adjustment, and then moved further in steps along that direction, acquiring one image frame every certain distance moved, for a total of the same number of image frames as in the coarse adjustment stage.
[0066] For each frame of the acquired image, rotation correction is first performed to normalize the blade edge or slit. Then, the focus area is determined, i.e., the area where the blade edge or slit is located. Finally, the sharpness assessment value is calculated by combining the gradient variance method with sliding window scanning.
[0067] Using a sliding window scanning strategy, a fixed-width window slides along a set direction within the focus area. For each window, Laplacian gradient calculation (to extract edge details) and gray-level variance calculation (to reflect overall gray-level distribution differences) are performed simultaneously. Weights are assigned to the two calculation results, and then they are summed to obtain the sharpness sub-value for that window. The sharpness sub-values of all windows are combined to obtain the sharpness evaluation value for the focus area.
[0068] Based on the sharpness evaluation values of each frame, the coordinates of the image frame with the highest evaluation value are determined, which is the high-precision focus position. The image intensifier is then moved to this position to lock the high-precision focus.
[0069] Furthermore, the image acquisition process in the fine-tuning stage is similar to that in the coarse-tuning stage, except that the image intensifier initially needs to regress by 1mm, and the step size is 0.1mm. It is known that the Laplacian operator can detect edges in an image, and image sharpness is evaluated by calculating the Laplacian gradient. The variance method evaluates image sharpness by calculating the variance of image gray levels. By combining the Laplacian gradient method and the variance method, and assigning different weight coefficients, image edge information and overall gray-level features are comprehensively considered, thus more effectively evaluating image sharpness.
[0070] Since the effective area determining image sharpness is the blade or crevices, sliding window scanning can focus the processing object more towards the point of interest, improving computational accuracy and efficiency. During the image acquisition phase, the system combines the Laplacian gradient variance method with sliding window scanning to lock the focal point in the image's focus area with sub-micron precision, achieving accurate image focusing.
[0071] The flowchart of the image sharpness estimation algorithm in the fine-tuning stage is as follows: Figure 6 As shown, the sharpness calculation results for 20 frames of images are as follows: Figure 7 As shown. A focused image of a knife-edge target, slit target, and cross-shaped target of a low-light image intensifier is shown below. Figure 8 As shown in the figure. After the above operations, the system image focusing error was reduced from >5% to <1% compared to the traditional manual focusing method.
[0072] The step-by-step movement distance in the coarse adjustment stage is greater than that in the fine adjustment stage, and the number of images acquired in the coarse and fine adjustment stages is the same.
[0073] The distance of each step-by-step movement must be greater than the distance of the subsequent fine-tuning stage, and the number of image frames acquired must remain consistent with that in the fine-tuning stage. The focus area, which is the region in the image containing the blade edge or slit, is the core object for determining sharpness. The entropy method quantifies the randomness of the gray-scale distribution in the focus area to achieve an objective assessment of image sharpness, providing data support for locking the approximate focus and the sub-micron level precision focus.
[0074] Delineate the test area. There are two methods for delineating the test area: manual delineation and automatic identification.
[0075] Manual delineation method: First, the acquired target image is rotated and corrected to bring it into a standardized state, so that the blade edge or slit is vertical. The corrected image is then output to the software sub-display interface. In this sub-display interface, the user delineates the required test area by selecting a box. Then, through coordinate restoration processing, the area selected in the sub-display interface is mapped to the unrotated original image to obtain the test area in the original image.
[0076] When automatically identifying the test area, a straight line detection algorithm is used to identify the target edge. The area within a fixed range is determined based on the center point of the edge as the test area for ESF calculation.
[0077] Automatic recognition method: For the acquired target image, a line detection algorithm, such as the Hough line detection method, is used to identify the blade edge or slit edge in the image. The pixel coordinates of the target edge are accurately extracted to form a continuous edge line. Based on the extracted edge line coordinates, the position of its geometric center point (i.e., the coordinates of the midpoint of the edge line) is calculated. Using this center point as a reference, a fixed area within its vicinity is demarcated as the test area.
[0078] For blade targets, this area is covered by a fixed number of lines (e.g., 100 lines) evenly distributed along the blade edge, near the perpendicular bisector of the edge's center point. This area must completely encompass the transition features of the blade edge. For slit or cross targets, this area is covered by a fixed number of lines (e.g., 100 lines) evenly distributed along the slit direction, near the perpendicular bisector of the slit's center point. This area must include the key features at the slit. This fixed area is the test area, used for subsequent calculations of ESF (for blade targets), LSF, MTF, and CTF.
[0079] The test area is the core region in the image related to the target features (blade or slit), and it is the object of subsequent feature transformation processing. The manual delineation method can meet the personalized needs of users, while the automatic recognition method can improve the testing efficiency. Both methods can accurately locate the test area and ensure the accuracy of CTF testing.
[0080] For the blade target, the ESF is obtained by processing the test area along the blade edge direction, and then the LSF is obtained by differentiating the ESF. For slit targets or cross targets, the test area is directly processed along the edge of the slit to obtain the LSF, and then the LSF is subjected to Fourier transform to obtain the MTF.
[0081] The ESF is obtained by averaging pixels along the blade edge of the test area, and the LSF is obtained by differentiating the ESF; the LSF is obtained by averaging pixels along the slit edge of the test area.
[0082] For the blade target, the processing procedure is as follows: After acquiring the test area (a fixed range along the blade edge direction, including the transition features of the blade edge), multiple parallel lines (e.g., 100 evenly distributed lines) are selected along a direction perpendicular to the blade edge. The pixel grayscale values on each line are averaged along the blade edge direction (i.e., parallel to the blade edge), resulting in a series of grayscale averages. These grayscale averages are then arranged sequentially according to their positions in the direction perpendicular to the blade edge, forming a continuous ESF curve.
[0083] The obtained ESF curve is differentiated (using a fixed pixel interval, such as 5 pixels), to obtain LSF. This process is achieved by calculating the gray-scale change rate of adjacent points on the ESF curve to reflect the optical diffusion characteristics of the blade edge.
[0084] For slit targets or cross targets, the specific processing procedure is as follows: After obtaining the test area (which is a fixed range along the edge of the slit, containing the core features of the slit), select multiple parallel lines (such as 100 evenly distributed lines) along the direction perpendicular to the edge of the slit, and average the pixel gray values on each line along the direction of the slit edge (i.e., the direction parallel to the edge of the slit) to obtain a series of gray average values.
[0085] These grayscale averages are arranged sequentially according to their positions perpendicular to the slit edge, directly forming the LSF curve. The obtained LSF curve is then subjected to a Discrete Fourier Transform and the modulus is taken to obtain the MTF. This process converts the spatial domain characteristics of the LSF into frequency domain characteristics to reflect the image intensifier's ability to transmit signals at different spatial frequencies.
[0086] Furthermore, the function generation module includes five parts: ESF acquisition, LSF acquisition, MTF generation, CTF generation, and curve and data saving. ESF acquisition is a single operation specific to the blade target, obtained by averaging pixels along the blade edge direction in the test area. The LSF of the blade target is obtained by differentiating the ESF (with a pixel interval of 5px for differentiation). The LSF of the slit target (or cross target) is obtained by directly averaging pixels along the slit line edge direction in the test area. The theoretical analysis diagrams for acquiring the ESF curve of the blade target and the LSF curve of the slit target are shown below. Figure 9 and Figure 10 As shown, the green dashed box represents the test area. q It is a point on the ESF (or LSF) curve. p These are the pixels in the test area. N It is the length of the curve.
[0087] After obtaining the LSF curve, performing a Discrete Fourier Transform on its pixels and then taking the modulus yields the MTF. The flowcharts for obtaining the MTF curves of a knife-edge target and a slit (or cross) target are shown below. Figure 11 and Figure 12 As shown.
[0088] It is known that MTF is the CTF of a sinusoidal pattern. However, in testing, due to the complex manufacturing process of sinusoidal targets, rectangular targets are usually used instead, resulting in a square wave contrast transfer function. Let the square wave function be... ;in, The light intensity distribution function representing the square wave pattern, The coordinates (along the direction perpendicular to the edge of the target) describe the light intensity values of the square wave at different spatial locations. It represents the average light intensity (DC component) of a square wave, and is a constant reference value for the light intensity of a square wave; The amplitude (AC component) of the square wave represents the light intensity at... The fluctuation range on the basis, that is, the difference between the peak value and the average value of the square wave.
[0089] Let the CTF of a square wave be... CTF ( f ),but: ; Given the contrast of the square wave pattern, and: ; This represents the contrast of the square wave pattern image. The periodic square wave function can be expanded into a superposition of sine waves, i.e.: ; Let be the object function of a square wave pattern. Its image function should be the result of the transmission of its harmonics. If the phase relationship is not considered, the light intensity distribution of the image is: ; To determine the CTF of a square wave, the contrast ratios of the object and image must first be calculated. The contrast ratio of the object is... The image contrast is: ; Therefore, the CTF of a square wave is: ; in, Indicates the image intensifier at spatial frequencies f The ability of a device to transmit the contrast of an input square wave is defined as the ratio of the contrast of the image to the contrast of the object. Spatial frequency, measured in line pairs per millimeter (lp / mm), represents the number of light and dark alternations per unit length and is used to describe the richness of detail in an image. The modulation transfer function (contrast transfer function of a sine wave) represents the image intensifier at spatial frequencies. f The ability to transmit the contrast of the input sine wave.
[0090] During the curve and data saving stage, the software can obtain CTF data at specified coordinates based on the user-preset parameter file, and save it along with the image intensifier type, number, target type, time (year, month, day, hour, minute, second), CTF curve, and related test data entered on the interface. Some of the stored CTF test data is shown below. Figure 13 As shown, the CTF test curve of a low-light image intensifier based on a cross-shaped target is as follows. Figure 14 As shown.
[0091] The software testing system for the contrast transfer function of the low-light image intensifier of this invention uses Visual Studio (VS) 2022 + OpenCV + MATLAB R2023b for joint programming. MATLAB mainly provides advanced image processing algorithms, such as the Laplacian gradient method and entropy method, while OpenCV mainly provides a model library for basic image operations such as rotation, scaling, and filtering. VS is mainly used for communication with the lower-level machines (camera, integrating sphere controller, displacement controller, illuminometer, and digital power supply) and for building the upper-level software system. VS achieves joint control of the various devices in this system by calling or modifying specific functional modules of the open-source SDKs of the above five devices. Finally, the overall operation flowchart of the software testing system for the contrast transfer function of the low-light image intensifier is as follows: Figure 15 As shown.
[0092] Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A software testing method for the contrast transfer function of a low-light image intensifier, characterized in that, Includes the following steps: Automatically match and configure light source parameters, equipment operating parameters, and relative position parameters based on image intensifier type and target type; The aperture adjustment step size is dynamically adjusted based on historical illumination data using a filtering model to ensure that the illuminance reaches the set value. Use coarse adjustment to lock in the approximate focus position, and then use fine adjustment to lock in the high-precision focus position; Define the test area; For different target types, edge spread function (ESF), line spread function (LSF) and modulation transfer function (MTF) are obtained through image processing, and contrast transfer function (CTF) curves and related data are generated and stored.
2. The software testing method for the contrast transfer function of a low-light image intensifier according to claim 1, characterized in that, Switch the on / off state of the corresponding light source according to the image intensifier type, and simultaneously set the aperture parameters, power supply parameters and operating parameters of the image acquisition device of the light source, and adjust the relative positions of the image intensifier, image acquisition device and target; correct the aperture parameters and operating parameters of the image acquisition device according to the target type.
3. The software testing method for the contrast transfer function of a low-light image intensifier according to claim 1, characterized in that, First, the aperture is directly adjusted and then fine-tuned. The filtering model dynamically corrects the adjustment step size by accumulating and analyzing historical illumination data to reduce illumination fluctuations.
4. The software testing method for the contrast transfer function of a low-light image intensifier according to claim 1, characterized in that, In the coarse adjustment stage, the image intensifier is moved step by step and images are acquired. The entropy method is used to determine the sharpness of the focus area in order to lock the approximate focus position. During the fine-tuning stage, the image intensifier is moved step by step near the approximate focal position and images are acquired. The sharpness assessment value is calculated by combining the gradient variance method with sliding window scanning to lock the high-precision focal position.
5. The software testing method for the contrast transfer function of a low-light image intensifier according to claim 1, characterized in that, The step-by-step movement distance in the coarse adjustment stage is greater than that in the fine adjustment stage, and the number of images acquired in the coarse and fine adjustment stages is the same.
6. The software testing method for the contrast transfer function of a low-light image intensifier according to claim 1, characterized in that, When defining the test area, a straight line detection algorithm is used to identify the target edge, and a fixed area is determined based on the center point of the edge as the test area.
7. The software testing method for the contrast transfer function of a low-light image intensifier according to claim 1, characterized in that, The MTF is obtained by performing Fourier transform on the LSF of the knife-edge target, slit target, or cross target; When targeting a blade edge, the ESF is obtained by averaging the pixels along the blade edge in the test area, and the LSF is obtained by differentiating it. When targeting slit or cross targets, the LSF is obtained by averaging the pixels along the edge of the slit in the test area.
8. A software testing system for the contrast transfer function of a low-light image intensifier, characterized in that, include: Parameter configuration module, illumination adjustment module, autofocus module, region extraction module, and function generation module; The parameter configuration module is used to perform parameter adaptation operations; The illumination adjustment module is used to perform illumination calibration operations; The autofocus module is used to perform step-by-step focusing operations; The region extraction module is used to delineate the test area in the acquired image; The function generation module is used to perform image processing to obtain ESF, LSF and MTF, generate and store CTF curves and related data.
9. A software testing system for the contrast transfer function of a low-light image intensifier according to claim 8, characterized in that, The function generation module includes a data processing unit and a storage unit; The data processing unit is used to perform pixel averaging, differentiation, and Fourier transform on the test area to generate CTF curves; The storage unit is used to save CTF curves and related data.
10. A software testing system for the contrast transfer function of a low-light image intensifier according to claim 8, characterized in that, The autofocus module includes a shift control unit and a sharpness evaluation unit; The displacement control unit is used to drive the step-by-step movement for focusing during the coarse and fine adjustment stages; The sharpness assessment unit is used to calculate the sharpness assessment value using the entropy method and the gradient variance method combined with the sliding window scanning method.