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.
6506 Discussions

Where are the pre-built openvino-opencv packages for raspberry pi?

Paul32
Novice
6,110 Views

I downloaded several versions in the past, but now can't seem to find any.  The newest of the previous ones I tried was 2021.4, which like all the prior ones would not work with FFMPEG.  I think because it was built with a version older than my raspberry pi has.  I wanted to try 2022.1 but am unable to find it (or older ones).   I went here:  Install OpenVINO™ Runtime for Raspbian OS — OpenVINO™ documentation — Version(2022.1)

The link for raspbian goes to a common page for 2022.1 and 2022.1.1 and has a download path only for 2022.1.1 (which doesn't have opencv so is of no use to me).  Navigating to 2022.1 in the storage site has no debian or raspbian files.  Changing the version on the first page to 2021.4, it says to download  l_openvino_toolkit_runtime_raspbian_p_<version>.tgz from https://storage.openvinotoolkit.org/repositories/openvino/packages/ and again, the raspbian file does not exist.

I was hoping to try 2022.1 to see if that would work.

 

0 Kudos
26 Replies
Peh_Intel
Moderator
4,870 Views

Hi Paul,


Starting from OpenVINO™ 2022.1.1 release, the pre-built OpenCV version for OpenVINO™ is no longer publish. Hence, you have to build OpenCV from source.



Regards,

Peh


0 Kudos
Paul32
Novice
4,862 Views

I understand that, I'm looking for 2022.1 (aka 2022.1.0) which I understand to be the last release with opencv.

When I go to Get Started — OpenVINO™ documentation — Version(2022.1) and click on the raspbian OS link, the instructions on that page are for 2022.1.1, not 2020.1.  Looking around the storage.openvinotoolkit.org site I can see a raspbian file for 2022.1.1 but not for any older version.  Like I said above, for example the 2021.4 instruction page asked to download a file that doesn't exist.

Please point me to the raspbian version of openvino 2022.1 with opencv.

 

0 Kudos
Peh_Intel
Moderator
4,842 Views

Hi Paul,

 

Please allow me to correct my statement previously. 

 

Starting from OpenVINO™ 2022 release, the pre-built OpenCV version for OpenVINO™ is no longer publish. It means that OpenVINO™ 2021.4.752 is the last release that has pre-built OpenCV.

 

We are also surprise that OpenVINO™ 2021.4 for Raspbian OS package has been removed from the storage.openvinotoolkit.org site. Anyhow, I share OpenVINO™ 2021.4 for Raspbian OS package here which has been installed previously in my machine. 

 

 

Regards,

Peh

 

0 Kudos
Paul32
Novice
4,832 Views

Ok, if that's the case, then what is the actual difference between 2022.1.0 and 2022.1.1?  One place that indicated 2022.1.0 is the last WITH opencv:  How to use OpenCV with OpenVINO - OpenCV  This says: Starting in the 2022.1.1 release we removed the OpenCV download script and no longer publish the pre-built OpenCV version for OpenVINO.

Thank you for the posted file, but I had previously tried that version (having the FFMEG not work), so I was just pointing out that it no longer exists.  For others, please restore the versions in storage.openvinotoolkit.org.  However, I will try the above in case it's actually different.  EDIT: I tried it out, and like others, FFMPEG didn't work.

I have actually been trying to compile from source, and found this thread a while ago (which expresses my feelings too--many different instructions around and none of them work):  Installing OpenVino for Movidius NCS2 on Raspberry Pi 4 - Intel Community

When that thread declared working instructions, I decided to follow them exactly, but the compile didn't even work.  When I go there now, I see the instructions have changed again.  It has fixed at least one of the things I found (the tag name for opencv 4.5.5), but the first thing I found prevented the compile from working.  The compile expected python version 3.7.3, but the Dockerfile is explicitly compiling 3.7.9.  When I changed that, the compile completed, but I had issues running opencv.  The first of those was the dnn module did not exist.  I found that was because you had -DBUILD_LIST=imgcodecs,videoio,highgui,gapi,python3 in the opencv compile.  Removing that allowed the dnn to work, but trying the inference engine backend failed, like my prior attempts to compile from source.

All I need from this is opencv with the inference engine backend for opencv dnn in order to use an NCS2 (which works in your pre-build versions), and the FFMEG video api working (which works from any opencv compile from source I've done).

A curiosity question: most of the instructions I've found compile opencv first, and then openvino.  How does the openvino compile after that actually change the opencv compiled code to include the inference engine?

Having the actual dockerfile/script that was used to build those old raspberry pi images would be sufficient, but if they exist in github I haven't found them. I just need a recompile to get it to use the current version of FFMPEG. (So 2021.4 would probably be fine.)

 

0 Kudos
Peh_Intel
Moderator
4,797 Views

Hi Paul,


OpenVINO™ 2022.1.1 release provides functional bug fixes and capability updates from the previous release 2022.1.  

 

Yes, there is a script to install pre-built OpenCV in OpenVINO™ 2022.1.0. If you look into this link (https://storage.openvinotoolkit.org/repositories/openvino/packages/2022.1/), there is a separate OpenCV folder. This pre-built OpenCV will be installed once you run the script that included in the OpenVINO™ package. However, this pre-built OpenCV is only available for Windows and Linux OS.

 

The instructions in the article provide a simple way to build a minimal OpenCV used by OpenVINO™. The usage of OpenCV in Open Model Zoo demo is to load image or video using cv2.imread(). The model is loaded using OpenVINO™ Inference Engine. Hence, OpenCV is built before OpenVINO™. To have OpenCV with OpenVINO™ backend, OpenVINO™ is required to be built first, so that OpenVINO™ Inference Engine can be linked to build OpenCV.


As such, I would suggest you recompile custom OpenCV to fulfil your requirement which you mentioned you are able to have FFMEG video api working with your custom built OpenCV.

 

You need to add the following compilation flag to build OpenCV with OpenVINO™ backend.

-D WITH_INF_ENGINE=ON \

-D InferenceEngine_DIR=/l_openvino_toolkit_runtime_raspbian_p_2021.4.752/deployment_tools/inference_engine/share \

-D ngraph_DIR=/l_openvino_toolkit_runtime_raspbian_p_2021.4.752/deployment_tools/ngraph/cmake \

-D INF_ENGINE_RELEASE=2021040000

 

You might need to specify the environment variable if you face issue in importing cv2 after building custom OpenCV.

 

export LD_LIBRARY_PATH=/l_openvino_toolkit_runtime_raspbian_p_2021.4.752/deployment_tools/inference_engine/lib/armv7l

 

 

Regards,

Peh


0 Kudos
Paul32
Novice
4,783 Views

Thank you.  I will try this over the weekend.  I'll use the same opencv tag that was used in the pre-built version (4.5.3-openvino if I recall).

0 Kudos
Paul32
Novice
4,718 Views

My build worked, but i get an error when doing an inport cv2.  My build is based on this site:

Install OpenCV 4 on Raspberry Pi 4 and Raspbian Buster - PyImageSearch

The commands from this site is (so you don't need to go there):

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 INSTALL_PYTHON_EXAMPLES=OFF \
-D OPENCV_ENABLE_NONFREE=ON \
-D CMAKE_SHARED_LINKER_FLAGS=-latomic \
-D BUILD_EXAMPLES=OFF ..
 make -j4
sudo make install
sudo ldconfig
 
I just added the 4 lines to the cmake and used the opencv 4.5.3-openvino version.
Here is the error I get:
Python 3.7.3 (default, Oct 31 2022, 14:04:00)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.7/site-packages/cv2/__init__.py", line 129, in <module>
bootstrap()
File "/usr/local/lib/python3.7/site-packages/cv2/__init__.py", line 112, in bootstrap
import cv2
ImportError: libinference_engine_transformations.so: cannot open shared object file: No such file or directory
 
So why doesn't the make install do the right thing for this?  I tried running the setupvars, but then it uses the cv2 from the openvino download instead of my compile.
So what should I do?
0 Kudos
Peh_Intel
Moderator
4,710 Views

Hi Paul,


Try specify the environment variable below. (Check the location of the folder, it may differ according to where you extract OpenVINO™)

 

export LD_LIBRARY_PATH=/l_openvino_toolkit_runtime_raspbian_p_2021.4.752/deployment_tools/inference_engine/lib/armv7l

 

Please note that the above command must be re-run every time you start a new terminal session. To set up the environment to automatically run the command every time a new terminal is opened, open ~/.bashrc in your favorite editor and add the above command after the last line.



Regards,

Peh


0 Kudos
Paul32
Novice
4,669 Views

I posted a reply last night--the site gave some message about moderator approval.  Is it in the system or lost?

0 Kudos
Jake_Intel
Community Manager
4,657 Views

@Paul32 - Your reply should now be through the system and shown below. CC @Peh_Intel 

0 Kudos
Paul32
Novice
4,658 Views

That worked to import cv2.  I get an error from BACKEND_INFERENCE_ENGINE.  Setting the backend to that or not setting it at all is the same (so it defaults like it should with openvino), and same error from target CPU and MYRIAD, so I think something is still wrong with the build.  The pre-built you posted gives an obvious error for CPU (missing plugin) and works fine with MYRIAD, so the error I'm getting should have nothing to do with the target plugin.  Here is the error:

Traceback (most recent call last):
File "openvino_test.py", line 66, in <module>
detections = net.forward()
cv2.error: bad_weak_ptr

When I set backend to OPENCV (target CPU of course) it works fine.

Here is an edited version of the code (so the net.forward isn't line 66 here) and I uncomment different backend/target lines when running:

# import the necessary packages
import numpy as np
import argparse
import imutils
import time
import cv2
# construct the argument parse and parse the arguments
ap = argparse.ArgumentParser()
ap.add_argument("-p", "--prototxt", required=True,
	help="path to Caffe 'deploy' prototxt file")
ap.add_argument("-m", "--model", required=True,
	help="path to Caffe pre-trained model")
ap.add_argument("-c", "--confidence", type=float, default=0.2,
	help="minimum probability to filter weak detections")
args = vars(ap.parse_args())
# initialize the list of class labels MobileNet SSD was trained to
# detect, then generate a set of bounding box colors for each class
CLASSES = ["background", "aeroplane", "bicycle", "bird", "boat",
	"bottle", "bus", "car", "cat", "chair", "cow", "diningtable",
	"dog", "horse", "motorbike", "person", "pottedplant", "sheep",
	"sofa", "train", "tvmonitor"]
COLORS = np.random.uniform(0, 255, size=(len(CLASSES), 3))
# load our serialized model from disk
print("[INFO] loading model...")
net = cv2.dnn.readNetFromCaffe(args["prototxt"], args["model"])
# specify the target device as the Myriad processor on the NCS
#net.setPreferableBackend(cv2.dnn.DNN_BACKEND_INFERENCE_ENGINE)
#net.setPreferableBackend(cv2.dnn.DNN_BACKEND_OPENCV)
#net.setPreferableTarget(cv2.dnn.DNN_TARGET_MYRIAD)
net.setPreferableTarget(cv2.dnn.DNN_TARGET_CPU)
# initialize the video stream, allow the cammera sensor to warmup,
print("[INFO] starting video stream...")
cap = cv2.VideoCapture(private_data_removed)
time.sleep(2.0)
fCount = 0 
print("backend=",cap.getBackendName())
# loop over the frames from the video stream
while True:
	fCount += 1 

	ret,frame = cap.read()
	if frame is None:
		print("NONE frame, exitting...")
		break

	if fCount % 5 != 0: continue

	# grab the frame dimensions and convert it to a blob
	(h, w) = frame.shape[:2]
	blob = cv2.dnn.blobFromImage(frame, 0.007843, (300, 300), 127.5)
	# pass the blob through the network and obtain the detections and
	# predictions
	net.setInput(blob)
	detections = net.forward()
	# loop over the detections

Here is the build output:

 

General configuration for OpenCV 4.5.3-openvino =====================================
  Version control:               unknown

  Extra modules:
    Location (extra):            /opencv_contrib/modules
    Version control (extra):     unknown

  Platform:
    Timestamp:                   2023-06-25T14:03:42Z
    Host:                        Linux 5.10.103-v7l+ armv7l
    CMake:                       3.16.3
    CMake generator:             Unix Makefiles
    CMake build tool:            /usr/bin/make
    Configuration:               RELEASE

  CPU/HW features:
    Baseline:                    VFPV3 NEON
      requested:                 DETECT
      required:                  VFPV3 NEON

  C/C++:
    Built as dynamic libs?:      YES
    C++ standard:                11
    C++ Compiler:                /usr/bin/c++  (ver 8.3.0)
    C++ flags (Release):         -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -mfpu=neon -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG  -DNDEBUG
    C++ flags (Debug):           -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -mfpu=neon -fvisibility=hidden -fvisibility-inlines-hidden -g  -O0 -DDEBUG -D_DEBUG
    C Compiler:                  /usr/bin/cc
    C flags (Release):           -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -mfpu=neon -fvisibility=hidden -O3 -DNDEBUG  -DNDEBUG
    C flags (Debug):             -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -mfpu=neon -fvisibility=hidden -g  -O0 -DDEBUG -D_DEBUG
    Linker flags (Release):      -latomic  -Wl,--gc-sections -Wl,--as-needed  
    Linker flags (Debug):        -latomic  -Wl,--gc-sections -Wl,--as-needed  
    ccache:                      NO
    Precompiled headers:         NO
    Extra dependencies:          dl m pthread rt
    3rdparty dependencies:

  OpenCV modules:
    To be built:                 aruco barcode bgsegm bioinspired calib3d ccalib core datasets dnn dnn_objdetect dnn_superres dpm face features2d flann freetype fuzzy gapi hdf hfs highgui img_hash imgcodecs imgproc intensity_transform line_descriptor mcc ml objdetect optflow phase_unwrapping photo plot python3 quality rapid reg rgbd saliency shape stereo stitching structured_light superres surface_matching text tracking ts video videoio videostab wechat_qrcode xfeatures2d ximgproc xobjdetect xphoto
    Disabled:                    world
    Disabled by dependency:      -
    Unavailable:                 alphamat cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev cvv java julia matlab ovis python2 sfm viz
    Applications:                perf_tests apps
    Documentation:               NO
    Non-free algorithms:         YES

  GUI: 
    GTK+:                        YES (ver 3.24.5)
      GThread :                  YES (ver 2.58.3)
      GtkGlExt:                  NO
    VTK support:                 NO

  Media I/O: 
    ZLib:                        /usr/lib/arm-linux-gnueabihf/libz.so (ver 1.2.11)
    JPEG:                        /usr/lib/arm-linux-gnueabihf/libjpeg.so (ver 62)
    WEBP:                        build (ver encoder: 0x020f)
    PNG:                         /usr/lib/arm-linux-gnueabihf/libpng.so (ver 1.6.36)
    TIFF:                        /usr/lib/arm-linux-gnueabihf/libtiff.so (ver 42 / 4.1.0)
    JPEG 2000:                   build (ver 2.4.0)
    OpenEXR:                     build (ver 2.3.0)
    HDR:                         YES
    SUNRASTER:                   YES
    PXM:                         YES
    PFM:                         YES

  Video I/O:
    DC1394:                      NO
    FFMPEG:                      YES
      avcodec:                   YES (58.35.100)
      avformat:                  YES (58.20.100)
      avutil:                    YES (56.22.100)
      swscale:                   YES (5.3.100)
      avresample:                YES (4.0.0)
    GStreamer:                   YES (1.14.4)
    v4l/v4l2:                    YES (linux/videodev2.h)

  Parallel framework:            pthreads

  Trace:                         YES (with Intel ITT)

  Other third-party libraries:
    Lapack:                      NO
    Inference Engine:            YES (2021040000 / 2021.4.2)
        * libs:                  /openvino/deployment_tools/inference_engine/lib/armv7l/libinference_engine.so
        * includes:              /openvino/deployment_tools/inference_engine/include
    nGraph:                      YES (0.0.0+e2a469a)
        * libs:                  /openvino/deployment_tools/ngraph/lib/libngraph.so
        * includes:              /openvino/deployment_tools/ngraph/include
    Eigen:                       NO
    Custom HAL:                  YES (carotene (ver 0.0.1))
    Protobuf:                    build (3.5.1)

  OpenCL:                        YES (no extra features)
    Include path:                /opencv/3rdparty/include/opencl/1.2
    Link libraries:              Dynamic load

  Python 3:
    Interpreter:                 /usr/local/bin/python3 (ver 3.7.3)
    Libraries:                   /usr/lib/python3.7 (ver 3.7.3)
    numpy:                       /usr/local/lib/python3.7/site-packages/numpy/core/include (ver 1.21.6)
    install path:                lib/python3.7/site-packages/cv2/python-3.7

  Python (for build):            /usr/local/bin/python3

  Java:                          
    ant:                         NO
    JNI:                         NO
    Java wrappers:               NO
    Java tests:                  NO

  Install to:                    /usr/local
-----------------------------------------------------------------

 

 

0 Kudos
Peh_Intel
Moderator
4,628 Views

Hi Paul,


Could you share your model (Caffe pre-trained model and protoxt file) with us?



Regards,

Peh


0 Kudos
Paul32
Novice
4,614 Views

I don't know how that would help you.  I also tried a Darknet model I had and get the same error.  These are models that work fine with your pre-built one and fail with my compile.  But perhaps you need my exact compile setup.  I built the image with this dockerfile (on the Raspberry PI 4 running Buster):

FROM balenalib/rpi-python:3.7-buster-build 

RUN apt-get update && apt-get install -y \
build-essential cmake pkg-config \
libjpeg-dev libtiff5-dev libjasper-dev libpng-dev \
libavcodec-dev libavformat-dev libswscale-dev libv4l-dev \
libxvidcore-dev libx264-dev \
libfontconfig1-dev libcairo2-dev \
libgdk-pixbuf2.0-dev libpango1.0-dev \
libgtk2.0-dev libgtk-3-dev \
libatlas-base-dev gfortran \
libhdf5-dev libhdf5-serial-dev libhdf5-103 \
libqtgui4 libqtwebkit4 libqt4-test python3-pyqt5 \
python3-dev mosquitto-clients \
&& rm -rf /var/lib/apt/lists/*

RUN pip install numpy

RUN apt-get update && apt-get install -y gstreamer1.0-plugins-base \
gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly \
gstreamer1.0-libav gstreamer1.0-doc \
gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 \
gstreamer1.0-pulseaudio \
libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \
gstreamer1.0-tools \
libavutil-dev libavresample-dev \
&& rm -rf /var/lib/apt/lists/*

COPY source/opencv_contrib-4.5.3 /opencv_contrib
COPY source/opencv-4.5.3-openvino /opencv
COPY source/openvino_2021.4 /openvino

RUN cd /opencv  && mkdir build  && cd build  && \
    cmake -D CMAKE_BUILD_TYPE=RELEASE \
    -D CMAKE_INSTALL_PREFIX=/usr/local \
    -D OPENCV_EXTRA_MODULES_PATH=/opencv_contrib/modules \
    -D WITH_INF_ENGINE=ON \
    -D InferenceEngine_DIR=/openvino/deployment_tools/inference_engine/share \
    -D ngraph_DIR=/openvino/deployment_tools/ngraph/cmake \
    -D INF_ENGINE_RELEASE=2021040000 \
    -D ENABLE_NEON=ON \
    -D ENABLE_VFPV3=ON \
    -D BUILD_TESTS=OFF \
    -D INSTALL_PYTHON_EXAMPLES=OFF \
    -D OPENCV_ENABLE_NONFREE=ON \
    -D CMAKE_SHARED_LINKER_FLAGS=-latomic \
    -D BUILD_opencv_python3=yes \
    -D WITH_GSTREAMER=ON \
    -D PYTHON3_LIBRARY=/usr/lib/python3.7 \
    -D PYTHON3_INCLJUDE_DIR=/usr/include/python3.7 \
    -D BUILD_EXAMPLES=OFF .. \
&& make -j4

RUN cd /opencv/build && make install && ldconfig

CMD bash
0 Kudos
Peh_Intel
Moderator
4,544 Views

Hi Paul,


The provided minimal set of compilation flags to build OpenCV compatible with OpenVINO™ is referring from the build_params.txt that located in the opencv folder of openvino_2021.4.752 package.


However, I also reproduced the same OpenCV issue as you. Hence, we need to investigate further and get back to you at the earliest.



Regards,

Peh


0 Kudos
Paul32
Novice
4,535 Views

Ok, great that you could reproduce it.  Thank you.

0 Kudos
Peh_Intel
Moderator
4,472 Views

 Hi Paul,

 

Previously, I native compiled OpenCV on Raspberry Pi 4. The build was succeeded but failed with cv2.error: bad_weak_ptr error when running DNN API.

 

Now, I use Docker to cross-compile OpenCV for Raspberry Pi. I use a host machine with Ubuntu 20.04 to build the Docker and able to execute DNN API.

  

result.png

 

 

I am referring to the instructions here.

 

1. Create a folder named debian_armhf with a file Dockerfile (attached Dockerfile.txt, please rename)

 

2. Build a Docker image

docker image build -t debian_armhf debian_armhf

 

3. Clone OpenCV from GitHub repository into any directory.

git clone --recurse-submodules -b 4.5.3-openvino-2021.4.2 https://github.com/opencv/opencv.git

 

4.  Run Docker container mounting source code folder from host.

docker run -it -v /absolute/path/to/opencv:/opencv debian_armhf /bin/bash

 

5.    Build

cd opencv && mkdir opencv_build && mkdir opencv_install && cd opencv_build

 

cmake -DCMAKE_BUILD_TYPE=Release \

-DCMAKE_INSTALL_PREFIX="../opencv_install" \

-DOPENCV_CONFIG_INSTALL_PATH="cmake" \

-DCMAKE_TOOLCHAIN_FILE="../platforms/linux/arm-gnueabi.toolchain.cmake" \

-DWITH_IPP=OFF \

-DBUILD_TESTS=OFF \

-DBUILD_PERF_TESTS=OFF \

-DOPENCV_ENABLE_PKG_CONFIG=ON \

-DPKG_CONFIG_EXECUTABLE="/usr/bin/arm-linux-gnueabihf-pkg-config" \

-DPYTHON2_INCLUDE_PATH="/usr/include/python2.7" \

-DPYTHON2_NUMPY_INCLUDE_DIRS="/usr/local/lib/python2.7/dist-packages/numpy/core/include" \

-DPYTHON3_INCLUDE_PATH="/usr/include/python3.7" \

-DPYTHON3_NUMPY_INCLUDE_DIRS="/usr/local/lib/python3.7/dist-packages/numpy/core/include" \

-DPYTHON3_CVPY_SUFFIX=".cpython-37m-arm-linux-gnueabihf.so" \

-DENABLE_NEON=ON \

-DCPU_BASELINE="NEON" \

-D WITH_INF_ENGINE=ON \

-D InferenceEngine_DIR=/l_openvino_toolkit_runtime_raspbian_p_2021.4.752/deployment_tools/inference_engine/share \

-D ngraph_DIR=/l_openvino_toolkit_runtime_raspbian_p_2021.4.752/deployment_tools/ngraph/cmake \

-D INF_ENGINE_RELEASE=2021040000 \

-DENABLE_CXX11=ON ..

 

make -j4 && make install

 

6.    Copy opencv_install to the Raspberry Pi board.

 

7.    Run the following commands to specify new location of OpenCV:

export PYTHONPATH=/path/to/opencv_install/lib/python3.7/dist-packages/:$PYTHONPATH

 

export LD_LIBRARY_PATH=/path/to/opencv_install/lib/:/l_openvino_toolkit_runtime_raspbian_p_2021.4.752/inference_engine/lib/armv7l:/l_openvino_toolkit_runtime_raspbian_p_2021.4.752/deployment_tools/ngraph/lib:$LD_LIBRARY_PATH

 

 

Regards,

Peh

 

 

Paul32
Novice
4,451 Views

Peh,

I think you forgot to attach the dockerfile.

0 Kudos
Peh_Intel
Moderator
4,444 Views

Hi Paul,

 

Thanks for reminding. 

 

I attach the dockerfile here.

0 Kudos
Paul32
Novice
4,352 Views

Peh,

This works now.  I updated your Dockerfile to include packages needed for FFMPEG, and updated the cmake with options from my original opencv builds (like getting opencv contrib).  My test with FFMPEG and using the MYRIAD plugin worked fine.

The one odd thing I've noticed is imshow windows come up with some fixed size instead of the size of the image.  I don't know how openvino would affect this, but trying some different versions I have, the ones with openvino (including your pre-built one) seem to do this, but the ones where the inference engine didn't get in it were fine.

Thanks for the help on this.

 

0 Kudos
Peh_Intel
Moderator
4,311 Views

Hi Paul,

 

Glad to know it's working now.

 

There was a discussion before about this undesired behavior of OpenCV-4.5.3-openvino.

 

However, it seems like a bug in this OpenCV version. Perhaps you can try with other later OpenCV version.

 

 

Regards,

Peh


0 Kudos
Reply