Dependencies of GPU Accelerated Motion Detector

From RidgeRun Developer Wiki



Previous: Getting Started Index Next: Getting Started/Evaluating GPUMotionDetector







The GPU Accelerated Motion Detector was made in 2 parts, the first one is a library made in C++ and the second part are the GStreamer plugins. In this section you will find the instructions to install the dependencies for both the C++ library and the Gstreamer plugins. We recommend using the package manager for installing the dependencies for the NVIDIA Jetson boards.


GPU Accelerated Motion Detector C++ Library

Below you can see the dependencies for the C++ library(librrmotiondetection), where some are optional and it is up to the user if they want to install them. If the optional dependencies are not installed the library will simply not build the features depending on them.

C++ Library Dependencies:

  • Meson build system
  • Python3-pip
  • Pre-commit
  • Cpputest
  • Doxygen
  • Jsoncpp
  • Libgstreamer1.0-dev
  • Libgstreamer-plugins-base1.0-dev
  • Gst-cuda-1.0: version >= 0.15.0 (optional)
  • OpenCV4
  • CUDA L4T package
  • Graphviz

Meson Build System

Download meson via pip installer:

 sudo apt install python3-pip ninja-build
 sudo -H pip3 install meson==0.60.0
 #After installation you may need to export meson to the PATH variable
 echo 'export PATH=$HOME/.local/bin:$PATH' >> ~/.bashrc
 source ~/.bashrc

Pre-commit

Run the following command to install the pre-commit package:

 pip3 install pre-commit

General Dependencies

Run the following command to install the cpputest, doxygen, jsoncpp and GStreamer packages:

 sudo apt-get install cpputest doxygen libjsoncpp-dev gstreamer1.0-plugins-base libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev graphviz

CUDA L4T package

The Jetpack default installation will flash and install all the necessary CUDA packages. If you don’t have installed this package, you can follow the instructions detailed in this link: https://developer.ridgerun.com/wiki/index.php/GstCUDA_-_Building_and_Installation_Guide#CUDA_L4T_package

OpenCV

If you don't have installed OpenCV in your device you can run the following commands to install the package:

Uninstall opencv, to make sure that there is no other version in the system

 sudo apt-get purge *libopencv*

Install the OpenCV dependencies.

sudo apt-get install -y build-essential cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev python2.7-dev python3-dev python-dev python-numpy python3-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libdc1394-22-dev libv4l-dev v4l-utils qv4l2  curl

Download OpenCV packages.

curl -L https://github.com/opencv/opencv/archive/4.5.1.zip -o opencv-4.5.1.zip
curl -L https://github.com/opencv/opencv_contrib/archive/4.5.1.zip -o opencv_contrib-4.5.1.zip
unzip opencv-4.5.1.zip && unzip opencv_contrib-4.5.1.zip

Installing OpenCV with CUDA support. For this installation you will need to have CUDA installed in your device.

cd opencv-4.5.1/ && \
mkdir release && \
cd release/ && \
cmake -D WITH_CUDA=ON -D ENABLE_PRECOMPILED_HEADERS=OFF  -D CUDA_ARCH_BIN="7.2" -D CUDA_ARCH_PTX="" -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-4.5.1/modules -D WITH_GSTREAMER=ON -D WITH_LIBV4L=ON -D BUILD_opencv_python2=ON -D BUILD_opencv_python3=ON -D BUILD_TESTS=OFF -D BUILD_PERF_TESTS=OFF -D BUILD_EXAMPLES=OFF -D CMAKE_BUILD_TYPE=RELEASE -D OPENCV_GENERATE_PKGCONFIG=ON -D CMAKE_INSTALL_PREFIX=/usr/ .. && \
make -j4 && \
sudo make install

Gst-CUDA (Optional)

If you already own a professional version of this plugin, you can ignore this installation.

To install the evaluation binaries follow the instructions found in the GstCuda Installation guide: https://developer.ridgerun.com/wiki/index.php/GstCUDA_-_Evaluating_GstCUDA#Installation_and_testing

GPU Accelerated Motion Detector GStreamer Plugin

Below you can see the dependencies for the GStreamer Plugins (gstrrmotiondetection). In order to use it you must first have the GPU Accelerated Motion Detector C++ library installed with all dependencies (including the optional ones). So for these plugins you should follow the instructions given in the previous section.

GStreamer Plugins Dependencies:

  • Meson build system
  • Hotdoc
  • Python3-pip
  • Libgstreamer1.0-dev
  • Libgstreamer-plugins-base1.0-dev
  • GPU Accelerated Motion Detector C++ Library
  • Gst-cuda-1.0
  • OpenCV4
  • CUDA L4T package

Hotdoc

Run the following commands to install the hotdoc package:

  sudo apt-get install python3-dev libxml2-dev libxslt1-dev libyaml-dev libglib2.0-dev libjson-glib-dev 
  sudo -H pip3 install cython
  sudo -H pip3 install hotdoc


Previous: Getting Started Index Next: Getting Started/Evaluating GPUMotionDetector