Sensor Demo#
Overview#
This sample demonstrates how to use the K230 sensor module for image capture. The sensor module supports multiple camera and sensor types and can be used for video input and image capture.
Functional Description#
Sensor Functions#
This sample demonstrates the main capabilities of the sensor module:
Camera initialization: initialize the camera sensor
Image capture: capture image data in real time
Resolution configuration: support multiple resolution settings
Frame-rate control: configure the capture frame rate
Exposure control: support both automatic and manual exposure
White balance: support white-balance adjustment
Supported Sensor Types#
MIPI CSI: MIPI-interface cameras
DVP: parallel-interface cameras
TVP: TVP-series bridge chips
Source Location#
There is no standalone sample_sensor example in the current SDK.
For a practical reference, use the sensor-capture-related demo:
src/rtsmart/examples/mpp/sample_uvc_dev_vicap
Usage#
Build Method#
From the K230 RTOS SDK root directory, use make menuconfig to enable the related sensor sample in the firmware build, then build the firmware.
Run Example#
./sample_uvc_dev_vicap.elf
Expected Result#
After the program starts, it will:
enumerate and initialize the camera
configure capture parameters
start image capture
output the image to the display device or save it to a file
Example output:
Sensor Demo
============
Enumerating sensors...
Sensor 1: IMX335 (MIPI CSI)
Sensor 2: OV5640 (MIPI CSI)
Sensor 3: TVP5150 (DVP)
Selecting sensor: IMX335
Sensor initialized!
Configuring capture...
Resolution: 1920x1080
Frame rate: 30fps
Exposure: Auto
White balance: Auto
Starting capture...
Capturing frames...
Frame 1 captured
Frame 2 captured
Frame 3 captured
...
Press Ctrl+C to stop.
Tip
The sensor module is the basis of video input. Before use, configure the relevant parameters according to the actual camera type. For detailed sensor interfaces, refer to the Sensor API documentation.
