Tonemap for endoscopy — real-time local contrast

Updated:

Tonemap for endoscopy is the Fastvideo adaptive local tone mapping module, configured for endoscopic imaging — the same module, not a separate product. It processes the endoscope video stream on the GPU in real time — before the image reaches the monitor and before it is recorded — lifting detail out of the shadows, evening out illumination and holding local contrast, without adding halos or shifting color. It is a classic, deterministic algorithm designed by Fastvideo and runs on NVIDIA CUDA, on live video from Pentax, Olympus, Fujinon and Aohua endoscopy processors.

This page is adaptive local contrast / local tone mapping for endoscopy. Looking for narrow-band, color and surface enhancement? See Image-Enhanced Endoscopy (IEE). Need raw-sensor processing? See the GPU ISP for the OmniVision OH02B10 endoscopy sensor.

The problem it solves

Endoscopic image quality is limited by the physics of the shot: the endoscope lights the tissue from its own tip, so the area near the probe is overexposed while distant areas sit in deep shadow. Add uneven illumination and vignetting, and shadows behind the folds — and detail in the shadows and under the highlights becomes hard to read. That raises visual strain for the doctor and degrades the recorded video as well.

Before and after

The same endoscope frame — original on the left, processed by Tonemap for endoscopy on the right. Watch the deeper, shadowed folds: detail and the vascular pattern become readable, while the bright reflections stay controlled.

Endoscopy frame before and after Tonemap for endoscopy: left original, right processed with shadows lifted and local contrast enhanced
Left: original endoscopic image. Right: Tonemap for endoscopy — shadows lifted, local contrast preserved.

The behavior is the same across different scenes and anatomy, with no per-frame tuning — the algorithm lifts detail out of the shadows and keeps the bright reflections under control, without haloing or color shift. In the colonoscopy example below, the same shadow recovery opens up the recesses between the mucosal folds.

Colonoscopy frame before and after Tonemap for endoscopy: left original, right processed with shadows lifted and local contrast enhanced
Colonoscopy — left: original endoscopic image; right: Tonemap for endoscopy (shadows lifted, local contrast preserved).

What Tonemap for endoscopy does to the image

Key properties

Where it sits in the pipeline

  1. Endoscopy video processor (Pentax, Olympus, Fujinon, Aohua) — the video source.
  2. GPU capture and ISP → a color (RGB) frame.
  3. Tonemap for endoscopy (GPU, real time) — shadow recovery, local contrast, illumination flattening.
  4. Enhanced video → the doctor’s monitor in real time.
  5. In parallel — recording and archiving of the video and frames.

Areas of application

Thanks to a classic, deterministic algorithm, Tonemap for endoscopy is equally effective across different kinds of endoscopy without extra tuning:

How you can use it

System requirements

ParameterValue
PlatformWindows 10/11, Linux; NVIDIA Jetson for embedded
GPU (for real time)NVIDIA GeForce RTX / NVIDIA RTX with CUDA
CPUx86_64 (Intel/AMD) or ARM (Jetson)
Memoryfrom 16 GB (depends on resolution: Full HD / 4K)
Video sourcePentax, Olympus, Fujinon, Aohua video processors
Input formatsvideo stream or frames (RGB): JPEG, TIFF, PNG, BMP
Output formatsprocessed video stream; frames in JPEG, TIFF
Latencyreal time, low latency on the GPU

Important: Tonemap for endoscopy is software for improving the visualization of images received from a video processor. It does not diagnose and does not flag pathology — it raises the readability of the picture for the specialist.

Related GPU imaging

Image sources & credits

The before/after examples use endoscopic images from the HyperKvasir dataset, released under a Creative Commons Attribution 4.0 International (CC BY 4.0) license, which permits reuse — including commercial — with attribution. We processed the frames with Tonemap for endoscopy to illustrate the effect; the processing is ours, the original images remain © their authors under CC BY 4.0.

Dataset: Borgli H, Thambawita V, Smedsrud PH, et al. “HyperKvasir, a comprehensive multi-class image and video dataset for gastrointestinal endoscopy.” Scientific Data 7, 283 (2020). doi:10.1038/s41597-020-00622-y · datasets.simula.no/hyper-kvasir

Original source files used (from HyperKvasir, then processed with Tonemap for endoscopy):

  • 00076284-62a7-4a63-bad4-b1d0fd962b81.jpg
  • 0009841a-0ebf-4c82-9a4e-1e370becdc68.jpg
Fyodor Serzhenko, Fastvideo

About the author

Fyodor Serzhenko, PhD, is the founder and CEO of Fastvideo. He earned his PhD at the Moscow Institute of Physics and Technology (MIPT) in 1993. Since 2009 he has led the development of Fastvideo’s GPU-accelerated image codecs and ISP modules, including the Fastvideo SDK. Connect on LinkedIn.

Why you can trust these results

Fastvideo has built GPU-accelerated image processing software since 2009. Our codecs comply with the standards they implement — JPEG (ITU-T T.81 / ISO IEC 10918) and JPEG2000 (ITU-T T.800 / ISO IEC 15444) — and our tools are open source on GitHub. Every performance figure we publish is reproducible: see our benchmark methodology, download the Fastvideo SDK benchmark report (PDF), and measure it on your own GPU.

Contact Form

This form collects your name and email. See our Privacy Policy for how we handle your personal data.