Create-a-talking-image-recognition-solution-with-Azure-IoT-Edge-Azure-Cognitive-Services

This project is maintained by gloveboxes

Module 6: Camera settings


Index


The solution works best when you turn off the camera auto focus and set the line frequency.

You will see in the repo that you cloned to the Raspberry Pi that there is a set-camera.sh.

The settings you choose will depend on your camera.

But for reference these are the settings I use.

You will need to install

sudo apt-get install v4l-utils

Note, power_line_frequency=1 is 50Hz.

v4l2-ctl --set-ctrl=power_line_frequency=1
v4l2-ctl --set-ctrl=focus_auto=0
v4l2-ctl --set-ctrl=brightness=150
v4l2-ctl --set-ctrl=contrast=7
v4l2-ctl --set-ctrl=saturation=100
v4l2-ctl --set-ctrl=focus_absolute=20
v4l2-ctl --set-ctrl=zoom_absolute=20

You can find out more about these settings at Manual USB camera settings in Linux

These settings are reset on reboot so you will need to reload at bootup.

The easist way to do this is add the required camera settings to the /etc/rc.local file.

USB camera quirk settings

If you experience frame timeouts from your USB camera then the following may help.

sudo rmmod uvcvideo
sudo modprobe uvcvideo nodrop=1 timeout=5000 quirks=0x80

Home