Description
Implementation:
- drivers: video: introduce an API for collecting statistics #85811
- drivers: video: sw_stats: software-based statistics #87008
Introduction
Cameras constantly adjust the colors to make image normal-looking in all conditions. To do this, Linux uses libcamera, which Zephyr lacks.
Problem description
There is no API for sending image statistics from the hardware back to the software.
By default, image sensors output is green and dark. Below the Zephyr kite under a bright spotlight, using default exposure level:
Some image sensors such as OV5640 come with built-in image correction so the image looks normal... at the cost of extra noise, so most sensors let Image Signal Processor (ISP) handle perform the color corrections.
There is no statistics format between the ISP hardware and the IPA software.
Proposed change
At first, focus on introducing APIs for enabling the application to implement the rest: image statistics reporting.
Detailed RFC
Proposed change (Detailed)
Implement a new API for collecting statistics, or reuse one of the existing for this purpose.
[ See below for updated version ]
This does not cover advanced features like "region of interest" (ROI, i.e. on a phone, tap on a corner of the display to focus there => needs API to ask the hardware to collect statistics for a smaller region of the display in particular).
Dependencies
- Implement video control framework #82158 (optional)
Concerns and Unresolved Questions
What API to use?
- The existing control API? (however, statistics are not )
- A new dedicated API?
What statistics format to use? libcamera defines sum_red, sum_green, sum_blue, histogram_brightness
for the software back-end
Alternatives
- No standardized API, each hardware have their own APIs in custom headers.
- Re-use the Video Controls API for this with a custom struct
Metadata
Metadata
Assignees
Type
Projects
Status