Discovery version

Bringing the ISP back without losing control of the signal

The Raspberry Pi can turn raw sensor data into a colour image using a specialised circuit. EIP nevertheless performs this work in software to preserve the quality of raw data (RAW), at 8 bits and above. I measured how to reuse this accelerator for preview without handing over scientific processing or modifying the recorded data.

Image signal processor (ISP)EIPIMX477OV5647Preview

How can I use the Raspberry Pi's image signal processor (ISP) to reduce the central processing unit (CPU) workload while keeping control of the signal?

A colour sensor does not yet provide a ready-to-view image. Each photosite measures a single colour; the other components must be reconstructed through demosaicing and the image rendered for display. A general-purpose processor can do this work, but the Raspberry Pi already has an image specialist: a hardware circuit designed to produce a colour image.

This circuit is called an ISP, short for Image Signal Processor. EIP uses it to accelerate preview while keeping rendering decisions and raw data (RAW) under its control.

Two preview paths, with scientific RAW kept separate

Software path

  1. Bayer RAW (raw sensor data)
  2. EIP demosaicing
  3. Black level EIP
  4. Balance / rendering
  5. JPEG

EIP ISP path

  1. Bayer RAW
  2. Neutralised ISP
  3. RGB888 (8 bits each for red, green and blue)
  4. EIP black level
  5. Balance / rendering
  6. JPEG
Scientific RAWrecording · transport · characterisation · measurementsremains RAW, outside the ISP path
Conceptual diagram. The ISP speeds up production of the preview image; it neither replaces nor modifies scientific RAW.

A standard image processor can automatically apply white balance, a colour correction matrix, gamma, noise reduction, defect pixel correction (DPC), sharpening or lens shading correction. These automatic features are convenient for an attractive photograph; they complicate interpretation if their effects are not controlled.

Conventional ISP

Can automatically correct, balance, smooth, sharpen and adjust contrast.

ISP as used by EIP

EIP disables these operations or configures them to leave values unchanged. This neutralisation relies on a complete profile; simply setting colour gains to unity is not enough.

The selected preview pipeline is: Bayer RAW → neutralised and linearised VC4 ISP → RGB888 → EIP black level correction → EIP balance → EIP gain, gamma, stretching, saturation and dispersion. Recorded, transported and characterised RAW remains outside this pipeline.

A chart to reveal deviations, rather than certify colour

PiNox camera set up in front of a homemade, hand-painted colour chart.
PiNox facing the homemade colour chart painted by my daughter. It helps reveal deviations visually, but does not replace a certified colour chart.
PiNox interface showing the chart with EIP software demosaicing active and the ISP selector available.
The chart in PiNox with the EIP software path active. The selector switches to the ISP for an immediate visual comparison.

Two processing paths, the same starting RAW

To check this principle, the test bench asks libcamera to produce both RAW and the ISP RGB image in the same request. EIP then processes that same RAW in software. The two images being compared therefore come from the same capture.

Comparison of EIP processing and the neutralised ISP: for each black-level condition, zero or 64, the outputs are paired within the same libcamera request.
EIP's software processing on the left, neutralised ISP on the right. The green cast is intentional: colour gains are kept at unity to compare transformations, rather than produce a corrected image.

Black level was the culprit

An initial comparison gave a mean slope of 1.0662 between ISP values and those produced by EIP. The ISP subtracted a black level of 64, then expanded the remaining range across the entire 8-bit scale. This rescaling explained the difference without invoking colour amplification.

Two conditions actually measured

These two diagnostics, normalised to the 10-bit domain for an 8-bit output, isolate range expansion after black subtraction.

ISP black 64Prediction 1.0636 · measured 1.0662

Black level 64 subtracted; the 64–1023 range is expanded to 0–255.

0641023

Output: 0–255

ISP black 0Prediction 0.9971 · measured 0.9993

The full 0–1023 domain is converted to 0–255.

01023

Output: 0–255

Representation of the value range, not pixels or interpolation. Only these two conditions were tested.

With a black level of 64, code 64 becomes zero in the corrected range, which is then expanded to 0–255; at 0, the full 0–1023 domain is converted to 0–255 with no subtraction by the ISP.

EIP production pipeline: black level neutralised at 0 in the ISP, then black-level correction applied once by EIP.

Setting ISP black level to 0 gives a measured slope of 0.9993, close to the prediction of 0.9971. The measured slope ratio is ≈ 0.9372, compared with a prediction of 0.93744; the relative difference is < 0.04%. Black-level correction is then applied once in EIP.

R²: 0.99587–0.99988Coefficient of determination of the regressions for each channel.
Small residualsRoot mean square error (RMSE) of approximately 0.5–1.0 digital counts in the 8-bit output, depending on the channel; the two demosaicing methods differ.
Map of the ISP/EIP difference, amplified eightfold.
ISP minus EIP difference, amplified eightfold. The map remains close to uniform grey; the faint residual structures are consistent with differences between colour reconstruction algorithms.

What this actually changes on Pi 4 and Pi 3

The benefit depends on mode, resolution, sensor and the stage that limits frame rate or consumes the most CPU time.

Pi 4 + IMX477 · 4056 × 3040

Software11.20 FPSCPU 232.6% · 55.7 ms
ISP11.24 FPSCPU 93.4% · 40.2 ms

Almost identical frame rate; CPU load and latency sharply reduced.

Pi 3 + OV5647 · 2592 × 1944

Software12.80 FPSCPU 299.0% · 72.8 ms
ISP14.92 FPSCPU 113.7% · 42.2 ms

Higher frame rate, sharply reduced CPU load and lower latency.

Frame rate is expressed in frames per second (FPS). Central processing unit (CPU) load measures the work required of the processor; it can exceed 100% when several cores are used. The time in milliseconds corresponds to latency. These values describe the test bench's machines and settings, rather than universal performance for all Raspberry Pi boards.

These measurements compare the two paths on each machine, rather than Pi 3 against Pi 4: the sensors and modes differ.

On the full-resolution IMX477, frame rate is limited by the camera but the ISP frees up a substantial amount of CPU time. On Pi 3 with the OV5647, it also reduces latency and increases delivered frame rate. In some binned IMX477 modes, the benefit is much smaller: the software path was already efficient there.

What the ISP must leave untouched

The ISP can help

  • preview demosaicing;
  • RGB8 production;
  • reducing the main processor's workload.

EIP remains in control

  • RAW and recording;
  • transport and characterisation;
  • scientific rendering and path selection;
  • regions of interest, stacking and fallback modes when software is required.

If the ISP profile is missing or incompatible, fallback to software is explicit. Software and ISP modes remain selectable for comparing results.

Experimental results and limitations

What the study establishes

  • in the paired condition tested on IMX477, the neutralised ISP produces RGB8 that is radiometrically consistent with EIP processing;
  • the slope changes from 1.0662 to 0.9993 when ISP black level is neutralised;
  • residuals are small and no measurable smoothing or sharpening appears in the checks performed;
  • the ISP substantially reduces CPU load and latency in the highlighted configurations;
  • scientific RAW remains unchanged and outside the ISP path.

Not demonstrated

  • perfect pixel-for-pixel equivalence;
  • the same improvement in every mode;
  • equivalent paired radiometric validation for the OV5647;
  • that ISP-produced RGB8 could replace RAW for scientific use;
  • universal performance on all Raspberry Pi boards.

Continue reading

Other version

Measured integration of the Raspberry Pi ISP into EIP — Scientific version · Paired protocol, checks and detailed tables.