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?
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
- Bayer RAW
- EIP demosaicing
- EIP black level
- Balance / rendering
- JPEG
ISP path
- Bayer RAW
- Neutralised / linearised VC4 ISP
- RGB888
- EIP black level
- Balance / rendering
- JPEG
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.
| ISP block | Required setting | Purpose |
|---|---|---|
| Black level | 0 in the ISP | Avoid range rescaling; apply the correction once in EIP. |
| Colour correction matrix | Identity | Avoid automatic channel mixing. |
| Automatic white balance / colour gains | Automatic white balance (AWB) disabled; ColourGains=(1,1) | Avoid automatic correction of channel ratios. |
| Contrast and gamma | Identity curve | Preserve a linear relationship. |
| Defective pixel correction (DPC), noise reduction, green equalisation | Disabled | Prevent silent changes to local structure. |
| Sharpening | Zero strength and limit | Preserve high frequencies. |
| Lens shading correction, HDR, neural white balance | Disabled | Avoid 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.
Paired IMX477 protocol
The isp_linear_bench test bench configures a libcamera request with two simultaneous streams, RAW and RGB. Capture settings are:
- RAW
SBGGR12_CSI2P, 2028 × 1520; - preview stream (
Viewfinder)RGB888, 2028 × 1520; - requested exposure 20,000 µs, measured 19,999 µs;
- analogue gain requested 3.5, measured 3.49488;
- 10 frames per condition;
- white-balance gains equal to 1.
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.
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.
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.
| Condition | R channel | G channel | B channel | Mean |
|---|---|---|---|---|
| ISP black 64, EIP black 64 | 1.0684 | 1.0650 | 1.0652 | 1.0662 |
| ISP black 0, EIP black 0 | 1.0012 | 0.9983 | 0.9984 | 0.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.
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.
| Mode | Software / ISP FPS | Software / ISP CPU | Software / ISP latency |
|---|---|---|---|
| 2028 × 1520 | 24.09 / 29.15 | 243.2% / 230.8% | 36.7 / 34.7 ms |
| 2028 × 1080 | 35.86 / 39.06 | 264.6% / 248.6% | 26.7 / 25.6 ms |
| 1332 × 990 | 52.76 / 61.00 | 266.7% / 265.8% | 18.2 / 16.8 ms |
| 4056 × 2160 | 15.57 / 15.56 | 227.0% / 107.3% | 39.7 / 29.0 ms |
| 4056 × 3040 | 11.20 / 11.24 | 232.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.
| Mode | Software / ISP FPS | Software / ISP CPU | Software / ISP latency |
|---|---|---|---|
| 1296 × 972 | 24.88 / 43.89 | 283.4% / 219.8% | 37.6 / 25.9 ms |
| 640 × 480 | 59.07 / 60.44 | 159.9% / 77.6% | 7.3 / 5.7 ms |
| 1920 × 1080 | 29.21 / 31.09 | 281.3% / 103.7% | 31.3 / 18.7 ms |
| 2592 × 1944 | 12.80 / 14.92 | 299.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
- Paired radiometric validation covers one IMX477 scene, exposure and gain.
- RAW12 is normalised to the 10-bit domain before comparison with RGB8; these numbers describe bit depth.
- The ISP and EIP use different demosaicing algorithms, so fine texture can differ.
- The digital gain that may occur internally has not been measured separately.
- The OV5647 profile has been validated visually and for performance, but not yet through a complete paired regression.
- Regions of interest, stacking and RAW rendering remain in software.
- Performance results describe the test bench's versions, settings and machines; they are not a universal property of the ISP.
Results status
| Result or hypothesis | Status | Evidence |
|---|---|---|
| Black-level rescaling responsible for the 1.0662 slope | Confirmed | Measured ratio 0.9372 versus predicted 0.93744. |
| ISP/EIP slope close to unity with aligned black level | Confirmed | Mean 0.9993; R² from 0.99587 to 0.99988. |
| Significant residual smoothing, sharpening or vignetting effects | Not observed | High-frequency and spatial checks close to unity. |
| CPU and latency benefit at full IMX477/Pi 4 resolution | Confirmed | CPU load and latency reduced; frame rate acquisition-limited. |
| Improvement in all tested OV5647/Pi 3 modes | Confirmed | Higher FPS, lower CPU per frame and latency. |
| Universal improvement, independent of mode and platform | Rejected | Binned IMX477 modes show little change in CPU load. |
| Full OV5647 radiometric parity | Further work needed | Visual 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.