hdr_instructions - framosimaging/framos-nxp-drivers GitHub Wiki
Change the mode to dol or clearHDR mode (the last two ones) for imx6* sensor in /opt/imx8-isp/bin/start_isp.sh
file and run the script. Then test the stream using the gstreamer
gst-launch-1.0 -v v4l2src device=/dev/video2 ! queue ! waylandsink
You can use v4l2 controls to change exposure, very short short exposure and gain, very short gain for DOL2, or exponential gain for ClearHDR like this:
v4l2-ctl -d /dev/v4l-subdev1 -c exponential_gain=30 # 0, 30, 60, 90, 120, 150, 180 for imx676
v4l2-ctl -d /dev/v4l-subdev1 -c exponential_gain=0 # other values 0,1,2,3,4,5 for imx662 and imx678
To change HDR ratio between exposures change IMX<SENSOR_ID>_Basic_HDR_WIDTHxHEIGHT.xml
file to
<hdr enable="true">
<exposure.ratio>16</exposure.ratio>
<extension.bit>0</extension.bit>
</hdr>
the second field extension.bit
does not have any effect (nxp version 6.6.3). The ISP should now tune the image so the exposure ratio is valid.
To set a default value for auto exposure change SetPoint
to some value. If you notice that the convergence of auto exposure algorithm is too slow you can increase/decrease convergence of parameters
by changing Damp
parameters.
<AEC index="1" type="struct" size="[1 1]">
<SetPoint index="1" type="double" size="[1 1]">
[ 80]
</SetPoint>
<ClmTolerance index="1" type="double" size="[1 1]">
[ 20]
</ClmTolerance>
<DampOver index="1" type="double" size="[1 1]">
[ 0.2]
</DampOver>
<DampUnder index="1" type="double" size="[1 1]">
[ 0.3]
</DampUnder>
<DampOverVideo index="1" type="double" size="[1 1]">
[ 0.7]
</DampOverVideo>
<DampUnderVideo index="1" type="double" size="[1 1]">
[ 0.9]
</DampUnderVideo>
...
Max very short expoure is limited by maximum number of integration lines by NXP (AN13326) which is typically around 1000 us. Check the calculation bellow for you concrete situation.
max_integration_lines = 62
hmax = 1100 # 1H period for selected data rate
line_time = (hmax * 10**6) / (INCK) [us]
max_vs_exposure = max_integration_lines * line_time
Dol2 image is very noisy and can be used only in overexposed images.
- Application note AN13326 by NXP
ISP HDR Modes and Sensor Types