1

I have some code that I have adapted to run on a headless Rpi using a usb webcam, it is running a bit slow, so my questions are:

  1. If I were to use the GPI pins with a dedicated webcam would that be faster?

  2. Is there any way to speed up my code for Rpi?

  3. Where can I get a Rpi webcam?

My code is here, I struggle to paste inline so its a link

  • If your frame rate is low, I would try first a little program that just grabs images from your webcam without any further processing. Probably the camera runs fine and is the Raspberry Pi that hasn't enough CPU power for processing your image loop in real time. – Diego Cerdan Puyol May 17 '13 at 14:03

2 Answers2

1

For your question about where to get a Pi camera, a new camera has recently been release. I don't know about speeding up you code, but you might want to overclock your Pi. Good luck,

Quentin Geissmann
  • 2,240
  • 1
  • 21
  • 36
  • Thanks, I have been waiting for that camera (Not sure what speed gain I will get?) Overclocking might shorten the lifespan of the device? That's another question though –  May 19 '13 at 10:47
  • I think it is not really known how overclocking reduced lifespan of the Pi. In any case, you can do it to some extent without voiding the warranty(cf. official doc.). – Quentin Geissmann May 19 '13 at 11:11
  • I will get an order in for the new cam, if I am going to o/clock i probably would want a spare pi as well :) –  May 19 '13 at 11:14
1

Like Quentin suggested, a dedicated Camera (in our case, Rpi camera link : http://www.raspberrypi.org/camera) should work much faster than USB webcams as it is known to use GPU for encoding / decoding process instead of using CPU.

(Source : http://www.raspberrypi.org/phpBB3/viewtopic.php?t=55798)

You can try reducing width and height of the frame for better performance in terms of speed.

Also you're using Iplimage* which is no longer supported in new OpenCV versions and replaced by cvMat.

(source: Difference between cvMat, Mat and IpImage)

Hope it helps.

Community
  • 1
  • 1
dhruvvyas90
  • 1,135
  • 1
  • 15
  • 31