Power & Source of Big Ideas

Setting the camera exposure

Moderators: chensy, FATechsupport

Hi,
I use a camera for CV tasks. So I would like to capture the camera via OpenCV at 30fps and be able to adjust the shutter speed.
Now I can get 30fps fullHd using rkisp.
Is it possible to adjust the camera shutter speed, exposure on nanopi boards?
I am currently using NanoPi NEO4 with ov4689 sensor, rk3399-sd-friendlydesktop-bionic-4.4-arm64-20210617 bsp
In the latest rockchip BSP you can use standard V4L2 controls for the camera sensors.

v4l2-ctl -d /dev/video0 -l

User Controls

exposure 0x00980911 (int) : min=4 max=1550 step=1 default=1536 value=1536

Image Source Controls

vertical_blanking 0x009e0901 (int) : min=34 max=31247 step=1 default=34 value=34
horizontal_blanking 0x009e0902 (int) : min=4294967192 max=4294967192 step=1 default=4294967192 value=-104 flags=read-only
analogue_gain 0x009e0903 (int) : min=128 max=2040 step=1 default=128 value=128

Image Processing Controls

link_frequency 0x009f0901 (intmenu): min=0 max=0 default=0 value=0 (500000000 0x1dcd6500) flags=read-only
pixel_rate 0x009f0902 (int64) : min=0 max=400000000 step=1 default=400000000 value=400000000 flags=read-only
test_pattern 0x009f0903 (menu) : min=0 max=4 default=0 value=0 (Disabled)


Read this thread: viewtopic.php?f=61&t=3406
Thanks for the answer, I have clarified my question.
I tried using the v4l2 gstreamer pipeline to capture the camera via OpenCV, but I get 17fps and an image with no white balance set (green tint).

Read this thread: viewtopic.php?f=61&t=3406
[/quote]

Yes, I read this thread. Is there really no way to configure the camera in the new BSP?
[quote="EugenePopuro"]Thanks for the answer, I have clarified my question.
I tried using the v4l2 gstreamer pipeline to capture the camera via OpenCV, but I get 17fps and an image with no white balance set (green tint).

[quote]Read this thread: viewtopic.php?f=61&t=3406[/quote][/quote]

Yes, I read this thread. Is there really no way to configure the camera in the new BSP?[/quote]

You need to use the latest rkisp as implicitly mentioned in that thread. 3A will work automagically in auto-mode. To change the exposure it should be done in an Android way, i think.

Regarding 17 fps, i think opencv is doing some conversion, can you show you gstreamer pipeline?
My gstreamer pipeline:

Code: Select all

V4l2src device=/dev/video1 ! video/x-raw, format=NV12, width=1080, height=720, framerate=30/1 ! appsink

And then I use this conversion in OpenCV

Code: Select all

cv2.cvtColor(frame, cv2.COLOR_YUV2BGR_NV12)
Try some other format and see if you get better FPS:
YUYV, YU12, NV21. Maybe 422P.
Please post the results.

Who is online

In total there are 5 users online :: 0 registered, 0 hidden and 5 guests (based on users active over the past 5 minutes)
Most users ever online was 5185 on Wed Jan 22, 2020 1:44 pm

Users browsing this forum: No registered users and 5 guests