If I was using a raspberry Pi 3B+
What is the BEST overall performance option for using OpenCV to analyze video. I did a lot of searches and the information is NOT current and bit vague. Open CV works with uncompressed data or bytes. The most technical piece I found was dated in 2015.
"The PiCamera 'run' by the GPU and can dump full frames into RAM at 15 frames a second, while the data from the USB goes straight into ram."
So if I wanted maximum performance for manipulating video frames with OpenCV at resolutions at or above 640x480 I would choose the USB WebCam since the data needs to be uncompressed and in regular memory? Or is this different now since the Pi 3 is multi core and faster?
Can anyone please offer me a more definitive answer.
-
- Posts: 79
- Joined: Fri Aug 30, 2013 1:48 pm
-
- Posts: 79
- Joined: Fri Aug 30, 2013 1:48 pm
Re: Pi Camera vs USB WebCam for OpenCV
I am hoping more information will get me an answer. The question is
using a Raspberry Pi B+ does OpenCV work faster using a USB camera or
with the Pi Camera at resolutions of 640x480 and above.
OpenCV in this case is used to read and manipulate the image data then output it to the screen.
Thanks for any help.
using a Raspberry Pi B+ does OpenCV work faster using a USB camera or
with the Pi Camera at resolutions of 640x480 and above.
OpenCV in this case is used to read and manipulate the image data then output it to the screen.
Thanks for any help.
Re: Pi Camera vs USB WebCam for OpenCV
Pi camera has higher frame rate and resolution, but as you said the image is not raw (10bit). There's a thread dedicated to retrieve raw image with modified driver I believe. With only sub2.0, I don't see any usb wecam can compete with speed. If you only use opencv to process image/video, I don't see that matters anyhow.
-
- Posts: 79
- Joined: Fri Aug 30, 2013 1:48 pm
Re: Pi Camera vs USB WebCam for OpenCV
What I don't know is if decompression of the video frame or transfer from the GPU memory to CPU memory takes longer than reading in an uncompressed RGB frame to be manipulated.
- HermannSW
- Posts: 3765
- Joined: Fri Jul 22, 2016 9:09 pm
- Location: Eberbach, Germany
- Contact: Website Twitter YouTube
Re: Pi Camera vs USB WebCam for OpenCV
I cannot help on USB, but say that I was negatively impressed on OpenCV performance. Edge detection on small 320x208 frames took 20ms(!), not allowing for high framerate video processing:
https://www.raspberrypi.org/forums/view ... 8#p1250429
The robot target speed is 5m/s, and getting frame analyzed after >20ms is not acceptable, in that time the robot has moved 10cm ...
https://www.raspberrypi.org/forums/view ... 8#p1250429
The robot target speed is 5m/s, and getting frame analyzed after >20ms is not acceptable, in that time the robot has moved 10cm ...
https://stamm-wilbrandt.de/2wheel_balancing_robot
https://stamm-wilbrandt.de/en#raspcatbot
https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://github.com/Hermann-SW/raspiraw
https://stamm-wilbrandt.de/en/Raspberry_camera.html
https://stamm-wilbrandt.de/en#raspcatbot
https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://github.com/Hermann-SW/raspiraw
https://stamm-wilbrandt.de/en/Raspberry_camera.html
-
- Posts: 79
- Joined: Fri Aug 30, 2013 1:48 pm
Re: Pi Camera vs USB WebCam for OpenCV
So what do you use to speed up image filtering, like a haarcascade. I agree opencv is not optimized.