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
- Bayer RAW (raw sensor data)
- EIP demosaicing
- Black level EIP
- Balance / rendering
- JPEG
EIP ISP path
- Bayer RAW
- Neutralised ISP
- RGB888 (8 bits each for red, green and blue)
- EIP black level
- Balance / rendering
- JPEG
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
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.
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.
Black level 64 subtracted; the 64–1023 range is expanded to 0–255.
Output: 0–255
The full 0–1023 domain is converted to 0–255.
Output: 0–255
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.
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
Almost identical frame rate; CPU load and latency sharply reduced.
Pi 3 + OV5647 · 2592 × 1944
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.