Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.

Just got a Pi4 where to start?

RTasa
New Contributor I
874 Views
From what I read it seems you need to recompile everything? There is no package to use OpenVino with the Pi4 yet? Also I have Movidius Compute sticks Version 1 and Version 2. Do they help accelerate object detection? I was into this for a while then had to move to another project. Now I am moving back into this again. Also looking at adding the Intel 435 for distance of objects. Sorry for such generic questions but reading blog postings that you have to rebuild OpenVino to get it to work with the Pi and there does not seem to be a guide or is there?
0 Kudos
5 Replies
Shubha_R_Intel
Employee
874 Views

Dear Bob T,

I'm not sure what you mean when you say "recompile".  Yes the samples and demos have to be built but this is true regardless of platform (true for CPU, GPU and VPU also).

Maybe you're talking about re-compiling OpenCV from scratch ?

raspbian-stretch Inference Engine backend doc will help you with various tasks.

But you will want to start with the Raspbian OpenVino Install Guide

Though we've tested only on RPI 3 there is no reason it shouldn't work on RPI 4. Please try it and post questions here should you get stuck.

Thanks !

Shubha

0 Kudos
RTasa
New Contributor I
874 Views
from this thread https://software.intel.com/en-us/forums/computer-vision/topic/813265 they mention to get openvino working with the new Pi4 They had to recompile everything from scratch. Here is how you do it: 1. Download & install the latest raspbian image: https://www.raspberrypi.org/downloads/raspbian/ 2. Clone & build openvino (dldt) and follow instructions at: https://github.com/opencv/dldt/tree/2019/inference-engine#native-compilation 3. Call cmake with these flags: cmake -DCMAKE_BUILD_TYPE=Release \ -DENABLE_SSE42=OFF \ -DTHREADING=SEQ \ -DENABLE_GNA=OFF \ -DENABLE_OPENCV=OFF \ -DENABLE_PYTHON=ON \ -DPYTHON_EXECUTABLE=/usr/bin/python3.7 \ -DPYTHON_LIBRARY=/usr/lib/arm-linux-gnueabihf/libpython3.7m.so \ -DPYTHON_INCLUDE_DIR=/usr/include/python3.7 \ .. && make -j4 4. Then refer to this link to build opencv 4.1: https://www.pyimagesearch.com/2018/09/26/install-opencv-4-on-your-raspberry-pi/ cmake -D CMAKE_BUILD_TYPE=RELEASE \ -D CMAKE_INSTALL_PREFIX=/usr/local \ -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules \ -D ENABLE_NEON=ON \ -D ENABLE_VFPV3=ON \ -D BUILD_TESTS=OFF \ -D OPENCV_ENABLE_NONFREE=ON \ -D INSTALL_PYTHON_EXAMPLES=OFF \ -D WITH_INF_ENGINE=ON \ -D INF_ENGINE_LIB_DIRS="/home/pi/dldt/inference-engine/bin/armv7l/Release/lib" \ -D INF_ENGINE_INCLUDE_DIRS="/home/pi/dldt/inference-engine/include" \ -D CMAKE_FIND_ROOT_PATH="/home/pi/dldt/inference-engine/" \ -D BUILD_EXAMPLES=OFF .. 5. Test your installation with this example: https://www.pyimagesearch.com/2019/04/08/openvino-opencv-and-movidius-nc. 6. Note that you won't have the setupvars.sh script. Instead just add this to your .bashrc or .profile: # libraries export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib:/home/pi/dldt/inference-engine/bin/armv7l/Release/lib" I had to recompile everything from scratch. Here is how you do it: 1. Download & install the latest raspbian image: https://www.raspberrypi.org/downloads/raspbian/ 2. Clone & build openvino (dldt) and follow instructions at: https://github.com/opencv/dldt/tree/2019/inference-engine#native-compilation 3. Call cmake with these flags: cmake -DCMAKE_BUILD_TYPE=Release \ -DENABLE_SSE42=OFF \ -DTHREADING=SEQ \ -DENABLE_GNA=OFF \ -DENABLE_OPENCV=OFF \ -DENABLE_PYTHON=ON \ -DPYTHON_EXECUTABLE=/usr/bin/python3.7 \ -DPYTHON_LIBRARY=/usr/lib/arm-linux-gnueabihf/libpython3.7m.so \ -DPYTHON_INCLUDE_DIR=/usr/include/python3.7 \ .. && make -j4 4. Then refer to this link to build opencv 4.1: https://www.pyimagesearch.com/2018/09/26/install-opencv-4-on-your-raspberry-pi/ cmake -D CMAKE_BUILD_TYPE=RELEASE \ -D CMAKE_INSTALL_PREFIX=/usr/local \ -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules \ -D ENABLE_NEON=ON \ -D ENABLE_VFPV3=ON \ -D BUILD_TESTS=OFF \ -D OPENCV_ENABLE_NONFREE=ON \ -D INSTALL_PYTHON_EXAMPLES=OFF \ -D WITH_INF_ENGINE=ON \ -D INF_ENGINE_LIB_DIRS="/home/pi/dldt/inference-engine/bin/armv7l/Release/lib" \ -D INF_ENGINE_INCLUDE_DIRS="/home/pi/dldt/inference-engine/include" \ -D CMAKE_FIND_ROOT_PATH="/home/pi/dldt/inference-engine/" \ -D BUILD_EXAMPLES=OFF .. 5. Test your installation with this example: https://www.pyimagesearch.com/2019/04/08/openvino-opencv-and-movidius-nc. 6. Note that you won't have the setupvars.sh script. Instead just add this to your .bashrc or .profile: # libraries export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib:/home/pi/dldt/inference-engine/bin/armv7l/Release/lib"
0 Kudos
Shubha_R_Intel
Employee
874 Views

Dear Bob T.

Indeed you are right. I stand corrected.

Shubha

0 Kudos
Shubha_R_Intel
Employee
874 Views

Looks like Jesus was able to help a customer in this IDZ Post regarding RPI4 and OpenVino

Hope it helps,

Thanks,

Shubha

0 Kudos
mortyone
Beginner
853 Views

Hi Shubha, 

 

That links seems to be broken. 

 

Are there any updated/consolidated guides from Intel on how to recompile OpenVino 2020.4 for the pi4? Or simply how to update the OpenVino setup to use an existing compiled OpenCV 4.1 that's already on the pi4?

 

Here's my problem:

I am successfully using the 2020.4 download on my raspberry pi 4 with a USB camera:

https://download.01.org/opencv/2020/openvinotoolkit/2020.4/l_openvino_toolkit_runtime_raspbian_p_202...

 

However, when I pass a RTSP url into cv2.VideoCapture() I get the following error:

=========================

>>> import cv2
>>> print (cv2.__version__)
4.2.0-openvino
>>> cam = cv2.VideoCapture("rtsp://admin:password@192.168.1.37/onvif1/")
[ WARN:0] global ../opencv/modules/videoio/src/cap_gstreamer.cpp (1759) handleMessage OpenCV | GStreamer warning: Embedded video playback halted; module source reported: Unauthorized
[ WARN:0] global ../opencv/modules/videoio/src/cap_gstreamer.cpp (888) open OpenCV | GStreamer warning: unable to start pipeline
[ WARN:0] global ../opencv/modules/videoio/src/cap_gstreamer.cpp (480) isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created
[ERROR:0] global ../opencv/modules/videoio/src/cap.cpp (116) open VIDEOIO(CV_IMAGES): raised OpenCV exception:

OpenCV(4.2.0-openvino) ../opencv/modules/videoio/src/cap_images.cpp:253: error: (-5:Bad argument) CAP_IMAGES: can't find starting number (in the name of file): 

=========================

The RTSP url is correct, it works perfectly with vlc on the same pi 4. 

On the same pi 4, if I do NOT run "~/openvino/bin/setupvars.sh" then I am able to view the RTSP feed using the same python3 code i.e.: 

>>> import cv2
>>> print (cv2.__version__)
4.1.0
>>> cam = cv2.VideoCapture("rtsp://admin:password@192.168.1.37/onvif1/")

<VideoCapture 0xb6743a80>
>>>

 

The only obvious difference is the cv2.__version__ :

4.2.0-openvino (works for USB camera but not RTSP)  vs 4.1.0 (works for both) 

Does anyone know why running /openvino/bin/setupvars.sh causes openVINO to fail with just RTSP streams? Is this a bug  with Intel's openVINO distribution? 

And how could I resolve the various gstreamer errors thrown with RTSP urls:

OpenCV | GStreamer warning: Embedded video playback halted; module source reported: Unauthorized
OpenCV | GStreamer warning: unable to start pipeline

The issue is specific to RTSP streams. 

Many thanks

 

 

0 Kudos
Reply