0

I am using UVC OV9281 for my opencv project, and I am having issues with setting camera luminance when trying to capture my phone screen using the camera.

I am using this bash command to lock the camera settings

BRIGHTNESS=10
 19 CONTRAST=50
 20 GAMMA=100
 21 
 22 v4l2-ctl \
 23   -d /dev/video0 \
 24   --set-ctrl=brightness=$BRIGHTNESS \
 25   --set-ctrl=contrast=$CONTRAST \
 26   --set-ctrl=saturation=64 \
 27   --set-ctrl=hue=0 \
 28   --set-ctrl=white_balance_temperature_auto=0 \
 29   --set-ctrl=gamma=$GAMMA \
 30   --set-ctrl=gain=0 \
 31   --set-ctrl=power_line_frequency=2 \
 32   --set-ctrl=white_balance_temperature=6500 \
 33   --set-ctrl=sharpness=3 \
 34   --set-ctrl=backlight_compensation=1 \
 35   --set-ctrl=exposure_auto=1 \
 36   --set-ctrl=exposure_absolute=5000\
 37   --set-ctrl=exposure_auto_priority=0

However, despite using the same values to set the camera every time, the luminance keeps changing based on the brightness of the surroundings when the camera is connected to the desktop. For example, when I put the phone on maximum brightness on white background and then connect the webcam and run the above settings, I get the following image High initial brightness

Then, when I put the phone on minimum brightness on black background and then connect the webcam and run the above settings, I get this Low initial brightness

Is this problem just due to the camera I am using? If so, could anyone recommend a uvc camera that supports 120fps video? (b&w/color doesn't matter)

The above images were captured from using gst

gst-launch-1.0 v4l2src device=/dev/video0 ! image/jpeg,width=1280,height=720,framerate=120/1 ! jpegdec ! autovideosink
royce.lee
  • 19
  • 1
  • 5
  • I used 2 different usb cameras with jetson nano which has an ubuntu version. I added these after connecting to the camera and never faced the issue you are facing `os.system("v4l2-ctl -d /dev/video1 --set-ctrl=exposure_auto=1") os.system(f"v4l2-ctl -d /dev/video1 --set-ctrl=exposure_absolute={5000}")` – Barış Aktaş Jan 17 '23 at 13:31
  • Not the perfect solution but you can write the exposure setting commands to a loop and set it to your desired value regularly. – Barış Aktaş Jan 17 '23 at 13:35

0 Answers0