How to do the DSNU calibration, PRNU calibration, LUT?
1. DSNU calibration
(1) Why is the DSNU (Dark Signal Non-uniformity) calibration
In the sensor, some dark current is present, even under completely dark conditions. These dark currents form a non-uniform distribution on the sensor surface due to minor differences in the manufacturing process, thus requiring a uniform background calibration of the image by the DSNU calibration.
(2) DSNU calibration Methods
1) Data acquisition: First, the camera needs to collect a set of dark field images in full darkness.
2) Average: Phase average the acquired dark field image to obtain an average dark field image.
3) General calibration image: subtract a reference image (all 0 or all 100, etc.) to generate a dark field calibration image.
4) Storage calibration image: The resulting dark field calibration image is stored in a non-volatile memory inside the camera, serving as the input to the late dark field calibration algorithm.
5) Application calibration: When taking an actual image, the camera minuses the corrected image to eliminate the dark current inequality of the sensor.
(3) DSNU corrected before and after comparison
It is obvious from the following two graphs that the corrected image in the horizontal direction has a significant improvement relative to the image uniformity before the calibration.
Uncorrected dark field horizontal gray value curve
Dark-field horizontal gray value curve after DSNU calibration
(4) The DSNU calibration steps
1) FanOperationMode Set to Temperature, and TECOperationMode is set to Temperature.
2) Set the CoolOperationTemperature temperature to be the actual working temperature.
3) Wait for Sensor temperature stability. (DeviceControl / SensorTemperature)
4) Set BinningHorizontal and BinningVertical to X1.
5) Set TriggerMode to Off.
6) Set LUTEnalbe to Off.
7) Set DSNUMode to Off.
8) Set PRNUMode to Off.
9) Set TestPattern to Off.
10) Set the OperationMode to the TDI.
11) Set the BlackLevel to be 0.
12) Set AcquisitionLineRate, TDIStagesP1, AnalogGain and PixelFormat as parameters in actual operation.
13) Cover the lens lid, if it is not convenient to cover the lens cover, you can see whether the average gray level value, when AcquisitionLineRate is 80000Hz, TDIStagesP1 is 256, AnalogGain is X2, PixelFormat is 8bit, and set the average gray level value after setting the above parameters should be about 20, if more than 20, there is light leakage, our suggestion is to cover the lid.
14) Live starts the drawing, the DSNUGenerate camera starts the DSNU calibration, the time required is related to the AcquisitionLineRate setting, set DSNUMode to On, and observe the average gray value of the image. Theoretically, the average gray value of 8bit is 6,10bit is 25, and 12bit is 100. If the difference between average gray value and theoretical value indicates that DSNU calibration is wrong, check whether the operation procedure is correct.
15) If it is determined that the DSNU calibration is valid, DSNUSave can be performed, then the corrected data will be bound to the current PixelFormat and AnalogGain and stored in the non-volatile memory of the camera. The power loss is not lost. Next time, the stored calibration data will be automatically loaded under the combination of PixelFormat and AnalogGain.
16) If DSNUGenerateAll is selected, then phase automatically switches AnalogGain from X2 to X8, does the DSNU once under each simulation gain, and automatically saves to the camera non-volatile memory after each calibration, which will override the previous calibration data, so it is necessary to determine whether the previous DSNU calibration data can be overridden before calibration. DSNUGenerateAll You will only do the currently configured PixelFormat. If you need to do DSNU calibration under other PixelFormat parameters, you need to switch to the actual PixelFormat parameter, and then execute DSNUGenerateAll.
(5) DSNU calibration FAQ
1) Role of DSNULoad
When using DSNUGenerate calibration will not directly saved to the volatile memory, but saved in the DDR, power will be directly lost, if the DSNUGenerate calibration results are not satisfied, need to reload the history stored in the camera DSNU calibration parameters, then can click DSNULoad, phase stored before loading the camera calibration data.
2) Why different line frequency, analog gain, TDI stage, bit depth, temperature need to be done to do DSNU calibration separately
Due to the reason of sensor dark current, different line frequency, analog gain, TDI stage, bit depth and temperature background data, we cannot correct all scenes at the factory and save them to the camera, so it is suggested that customers correct them under the use conditions of their own equipment when using them. The following data are in the configuration of AnalogGain X2, DigitalGain X1 and TDI stage 256, and set the average gray value of the dark field image at 1K and 300k, respectively. The average gray value of the dark field under different line frequencies varies greatly. In terms of data, it further shows that DSNU calibration should be done separately under the line frequency.
line frequency |
8bit |
10bit |
12bit |
300K |
20 |
80 |
70 |
1K |
31 |
108 |
150 |
3) Why 8bit, 10bit open DSNU corrected image cannot not saturated, the average gray value of the image after 12bit open DSNU increased
At 8bit, the DSNU calibration subtracts a reference image (6DN) from the average dark field image (20DN) to generate a dark current calibration image (14DN). When the calibration function is turned on, the dark current calibration image (14DN) is deducted from the original image in real time, so the image will be dark relative to the original image and cannot be saturated, the same with 10bit.
At 12bit, the DSNU calibration uses the average dark field image (70DN) minus a reference image (100DN) to generate a dark current calibration image (-30DN). When the calibration function is turned on, use the dark current calibration image (-30DN) minus the original image in real time, so the image will be brighter relative to the original image. If the above problems affect the use, they can be fixed by adjusting the value of BlackLevel.
The above data is the result of the frequency of 300K, AnalogGain X2, DigitalGain X1, TDI stage 256. Under the frequency of different lines, DSNU on the image is different, which needs to be analyzed separately according to the above logic.
4) How long does the DSNU calibration take
Since DSNU calibration requires image acquisition, the calibration time is correlated with the line frequency. The larger the line frequency, the faster the calibration, and the shorter the time required. The theoretical calibration time can be calculated by the DSNU PRNU Generate time calculation table. the DSNUGenerate or DSNUGenerateAll can be judged by the code shown in the figure below. if corrected on the Sample, the calibration can be judged by observing whether the image is restored to normal.
5) How to judge that the DSNU calibration is successful
First, DSNUMode needs to be set to On, BlackLevel to 0 to see if the average gray value of the image is within the correct range. the correct mean gray value should be 8bit of 6,10bit of 25, and 12bit of 100. Secondly, we can compare the uniformity of the image in the horizontal direction, collect the images with DSNUMode set to Off and set to On respectively, and compare the image uniformity in the horizontal direction with ImageJ. If the uniformity is significantly better, the DSNU calibration is successful, and the group parameters can be saved to the camera through DSNU Save.
6) Why the DSNU calibration effect changed after switching the analog gain or bit depth
Because the DSNU calibration parameters with different bit depth and different analog gains will be saved separately, the corresponding DSNU parameters will be automatically loaded without executing the DSNULoad command when switching the bit depth or the analog gain. Therefore, if you need to switch to different bit depth or analog gain, it is recommended to switch to 10bit to perform DSNUGenerateAll and then switch to 12 bit to perform DSNUGenerateAll. Since 10bit and 8bit modes use a set of DSNU parameters, 8bit does not need to be done separately. After calibration, all bit depth and gain are corrected to facilitate the use of subsequent cameras in different bit depth and analog gain.
7) Why the image exception when doing DSNU calibration
Because the image calculation calibration parameter of Sensor is collected during the DSNU calibration, the output image will be abnormal, which is normal phenomenon and will automatically return to normal after the calibration. Therefore, it needs to wait for the DSNU calibration before image acquisition.
8) Do you need to do separate DSNU calibration for different directions?
No, because the camera will automatically correct both directions when the calibration command is executed, and the phase will automatically load the DSNU calibration parameter in that direction when the direction is switched.
9) Why the dark field background value is too large before the calibration
AcquisitionLineRate Is set to 300 kHz, TDIStagesP1 to 256, AnalogGain to X2, dark field background values theoretically 8bit to 20,10bit to 80, and 12bit to 70. If the base value is wrong, you need to determine whether DSNUMode is set to Off, BlackLevel is set to 0, PRNU is set to Off, DigitalGain is set to X1, LUTEnalbe is set to Off, and OperationMode is set to TDI.
Determine the firmware version, for historical reasons, the version before 29/04 may have large background values. The specific test is 2901211203 version, 12bit dark field background has about 170DN.
To determine whether light is leaking, it is recommended to cover the lid and compare whether there is a difference in the gray value. If there is a difference, there is light leakage.
10) Do you need to set the DSNU Mode to Off when doing the DSNU calibration
The DSNU Mode needs to be set to Off when determining if there is light leakage and whether the background value prior to dark field calibration is normal, and the DSNU Mode status does not affected before the DSNUGenerate or DSNUGenerateAll command.
11) Does UserSet affect DSNU calibration parameters?
No, only the DSNUGenerateAll and DSNUSave will override the DSNU calibration parameters that are saved inside the camera.
2. PRNU calibration
(1) Why PRNU (Photo-Response Non-Uniformity) calibration?
PRNU calibration is a calibration technique for image sensors used to remove noise and artifacts introduced in images due to the heterogeneous response of the sensor. PRNU in the image sensor is due to the manufacturing process and material nodality, leading to differences in the response of different pixels under the same light conditions. This difference may appear as the background noise, spots, stripes, and other problems in the image.
(2) PRNU calibration Methods
1) Acquisition of the Calibration Image: The camera collects a set of raw images under half-full and uniform light, preferably using uniform light, to ensure that there are no other complex effects in the calibration image.
2) Average multiple images: find an average image from a set of images.
3) Determine the target gray value: you can average the collected image as the target gray value, or you can manually enter the target gray value.
4) PRNU calibration image: The corrected image is calculated by Target Gray / Average Image.
5) Store PRNU calibration images: The generated PRNU calibration images are stored in a non-volatile memory inside the camera, as input to the late dark field calibration algorithm.
6) Application calibration: When the actual image is taken, each image taken by the camera is multiplied by the PRNU calibration image to eliminate the sensor optical response homogeneity.
(3) PRNU calibration before and after comparisons
It is obvious from the following two graphs that the corrected image in the horizontal direction has significantly improvement relative to the image uniformity before the calibration.
Uncorrected open-field gray value curve
Open-field gray value curve after PRNU calibration
(4) The PRUN calibration step
1) Set FanOperationMode to Temperature and set TECOperationMode to Temperature.
2) Set the CoolOperationTemperature temperature to be the actual working temperature.
3) Wait for Sensor temperature stability. (DeviceControl / SensorTemperature)
4) Set BinningHorizontal and BinningVertical to X1.
5) Set TriggerMode to Off.
6) Set LUTEnalbe to Off.
7) Set the DSNUMode to On.
8) Set PRNUMode to Off.
9) Set TestPattern to Off.
10) Set the OperationMode to the TDI.
11) Set the BlackLevel to be 0.
12) Set AcquisitionLineRate, TDIStagesP1, AnalogGain and PixelFormat as parameters in actual operation.
13) Put the camera down under the even light, It is recommended to use the integral sphere of uniform light, The calibration is the best, Adjust the light source brightness, Until the image reaches a semi-saturation state. Be careful to make the entire 9,072 pixels as half-saturated as possible, If the use of the transfer ring causes the image on both sides to be image sensitive, Can result to low automatically calculated target values, The last phenomenon is that the average gray value of the image decreases significantly after opening the PRNU, Then you need to update the firmware version to 2904230720 or later, This version uses the average of the 2048 pixels after the offset of 3520 pixels as the target value, Therefore, the automatic target value should be used to ensure that the middle 2048 pixels are in the exposure state.
14) Implement Live starts to draw out, execute PRNUGenerate camera to start PRNU calibration, the time required is related to the set AcquisitionLineRate, set PRNUMode to On, compare the uniformity of the horizontal direction of the image before and after the calibration, if the uniformity is significantly better, it shows that the PRNU calibration is effective.
15) If it is determined that the PRNU calibration is valid, PRNUSave can be performed, then the corrected data of this time will be bound to the currently selected PRNU Selector and stored in the non-volatile memory of the camera. The power loss is not lost, and the stored calibration data will be automatically loaded in the next PRNU Selector switch.
(5) PRNU calibration FAQs
1) Role of PRNULoad
When using PRNUGenerate calibration will not directly save to the volatile memory, but saved in the DDR, power will be directly lost, if the PRNUGenerate calibration results are not satisfied, need to reload the history stored in the camera PRNU calibration parameters, at this time you can click PRNULoad, phase stored before loading the camera calibration data.
2) Role of TargetLevelAUTO
The PRNU is in manual mode (manually setting the corrected target value with the PRNUTargetLevel parameter) and automatic PRNU mode (the camera takes the corrected image average gray value as the target value for PRNU calibration). The range of PRNUTargetLevel is 0 to 255,10bit and 12 bit.
3) Why the image exception when doing PRNU calibration
Because the image calculation calibration parameter of Sensor is collected during the PRNU calibration, the output image will be abnormal, which is normal phenomenon and will automatically return to normal after the calibration. Therefore, the image acquisition needs to wait after the PRNU calibration.
4) How long does PRNUGenerate take
Since PRNU calibration requires image acquisition, the calibration time is correlated with the line frequency. The larger the line frequency, the faster the calibration, and the shorter the time required. The theoretical calibration time can be calculated by the DSNU PRNU Generate time calculation table. the PRNUGenerate can be judged according to the code shown in the figure below. if the calibration is made on the Sample, the calibration can be judged by observing whether the image is restored to normal.
5) Role of the PRNUFactoryReset
Before leaving the factory, we will make 5 sets of default PRNU parameters under the integration ball. If the wrong PRNU parameters are accidentally stored in PRNU 0 ~ PRNU 4 during the user use, we can copy the 5 sets of default PRNU parameters to PRNU 0 ~ PRNU 4 by executing this command.
All 5 PRNUs of cameras are corrected at the factory. The calibration condition is half-full and uniform light, travel frequency =18000Hz, and bit depth and analog gain are different. The specific parameters are as follows:
PRNU0=12bit-AnalogGain×2
PRNU1=12bit-AnalogGain×8
PRNU2=10bit-AnalogGain×2
PRNU3=10bit-AnalogGain×8
PRNU4=10bit-AnalogGain×8
6) Do you need to set the PRNU Mode to Off when doing the PRNU calibration
When adjusting the image to half full sum, you need to set the PRNU Mode to Off before the PRNUGenerate command.
7) The PRNU calibration is made after the DSNU calibration, and the DSNU function is turned on
Because the PRNU algorithm inside the camera is after the DSNU algorithm, the calibration also needs to correct the DSNU and then the PRNU, and then the DSNU function is turned on.
8) UserSet Whether it affect the PRNU calibration parameters
No, only PRNUFactoryReset and PRNUSave will override the PRNU calibration parameters that are saved inside the camera.
3. LUT
(1) What is LUT
Look up table (The Lookup Table, LUT) conversion is the basic image processing function, can highlight the details including heavy
To the information. These functions include histogram equalization, gamma calibration, log calibration, exponential calibration.output image
The gray value of the original image is imageped against the original image. The user sets the corresponding value according to the application situation.
(2) Setting up the method of the LUT
LUT setting requires UptadeTool and Samplepro software, the software interface is shown in the following below.
UptadeTool Interface
Gamma: the corresponding INPUT-OUPUT curve can be called out after entering the value.
Apply: Apply the LUT curve corresponding to the current Gamma value.
Default: restore the LUT curve state when the default is Gamma = 1.
Save File: Save the current LUT curve to the specified file path.
Load File: Load the saved LUT curve file.
DownLoad: Configure the current applied LUT curve to the camera.
UpLoad: Read the configured LUT curve from the camera.
Samplepro Software
LUTEnable: LUT control switch, not open by default.
LUTIndex: INPUT value, the output value corresponding to the applied curve is automatically loaded after input, range 0~4095.
LUTValue: OUTPUT value, loaded according to the input LUTIndex value, can be manually modified, and saved, range 0~4095.
LUTSave: Save the modified curve.
LUTLoad: Loads the LUT curve.
(3) The LUT setup step
1) LUT curve configuration: Set the actual required input-output LUT curve. There are usually two ways to do:
l By setting the Gamma value, calling the corresponding Gamma curve, you can also use the mouse to do fine tuning in the Gamma curve.
l Save the default LUT file with Gamma = 1, manually modify the gray-value imageping relationship, and then load the file into the camera.
2) LUT function enabled: tick LUTEnable on the camera software.