Skip to main content

Image quality: catch what the metrics miss

For camera, ISP and imaging teams, and for embedded teams that hand an algorithm over to silicon.

A better PSNR doesn't mean a better image. Halos, plastic textures and color shifts get past the metrics, and get caught by customers. QA-Board runs your pipeline on every commit and puts its images next to the release's, in sync down to the pixel, under the metrics that go with them. Your team sees what changed before it ships.

A new denoiser: PSNR goes up, and so does the edge overshoot. The images show why: halos around the window frame.

What it changes for your team​

  • Metrics and images on one page. Each run starts with its metrics against the reference, then its images side by side. Nobody pastes screenshots in a chat thread to argue which version looks better.
  • Every commit, every chart, every light level. CI runs the pipeline on your test set; the review starts with the runs whose images changed the most.
  • Down to the pixel, at any size. Synced zoom, wipes, differences, and the values your code saved, 16-bit and float included, from thumbnails to a 113-megapixel test wall, and on videos frame by frame.
  • Bit-exact before silicon. CI checks that a fixed-point model's outputs didn't change, file by file, before a change reaches the chip team.

See it in action​

The pictures come from a demo camera pipeline, in the middle of its history: a new denoiser was merged because it won PSNR in low light, and the team is finding out what it did to the images.

Spot the artifact the metric rewards​

Zoom into one image and the reference follows. The new denoiser outlines the leaves with dark halos.

New and reference images of the facade, zoomed on leaves in front of the wall: in the new image, dark halos outline every leaf.New and reference images of the facade, zoomed on leaves in front of the wall: in the new image, dark halos outline every leaf.
Both images at the same zoom: only the new denoiser outlines the leaves with dark halos.

Let the difference point at it​

Wipe across the images, then show their difference: raise its maximum until only the halos stand out.

Synced zoom, a wipe, then the difference between the images, and its maximum.

Measure it, not only see it​

Profiles of the row and column under the pointer show the overshoot on both sides of an edge. Statistics, histograms and the pixels' values are one click away.

The slanted edge zoomed in, new and reference side by side, a crosshair on the edge; under them, the profiles of the row and column under the pointer: across the edge, the new image (solid) dips lower on the dark side and rises higher on the bright side than the reference (dashed).The slanted edge zoomed in, new and reference side by side, a crosshair on the edge; under them, the profiles of the row and column under the pointer: across the edge, the new image (solid) dips lower on the dark side and rises higher on the bright side than the reference (dashed).
Profiles of the row and column under the pointer: across the edge, the new image overshoots on both sides, the halos the sharpening adds.

Start with the runs that changed most​

The server compares every run's images with the reference's and ranks them: the photos with halos come first, the charts that didn't change last.

The list of a commit's runs ranked by how much their output images differ from the reference's, with a bar, a percentage and the number of regions found for each; the 113 MP test wall, a TIFF, has no out.png to compare.The list of a commit's runs ranked by how much their output images differ from the reference's, with a bar, a percentage and the number of regions found for each; the 113 MP test wall, a TIFF, has no out.png to compare.
Where they differ, in all the runs: the runs whose images changed most first.

Check the fix​

A clamp on the sharpening keeps the PSNR gain. Drag the divider: the dark rims fade, the edges stay crisp.

Leaves in front of the facade, after the bilateral denoiser: a dark rim outlines every leaf against the wall.Leaves in front of the facade, after the bilateral denoiser: a dark rim outlines every leaf against the wall.
The same leaves once the sharpening is clamped: the edges stay crisp, with only faint rims.The same leaves once the sharpening is clamped: the edges stay crisp, with only faint rims.
With the clamp, the edges stay crisp and the halos fade.

Agree on a look, without bias​

A blind test hides which image is which until you click Reveal.

A blind test on the leaves over the facade's window: the two images side by side, labelled A and B in gray instead of new and reference, and so are the hovered pixel's values above them; in the toolbar, Reveal shows which is which.A blind test on the leaves over the facade's window: the two images side by side, labelled A and B in gray instead of new and reference, and so are the hovered pixel's values above them; in the toolbar, Reveal shows which is which.
A blind test hides which image is which: A and B, in a random order, until you click Reveal.

Zoom into 113 megapixels​

The viewers load only the tiles they show, in both images at once, from the full view down to single pixels.

Deep zoom on a 113 MP image: the viewers load only the tiles they show.

Every stage of the pipeline​

One slider moves through the stages, from the raw mosaic to the tone-mapped image, in every run's card at once.

One slider over the ISP's stages drives every run's card.

Videos, frame by frame​

Step through both videos in sync, wipe across them, zoom in, flip between them. The denoiser's halos show here too.

Videos in sync, frame by frame: with a wipe, zoomed in, flipped in place, and their difference.

Find the commit that did it​

Trends follows one input across commits: hover a point to compare its output with the commit before.

PSNR of the facade photo over six weeks of main, a point per commit, with a jump at the merge of the bilateral denoiser. Below, that commit and the one before, and their output images: only the new one outlines the leaves.PSNR of the facade photo over six weeks of main, a point per commit, with a jump at the merge of the bilateral denoiser. Below, that commit and the one before, and their output images: only the new one outlines the leaves.
Hover a point to compare its commit's outputs with the commit before: the PSNR jumps when the bilateral denoiser is merged, and the leaves get halos.

Hand over to silicon, bit-exact​

On the fixed-point model, Output Files lists only the files that changed, each diffed with the reference's: here a rounding change in the register dump. A commit that changes none is tagged Bit-accurate, and qa check-bit-accuracy fails CI otherwise.

Click files to diff them with the reference, Ctrl-click to diff several. A commit that leaves every file identical is bit-accurate.

How it's set up​

Your code writes images and returns metrics. qaboard.yaml says where the inputs are, which files to show and how, and which files must stay bit-accurate. Paths with :stage give the synced slider over the stages.

qaboard.yaml
inputs:
# relative to this folder: generated charts, downloaded photos, and videos made from them (clips/*.yaml)
database:
linux: inputs
windows: inputs
globs: ['*.png', '*.tiff', 'clips/*.yaml']
batches: qa/batches.yaml

outputs:
metrics: qa/metrics.yaml
# Run cards as wide as a laptop's screen allows: new and reference images are about 600 px wide each
style:
width: 1180px
visualizations:
- name: Output
path: out.png # the 113 MP wall has out.tiff instead, streamed through IIIF
- name: ISP stage (1 raw, 2 demosaic, 3 denoise, 4 sharpen, 5 tone map)
path: "stages/:stage.jpg" # 1..5: sequential integers give a synced slider
- name: ISP stage, hw-model
path: "stages/:stage.png" # the 256x256 window of raw/*.u16, as PNG, to compare bit for bit
- name: Edge profile
path: edge.plotly.json # slanted edge: ESF, with the overshoot annotated
side_by_side: false
- name: MTF
path: mtf.plotly.json
side_by_side: false
- name: Color errors
path: color.plotly.json # ΔE2000 per patch, bars
side_by_side: false
default_hidden: true
- name: Noise vs signal
path: noise.plotly.json
side_by_side: false
default_hidden: true
- name: Registers
path: regs.txt # hw-model only
default_hidden: true
- name: Video
path: out.webm # clips/*.yaml: played in sync with the reference, frame by frame
fps: 24

bit_accuracy:
patterns: ['out.png', 'stages/*.png', 'raw/*.u16', 'regs.txt']
plaintext: ['*.txt']
The metrics: labels, units, targets, and which way is better

The web app colors changes with them. The last lines pick the metrics of the Summary, and those on each run's card and in the tables.

qa/metrics.yaml
# Metrics returned by run() in qa/main.py. Chart metrics only exist on the charts that measure them.
available_metrics:
psnr:
label: PSNR
description: Peak signal-to-noise ratio of the output against the ideal output (the scene, without blur or noise, through the same tone curve).
suffix: ' dB'
smaller_is_better: false
target: 30
ssim:
label: SSIM
description: Structural similarity of the output's luma with the ideal output's.
smaller_is_better: false
target: 0.9
noise_flat:
label: Noise in flat patches
short_label: Noise
description: Standard deviation of the luma (8-bit) in the flat gray chart and in the gray patches of the color chart.
suffix: ' DN'
smaller_is_better: true
target: 2.0
mtf50:
label: MTF50
description: Spatial frequency where the contrast drops to 50%, measured on the slanted edge (ISO 12233-style).
suffix: ' cy/px'
smaller_is_better: false
target: 0.25
overshoot:
label: Edge overshoot (halos)
short_label: Overshoot
description: How far the slanted edge's profile goes past the dark and bright levels, as a share of the step.
suffix: '%'
scale: 100
smaller_is_better: true
target: 0.05
delta_e:
label: Color error ΔE2000
short_label: ΔE2000
description: Mean CIEDE2000 difference between the color chart's patches and their ideal colors.
smaller_is_better: true
target: 5
fxp_psnr:
label: Fixed-point vs float
short_label: FxP PSNR
description: hw-model only. PSNR of the fixed-point output against the float pipeline's output on the same raw.
suffix: ' dB'
smaller_is_better: false
target: 45
runtime:
label: Runtime
description: Time to simulate the camera, run the ISP and measure.
suffix: ' s'
smaller_is_better: true
is_failed:
label: Crashed
short_label: Crashed
description: The run crashed.
suffix: '%'
scale: 100
smaller_is_better: true
target: 0

default_metric: psnr
summary_metrics: [psnr, ssim, overshoot, mtf50, noise_flat]
main_metrics: [psnr, ssim, overshoot, mtf50, runtime]

Try it on the demo​

examples/image-quality simulates the camera of a fictional warehouse robot (lens blur, a Bayer sensor, noise), then runs an image pipeline on the raw image: demosaic, denoise, sharpen, tone map. It measures PSNR and SSIM against the ideal output, noise, sharpness (MTF50), halos (edge overshoot) and color errors (ΔE 2000). The hw-model platform runs the same pipeline in fixed-point integers, like a camera chip.

The story the pictures tell: six weeks of commits
  1. A new bilateral denoiser wins 1.6 dB of PSNR in low light and halves the noise. It's merged.
  2. The images show halos along strong edges: the edge overshoot went from about 4% to 11%.
  3. A clamp on the sharpening keeps the PSNR gain and brings the overshoot back to 5%.
  4. On the fixed-point model, rounding changes are checked bit for bit before they reach the chip.

With a QA-Board server (quickstart), from a clone of the repository:

cd examples/image-quality
pip install qaboard -r requirements.txt
qa run --input charts/slanted-edge.png # one run
qa batch ci # 5 charts and 4 photos, at ISO 100 and 3200
qa --platform hw-model batch bitexact # the fixed-point model

The first run downloads the photos and generates the test charts. Shared results go to /mnt/qaboard, or to $QA_STORAGE. With the quickstart's server, first export QABOARD_URL=http://localhost:5151 QA_STORAGE=/tmp/qaboard. The example's README explains each file.

Where next​

  • User guideThe image viewer
    Every tool to compare images, and a review of this commit, step by step.
  • Project integrationBit accuracy
    Check in CI that a change left every output file identical.
  • Get startedPut your project on QA-Board
    Wrap your pipeline with qa, run it on your test set, see the results.