Page 1 of 1

Setting the camera exposure

Posted: Thu Oct 28, 2021 8:30 am
by EugenePopuro
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

Re: Setting the camera exposure

Posted: Sun Oct 31, 2021 7:53 pm
by @lex
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

Re: Setting the camera exposure

Posted: Wed Nov 03, 2021 1:17 pm
by 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).

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?

Re: Setting the camera exposure

Posted: Wed Nov 03, 2021 11:14 pm
by @lex
[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?

Re: Setting the camera exposure

Posted: Mon Nov 08, 2021 12:16 pm
by EugenePopuro
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)

Re: Setting the camera exposure

Posted: Sun Nov 14, 2021 5:54 pm
by @lex
Try some other format and see if you get better FPS:
YUYV, YU12, NV21. Maybe 422P.
Please post the results.