Scientific version

Measured integration of the Raspberry Pi ISP into EIP

Validation of a linearised hardware demosaicing path against EIP's software processing: paired captures, black-level checks, spatial tests and performance measurements on IMX477/Pi 4 and OV5647/Pi 3.

Image signal processor (VC4 ISP)Red, green and blue (RGB, 8-bit)Raw sensor data (RAW12)IMX477OV5647Server benchmark

Can a neutralised image signal processor (ISP) produce an 8-bit red, green and blue (RGB) image that is radiometrically consistent with EIP's software processing, while reducing preview cost?

Study status. The ISP path has been validated visually and for performance on the tested IMX477 and OV5647 configurations. Paired radiometric consistency with EIP has been measured only on the IMX477, for one scene, exposure and gain, using paired outputs from the same libcamera request. Full radiometric validation remains to be repeated for the OV5647. Performance improvements are confirmed on Pi 4 and Pi 3, but their magnitude depends strongly on the sensor mode. The article date marks the completion of the optimised path in the EIP code.

Question, purpose and scope

EIP must retain a RAW (raw sensor data) path for recording and measurement, while producing a colour preview with a workload compatible with less powerful Raspberry Pi boards. The aim is to use the Raspberry Pi ISP for demosaicing, then explicitly reapply EIP corrections.

This validation covers the 8-bit RGB (red, green and blue) preview encoded as MJPEG. RAW transport, scientific captures and RAW recordings do not pass through the ISP. The ISP output is used for preview; scientific measurements retain access to RAW.

Architecture of the two paths

Software path

  1. Bayer RAW
  2. EIP demosaicing
  3. EIP black level
  4. Balance / rendering
  5. JPEG

ISP path

  1. Bayer RAW
  2. Neutralised / linearised VC4 ISP
  3. RGB888
  4. EIP black level
  5. Balance / rendering
  6. JPEG
Scientific RAW unchangedtransport · recording · characterisation · measurementsoutside the ISP path
Preview processing architecture and separation of the scientific RAW path.

The server exposes three choices: software, isp and auto. Automatic mode selects the ISP when a validated profile is available and explicitly falls back to software otherwise. Manual selection remains available for A/B comparisons.

The ISP is ineligible when raw rendering is requested, when a region of interest or stacking is active, when the source is not libcamera, or when no compatible linear profile has been validated.

ISP neutralisation contract

Each production profile requires a set of neutral processing settings, checked at load time. Disabling automatic exposure and white balance is part of this, but is not sufficient on its own. The server rejects any profile that deviates from these conditions.

Required blocks and enforced settings in the neutralised profile.
ISP blockRequired settingPurpose
Black level0 in the ISPAvoid range rescaling; apply the correction once in EIP.
Colour correction matrixIdentityAvoid automatic channel mixing.
Automatic white balance / colour gainsAutomatic white balance (AWB) disabled; ColourGains=(1,1)Avoid automatic correction of channel ratios.
Contrast and gammaIdentity curvePreserve a linear relationship.
Defective pixel correction (DPC), noise reduction, green equalisationDisabledPrevent silent changes to local structure.
SharpeningZero strength and limitPreserve high frequencies.
Lens shading correction, HDR, neural white balanceDisabledAvoid spatial and nonlinear transformations.

For this path, AwbEnable is forced to false and ColourGains=(1,1). These controls alone do not constitute neutralisation: it depends on the entire profile. EIP manual balance and colour saturation are applied to the image coming from the ISP.

Visual development setup

A homemade colour chart was used during development to make gross deviations immediately visible and check A/B switching in PiNox. This observation remains qualitative: the validation of radiometric linearity described below relies on paired pixels from the same request, rather than certified reference colours.

PiNox camera aimed at a homemade colour chart used during ISP development.
Development setup with PiNox and the hand-painted chart.
PiNox preview of the chart with EIP software processing active.
EIP software preview. The same screen allows the ISP path to be enabled for A/B checks.

Paired IMX477 protocol

The isp_linear_bench test bench configures a libcamera request with two simultaneous streams, RAW and RGB. Capture settings are:

The EIP production codec processes the RAW data from that same request. The analysis recalculates statistics outside the capture binary, accounts for row stride, restores RGB components to their logical order, excludes a 24-pixel border and removes saturated pixels.

Montage of EIP and neutralised ISP images for black-level conditions zero and 64.
On each row, the two images come from the same libcamera request. The native tint is not a colour correction: gains are deliberately kept at unity.

Black-level rescaling

In the diagnostic experiment with ISP black level set to 64, the regression ISP = slope × EIP + offset gives a mean slope of 1.0662. The ISP subtracts black and then expands the usable range to 0–255, whereas the EIP codec divides the 10-bit scale by four.

Predicted slope with black 64 = 4 × 255 / (1023 − 64) = 1.0636
Predicted slope with black 0 = 4 × 255 / 1023 = 0.9971

In the diagnostic condition with ISP black level set to 0, the measured mean slope is 0.9993. The measured ratio between the two conditions is approximately 0.9372, compared with a prediction of 0.93744. The relative difference is below 0.04%. The EIP production pipeline keeps ISP black level at 0 and then applies black-level correction once in EIP.

ISP/EIP slopes, by channel and averaged, for each diagnostic black level.
ConditionR channelG channelB channelMean
ISP black 64, EIP black 641.06841.06501.06521.0662
ISP black 0, EIP black 01.00120.99830.99840.9993

The coefficients of determination (R²) range from 0.99587 to 0.99988. The initial difference is therefore explained by range rescaling, rather than an unknown amplification of colour.

Radiometric, spatial and frequency validation

ISP/EIP alignment preserves orientation, with no measurable flip or shift. High-frequency diagnostics give a slope between 0.9998 and 0.9999 and a local variance ratio of 1.000–1.006, depending on the channel. No measurable smoothing or edge enhancement appears in the checks performed with the neutralised profile.

The spatial ISP/model ratio remains centred around 1.0002, with a standard deviation no greater than 0.0014. This is consistent with lens shading correction being disabled.

Difference between the neutralised ISP image and the image processed by EIP, amplified eightfold.
ISP minus EIP residual, amplified eightfold. The root mean square error (RMSE) per channel remains between approximately 0.5 and 1.0 digital counts in the 8-bit output. The two demosaicing algorithms are not identical, so pixel-for-pixel equality is not expected.

On sequential server captures, the difference in global channel means remains no greater than 0.11 digital number (DN). The mean absolute pixel difference is around 2.29 DN, with a 99th percentile of 9. This measurement includes differences in demosaicing, temporal noise and the fact that the images are no longer simultaneous.

Pi 4 / IMX477 and Pi 3 / OV5647 performance

The server performance test uses an 8 ms exposure, analogue gain 4, colour MJPEG rendering and a single client. The values below come from the CSV archived with the validation. The process's central processing unit (CPU) load can exceed 100% when it uses several cores.

Frame rate is expressed in frames per second (FPS), load as a CPU percentage and latency in milliseconds.

Pi 4 / IMX477 — software then ISP values; 8 ms exposure, analogue gain 4, colour MJPEG, one client.
ModeSoftware / ISP FPSSoftware / ISP CPUSoftware / ISP latency
2028 × 152024.09 / 29.15243.2% / 230.8%36.7 / 34.7 ms
2028 × 108035.86 / 39.06264.6% / 248.6%26.7 / 25.6 ms
1332 × 99052.76 / 61.00266.7% / 265.8%18.2 / 16.8 ms
4056 × 216015.57 / 15.56227.0% / 107.3%39.7 / 29.0 ms
4056 × 304011.20 / 11.24232.6% / 93.4%55.7 / 40.2 ms

Without pixel binning (bin1), frame rate is already acquisition-limited, but CPU load falls sharply. In binned or cropped modes, the ISP sometimes increases the delivered frame rate. The load reduction can nevertheless remain small, because subsequent EIP processing and encoding then account for most computation time.

The same protocol, without perf hardware counters, was run on Pi 3 with the OV5647. All requested modes actually used the ISP, without fallback.

Pi 3 / OV5647 — software then ISP values for each mode.
ModeSoftware / ISP FPSSoftware / ISP CPUSoftware / ISP latency
1296 × 97224.88 / 43.89283.4% / 219.8%37.6 / 25.9 ms
640 × 48059.07 / 60.44159.9% / 77.6%7.3 / 5.7 ms
1920 × 108029.21 / 31.09281.3% / 103.7%31.3 / 18.7 ms
2592 × 194412.80 / 14.92299.0% / 113.7%72.8 / 42.2 ms

On this platform, the ISP improves all three indicators in every measured mode. CPU cost per frame is divided by roughly two to three in bin1. OV5647 colour matching between the two paths has been validated visually; it does not yet have the same paired radiometric test bench as the IMX477.

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

Integration, selection and fallback

Each ISP profile is associated with a specific sensor model. The server checks its structure, fingerprint and black level before enabling it. The application programming interface (API) publishes the requested mode, the mode actually resolved, profile availability, its path and fingerprint, and fallback counters.

An explicitly requested ISP mode is rejected if the profile is non-compliant. Automatic mode returns to software and exposes the reason. Silent fallback is not accepted. Switching paths recreates the libcamera session so the profile is reloaded, without requiring a server restart.

Limitations

Results status

Confirmed results, effects not observed, rejected hypotheses and work still needed.
Result or hypothesisStatusEvidence
Black-level rescaling responsible for the 1.0662 slopeConfirmedMeasured ratio 0.9372 versus predicted 0.93744.
ISP/EIP slope close to unity with aligned black levelConfirmedMean 0.9993; R² from 0.99587 to 0.99988.
Significant residual smoothing, sharpening or vignetting effectsNot observedHigh-frequency and spatial checks close to unity.
CPU and latency benefit at full IMX477/Pi 4 resolutionConfirmedCPU load and latency reduced; frame rate acquisition-limited.
Improvement in all tested OV5647/Pi 3 modesConfirmedHigher FPS, lower CPU per frame and latency.
Universal improvement, independent of mode and platformRejectedBinned IMX477 modes show little change in CPU load.
Full OV5647 radiometric parityFurther work neededVisual validation available; paired test bench to be repeated.

Conclusion

The VC4 ISP can be integrated into EIP as a demosaicing accelerator within a controlled scope, without modifying RAW or delegating scientific settings to the automatic libcamera pipeline. Paired measurement shows that a difference initially attributable to the hardware path actually came from black-level rescaling. Once this mechanism is neutralised, the ISP/EIP slope returns to 0.9993.

The practical benefit is particularly strong for full-resolution previews and on Pi 3 with the OV5647. It remains more modest when software processing of binned images is already efficient. This dependence justifies retaining automatic, software and explicit ISP modes, and publishing the path actually used through the API.

Continue reading

Other version

Bringing back the ISP without losing control of the signal — Discovery version · Revisit the mechanism and results through diagrams.