Ask Your Question
0

getimage has stale frames

asked 2013-03-15 21:16:11 -0600

kalefler gravatar image

I have a very simple program:

cam = Camera(prop_set={'width': 320, 'height': 240})

while True:

img = cam.getImage()

img.show()

I get 1 or 2 fresh images and then the display is frozen, with no new images The SimpleCV getImage() documentation states "if you experience problems with stale frames from the camera’s hardware buffer, increase the flushcache number to dequeue multiple frames before retrieval". I can't find anywhere how to do this.

Any ideas?

edit retag flag offensive close merge delete

Comments

You may also want to try it without threading. Camera(threaded=False). It is set to true by default but it seems the RaspberryPi does better with it disabled.

xamox ( 2013-03-18 09:11:44 -0600 )edit

Thanks for the suggestion.I tried it, but it still get the same error (see comment in answer below)

kalefler ( 2013-03-19 10:17:00 -0600 )edit

3 answers

Sort by » oldest newest most voted
1

answered 2013-03-16 16:43:30 -0600

kalefler gravatar image

updated 2013-03-17 14:52:07 -0600

Thanks for the response. Yes, I had that originally. Using the display object has the same problem.

The Logitech webcam (no model number on camera) is connected to a raspberry pi. The camera used to capture fine. I've now realized this problem started after I upgraded from the 2012-12-16-wheezy-raspbian.img to the 2013-02-09 image. I'll re-image my disk back to the 12-16 image and see if it works again.

OK, I re-imaged my disk back to 2012-12-16 and it works fine. Maybe there is some driver incompatibility between my webcam and the 02-09 image.

edit flag offensive delete link more

Comments

Aha! The truth comes out! It would have been helpful from the start to tell us you were using a RaspberryPi. We're still kicking the tires on the Pi. A Logitech should work but you will probably want to plug it into a powered USB hub. We're working hard to get things running better on the Pi.

kscottz ( 2013-03-17 18:22:30 -0600 )edit

Here is more information after more testing. The program works with the 2012-12-16 image, but only for 10's of seconds. Running under idle, it just stops and the Restart line appears. Running it under the python interpreter it stops with the message "... (pygame parachute) Segmentation Fault"

kalefler ( 2013-03-19 10:12:04 -0600 )edit

It maybe a Pygame bug. Sorry about that. Getting pygame on raspberrypi has been a bit of a pain. Can you do image.show('browser'). This will render to your webbrowser instead and may be a temporary work around.

xamox ( 2013-03-19 11:21:08 -0600 )edit

from SimpleCV import Camera cam = Camera(prop_set={'width': 320, 'height': 240}, threaded=False) curImage = cam.getImage() curImage.show("browser") - still gets segmenatation fault

kalefler ( 2013-03-19 11:42:40 -0600 )edit
1

Are you running from the shell? Does it happen when you run .show()? You could try and find out exactly by running and posting the output.txt to a gist (http://gist.github.com) for me to look at:

strace -f -o output.txt python simplecv-script-here.py

xamox ( 2013-03-19 21:02:00 -0600 )edit
0

answered 2013-03-16 16:11:02 -0600

pap-x gravatar image

I would suggest try using the display object. Try this code:

from SimpleCV import *
cam = Camera()
disp = Display()

while disp.isNotDone():
        img = cam.getImage()
        img.save(disp)
edit flag offensive delete link more
0

answered 2013-03-16 16:48:56 -0600

kscottz gravatar image

Can you tell us a bit more about your hardware? What platform/OS/camera model? Does it work when you don't pass the camera a property set? Camera properties are highly hardware dependent, so setting the camera properties could be part of your properties.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Stats

Asked: 2013-03-15 21:16:11 -0600

Seen: 256 times

Last updated: Mar 17 '13