jywarren / irkit

Raspberry Pi-based infrared/visible image compositing and webcam control (Public Lab)
2 stars 10 forks source link

webcam access with uvccapture #1

Open jywarren opened 11 years ago

jywarren commented 11 years ago

http://fanjita.org/serendipity/archives/57-Capturing-webcam-video-with-OpenCV-on-Raspberry-Pi-Arch-Linux.html

http://mitchtech.net/raspberry-pi-opencv/

https://github.com/gleicon/videodog.git

Forget the above links, we're using uvccapture now! apt-get install uvccapture

having trouble though with higher res capture: http://www.raspberrypi.org/phpBB3/viewtopic.php?f=37&t=11745

variations on this seem to be helping:

sudo rmod uvcvideo sudo modprobe uvcvideo nodrop=1 timeout=5000

jywarren commented 11 years ago

Trying modified uvccapture: http://dp.nonoo.hu/modified-uvccapture/

Working with these commands:

videodog -x 320 -y 240 -w 3 -d /dev/video0 -j -f leee.jpg
uvccapture-0.5-nonoo-r4/uvccapture -v -x640 -y480 -d/dev/video1 -D3 -m -osnap.jpg -W
uvccapture -m -x640 -y480 -v -m && cacaview snap.jpg

not a lot of success, tried switching cams too. All come out kind of garbled in various ways.

jywarren commented 11 years ago

https://benosteen.wordpress.com/2012/05/31/raspberrypi-birdfeeder-webcam/ - indicates that the default debian image (that post was from May 2012, however) does not support usb webcams... maybe switching to Arch would help?

lots of discussion of using Arch + Motion here: http://jeremyblythe.blogspot.co.uk/2012/06/battery-powered-wireless-motion.html

OK these folks seem to have found that "fswebcam" works well on Raspian (debian) on a pi: http://www.daveakerman.com/?p=592

jywarren commented 11 years ago

OK! got images taking with

fswebcam -d /dev/video0 fsnap0.jpg

where we can loop it at 5 sec intervals with:

fswebcam -d /dev/video0 fsnap0.jpg -l 5

and set resolution with

fswebcam -d /dev/video0 fsnap0.jpg -l 5 -r "1280x800"

however the latter is timing out, i cant yet get hi-res images

it supports great options in ~/.fswebcam.conf -- http://www.r3uk.com/index.php/home/38-software/100-webcam-capture-using-fswebcam

also see resolution experiments here: http://www.mattfischer.com/blog/?tag=fswebcam

fswebcam on a Raspberry Pi: http://www.raspberrypi.org/phpBB3/viewtopic.php?f=38&t=15045&sid=7fd929685ea144861d356e488cd3c21a

This forum says:

At higher resolutions you have to skip a few frames before the exposure "settles" (also this example saves to PNG at maximum compression instead of to JPEG):

fswebcam -r 1280x1024 --png 9 -D 1 -S 3 --save shot.png
dwblair commented 11 years ago

fsnap1

Got my R-Pi, and used your instructions re: fswebcam and snapped an image -- whee!

Unfortunately, it looks like the webcam I had lying around only does up to 640x480 ... will hopefully be getting a higher-resolution webcam sometime this week ...

jywarren commented 11 years ago

try plugging that webcam into a webcam app like Photo Booth or Cheese or something -- i think fswebcam may be resolution limited and some cameras can do better... but if you managed to take 640x480 from the pi, it's better than I was able to do! Sweet!

I've been looking at the shell program "watch" to run a command periodically:

watch - execute a program periodically, showing output fullscreen

On Sat, Feb 9, 2013 at 7:38 PM, dwblair notifications@github.com wrote:

[image: fsnap1]https://f.cloud.github.com/assets/639760/142774/eaef5186-7319-11e2-88bb-d454ab0ae67b.jpg

Got my R-Pi, and used your instructions re: fswebcam and snapped an image -- whee!

Unfortunately, it looks like the webcam I had lying around only does up to 640x480 ... will hopefully be getting a higher-resolution webcam sometime this week ...

— Reply to this email directly or view it on GitHubhttps://github.com/jywarren/irkit/issues/1#issuecomment-13342015..

dwblair commented 11 years ago

Good idea! Still not sure, but if Cheese is reporting correctly, then my webcam is indeed a (lame) 640x480 .... but another, higher-res webcam should be arriving on Monday or so ...

And: "watch" sounds promising!

dwblair commented 11 years ago

This just in! (Actually, two of them arrived -- it's just that I'm using one of them to take a picture of the other) ...

syba

Higher resolution imagery with cute little boxy webcams to commence!

phytoMorph commented 10 years ago

At higher resolutions you have to skip a few frames before the exposure "settles" (also this example saves to PNG at maximum compression instead of to JPEG): ANY idea how to avoid this problem???