Skip to content

drivers: video: image statistics, libcamera-style APIs #85457

Open
@josuah

Description

@josuah

Implementation:

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:

Image

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.

Image

There is no statistics format between the ISP hardware and the IPA software.

Image

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

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

Labels

RFCRequest For Comments: want input from the communityarea: APIChanges to public APIsarea: Driversarea: VideoVideo subsystem

Type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions