HDR mode on the Pi 5

Section 9.7 of the “The Picamera2 Library” manual https://pip-assets.raspberrypi.com/categories/652-raspberry-pi-camera-module-2/documents/RP-008156-DS-2-picamera2-manual.pdf mentions features available on the Raspberry Pi 5 for capturing HDR images.

Given its brevity, I’m reproducing the section in its entirety:

“9.7. HDR mode on the Pi 5

The Raspberry Pi 5 has some in-built support for HDR, allowing its use even for non-HDR cameras.
To turn on the HDR mode, use (assuming picam2 is your Picamera2 object)

Code
import libcamera
picam2.set_controls({‘HdrMode’: libcamera.controls.HdrModeEnum.SingleExposure})

and to disable it use

Code
picam2.set_controls({‘HdrMode’: libcamera.controls.HdrModeEnum.Off})

The HDR mode can be configured in the {rpi-datasheets-url}/camera/raspberry-pi-camera-guide.pdf[Raspberry Pi Camera Tuning Guide] but which is beyond the scope of this document.

Because this HDR mode relies on the Pi 5′s TDN (Temporal Denoise) function to accumulate images, it’s important to skip a number of frames after a mode switch to allow this process to happen. When using the switch_mode_and_capture family of methods, the delay parameter should therefore be specified for this purpose, for example

Code
picam2.switch_mode_and_capture_file(capture_config, “image.jpg”, delay=10)
would allow 10 frames to be accumulated.”

The obvious question is, has anyone tried it? And if so, does it produce good results?

Understanding how this HDR mode works is quite difficult. Rather than the picamera2 manual, you should read this:

I started a discussion on this topic some time ago, but I didn’t pursue it further.See in this discussion how the merge is done, not much to do with HDR processing in my opinion.

1 Like

@dgalland Thanks for your reply.

Indeed, it doesn’t seem like an easy task. That’s why I posted the question in the group.

Hopefully, someone has already tried it and can shed some light on the matter.

Regards