Logitech Webcam on Pi

February 23, 2013 at 4:26 am Leave a comment

I’ve been thinking about using a Pi at the makerspace to run some digital signage, including a big display indicating who the on-duty volunteer is for the space when we have open hours. So this got me thinking about having the persons picture up on the display along with their name and other stuff, which led to wanting a camera for the Pi that could take the person’s picture.

Digging in, it was pretty simple to get the basic webcam stuff working on the Pi. It’s not *fast*, but 1 – 2 fps is fine for verifying that it works. To get the webcam stuff running, I plugged in the webcam (a generic Logitech webcam – don’t know the model and the kernel doesn’t seem to know either) I used:

  • sudo apt-get install guvcview uvccapture
  • sudo usermod -a -G video pi
  • sudo modprobe uvcvideo

Then REBOOT the Pi. When it boots, you can start a live webcam window using:

  • guvcview

However, if you just want to capture frames as jpegs, what is tried is:

  • uvccapture -x640 -y480 -q75 

However, this turns out to give a very posterized / oversaturated / artistic crazy picture that has all the colors screwed up. What I found is that it was setting the Gain, Brightness, Contrast and Saturation to MAXIMUM values, which naturally results in crazy. Searching the interwebs turned up some decent parameters, but I found that using the following command line seemed to allow the cam to auto-expose the pictures correctly most of the time:

  • uccapture -x640 -y480 -q75 -B128 -S32 -C32 -G0

I’m not sure if these are “magic numbers” that tell the camera to try to figure out the settings for itself, but it seems to work pretty well. Below is a snapshot of the desktop running the guvcview software with some nice recursion.



Entry filed under: Uncategorized.

Makerspace Launch – Snowmageddon Edition!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed

Flickr Photos

%d bloggers like this: