Navigation
Internships & Projects
Raspberry Pi
Code Embarqué et Temps Réel
SE et Pilotes
[Protected]
In the following, we'll run severall face detection algorithms using lastest openCV you've just installed [ latest openCV install ].
Basically, we'll experience two algorithms:
to be continued ;)
Having openCV running on our Raspberry Pi to process pictures from the attached camera will generally result in a poor framerate … especially with algorithms like haar cascade!
To solve this issue, we'll make use of our powerful cloud platform CloudMIP.
Being out-of-scope, you just have to know that the used VM features 2 physical CPU, 4GB RAM and latest openCV version.
Basically, we'll turn the RPi+attached camera as a mere IP camera exporting video stream through the RTSP protocol:
# set framerate to 10 v4l2-ctl --set-parm=10
Note: we set framerate through v4l2-ctl
command since it it not yet supported in current vlc version (2.03 / Raspbian Wheezy).
# switch to pi user and launch h264 stream export su -l pi cvlc -vvv v4l2:///dev/video0 --v4l2-width 640 --v4l2-height 480 --v4l2-fps 10 --v4l2-chroma h264 --sout '#rtp{sdp=rtsp://:8554/}'
Being PULL based, RTSP won't consume any network bandwidth as long as nobody access it.
H264 encoding being handled at the RPi's GPU level, RTSP streaming keeps RPi's CPU usage very low (~2%).
As a first step, you may launch vlc
to check that you have access to the RTSP strem:
vlc rtsp://<yourIP>:8554/
Note: pay attention to the trailing '/' of the rtsp address.
Now, you just have to launch the following code:
to be continued ;)