Why bilinear demosaicing is not enough
Updated:
This is the software‑product view of Fastvideo demosaicing: a ready‑to‑use component that converts raw Bayer frames from a high speed or machine vision camera into full‑colour RGB in real time on the NVIDIA GPU. It ships as part of Fastvideo Lab and the Fastvideo SDK, so you can plug high quality debayering into a capture or streaming pipeline without writing CUDA kernels yourself.
What it does
- Converts 8/16‑bit Bayer data into 24/48‑bit RGB much faster than any CPU implementation
- Supports all four Bayer patterns: RGGB, BGGR, GBRG, GRBG
- Strong colour‑moire suppression for clean high‑resolution output
- Runs as a stage of the full GPU ISP or standalone for evaluation
Why not bilinear
Most demosaicing in machine vision is still bilinear interpolation or a simple gradient variant, because that is what fits a CPU budget. On flat areas it is indistinguishable from anything better. It fails exactly where the image is interesting: alternating light and dark pixels along high‑contrast edges — the zipper artefact — colour fringes on single‑pixel structures such as wires, text and grid lines, and moiré on periodic patterns like fabric or roof tiles.
None of that is cosmetic if the picture is later measured. False colour changes pixel values, and a zipper edge moves the edge. Better demosaicing has existed for years; what it lacked was a machine fast enough to run it on every frame. HQLI, DFPD and MG are those algorithms, written for CUDA from the start.
Algorithms and quality
Four demosaicing algorithms trade quality against speed, so you can pick the right point for your application. Image quality is measured on the Kodak data set; the numbers below summarise the algorithm family — full per‑GPU benchmarks are on the dedicated CUDA Debayer benchmark page.
| Algorithm | Window | Avg PSNR, Kodak | Relative speed |
|---|---|---|---|
| HQLI | 5×5 | ~ 36 dB | Fastest |
| L7 | 7×7 | ~ 37.1 dB | Fast |
| DFPD | 11×11 | ~ 39 dB | Medium |
| MG (highest quality) | 23×23 | ~ 40.5 dB | Quality-first |
Integration
The same demosaicing engine powers the Fast CinemaDNG Processor and the Fastvideo SDK, where debayer is one stage of a full pipeline: dark‑frame subtraction, flat‑field correction, white balance, denoising, colour correction, tone mapping, resize, sharpening and JPEG/JPEG2000 encoding.
Specifications, benchmarks and licensing for this module are on the product page: GPU Debayer at fastcompression.com.