There are some problems with Orin nano's clear hdr mode for sony's imx662

When adapting the clear HDR mode of the sony imx662, it was found that the brightness of the image increased significantly when switching to clear HDR mode, and it did not look like the merged image. Here are the photos taken in linear mode:


Here are the photos taken in clear hdr mode:

Here are some device tree configurations in clear HDR mode:

Thank you in advance for your advice

Please reference to below topic.
Also, suggest using J5.1.2

Issue with NVIDIA Jetson Orin Nano and IMX662 Camera in DOL-HDR Mode - Jetson & Embedded Systems / Jetson Orin Nano - NVIDIA Developer Forums

hello ShaneCCC,
I am currently using Linux version 35.4.1 and Jpack version 5.1.2. I modified the isp file according to the reference article, and took the photos in linear mode and clear HDR mode under the same conditions.
Below is a photo taken in linear mode:


Below is a photo taken in clear HDR mode:

I would like to ask you:

  1. In clear HDR mode, is the configuration of my device tree correct?
  2. According to the photos of the two modes taken under the same conditions, can you determine that the clear HDR mode is in the normal state of drawing?

The min/max_hdr_ratio is incorrect it should the same with ae.wdr.DreMin/ae.wdr.DreMax

The picture looks like lot of noise. Did you check others scene?

hello ShaneCCC,
I tried to use the camera to shoot different scenes, but in clear HDR mode, the picture still contained noise.I tried to change the gain of the two images by keeping the exposure time fixed when shooting the same scene, but this did not change the image too much, so I am not sure if the current output image is a composite of two frames.

Try set the ispdigitalgain to 1, you can configure it by GUI of argus_camera

yes, the isp digital gain is always set to 1. But the noise is still there. I would like to know whether the following parameters need to be configured in the device tree for clear HDR mode:
num_of_exposure = “”;
num_of_ignored_lines = “”;
num_of_lines_offset_0 = “”;
num_of_ignored_pixels = “”;
num_of_left_margin_pixels = “”;
num_of_right_margin_pixels = ““;

For DOL HDR need it, but that couldn’t be the cause of the noise.
It’s DOL HDR or PWL HDR? The mode_type need to modify to “bayer_wdr_dol”

The clear hdr mode given by sony should be similar to the dol mode, and the clear hdr mode is the fusion of two frames with different gains. But I’m not sure how to configure the corresponding parameters.

OK, suppose its DOL HDR. Did you confirm modify the mode_type?

For the configure please check below doc and consult with sensor vendor.

https://docs.nvidia.com/jetson/archives/r35.4.1/DeveloperGuide/text/SD/CameraDevelopment/SensorSoftwareDriverProgramming.html?highlight=port%20index#example-digital-overlap-wdr-exposure-frame-3840times2160

Yes, I have configured it to DOL mode, but in the configuration provided by the sensor manufacturer, the output is 12bit, but the kernel does not support the dol mode output of 12 bits. How should I configure the kernel to support dol 12-bit output?
The following is a diagram of clear hdr, if it is considered as dol mode, how should the following parameters be configured?

What the problem for configure kernel driver to 12bit?

I configured the clear hdr mode according to dol mode. When I previewed the mode with argus_camera, I found that the overall resolution and color of the image were not normal, and there would be black shadows when shooting the light source. The following is a comparison of the same scene shot in linear mode and clear HDR mode, hoping to help you make suggestions.
Linear mode:


clear HDR mode:

Can’t tell what’s happened.
What the below configure?

num_of_exposure = “”;
num_of_ignored_lines = “”;
num_of_lines_offset_0 = “”;
num_of_ignored_pixels = “”;
num_of_left_margin_pixels = “”;
num_of_right_margin_pixels = ““;

The following parameters are set as follows:
num_of_exposure = “2”;
num_of_ignored_lines = “24”;
num_of_lines_offset_0 = “58”;
num_of_ignored_pixels = “8”;
num_of_left_margin_pixels = “8”;
num_of_right_margin_pixels = “8”;
When I captured the raw image, I found that the second frame of the captured image was completely black. Does this mean that the two images are not actually fused?Here is the raw image I captured:
HDR.nvraw (8.1 MB)

That could be the sensor gain/exposure configure incorrect by sensor driver cause that.

Okay, I’ll double check that the drive gain, exposure control is correct. I also want to ask one more question, if you control the gain of two frames separately, the image will change in brightness, can you show that the preview image is the fused image?

Sorry, I don’t understand your question.
Suppose the preview is fused.

Suppose that the preview has been fused, and I can control the gain of hg and lg channels, so that the brightness of the preview image will change when the gain of only one channel is modified, can it indicate that the preview image has been fused

Yes, the preview image has been fused.