Reusing the OpenCV's Saliency algorithms for research purpose
Directions to install OpenCV 3.1.0 with OpenCV_contrib modules
- Do this step by step
- sudo apt-get install build-essential
- sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
- sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev
- git clone https://github.com/Itseez/opencv.git
- git clone https://github.com/Itseez/opencv_contrib.git
- cd opencv
- mkdir release
- cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D OPENCV_EXTRA_MODULES_PATH=source_directory/opencv_contrib/modules source_directory/opencv/
- make -j6
- sudo make install
Check the installation by typing the following command
pkg-config --modversion opencv
This should show the version of your openCV. Hopefully 3.1.0.
Lets try out the Saliency Example now. Clone this directory
- git clone https://github.com/surjithbs17/saliency_opencv.git
- git checkout master
Make the file using CMAKE
- cd saliency_opencv
- Run "cmake ."
- Run "make"
- Execute the code by typing "./saliency airplane.mp4 MOTION threshold_value"
Example commands:
-
./saliency DRONE-NET_TEST-10-29-16.mp4 STATIC 200
-
./saliency DRONE-NET_TEST-10-29-16.mp4 MOTION 200
This should show four outputs(Original Video frame, SaliencyMap(Spectral Residual and Motion saliency), binarymap(extracted from saliency map),thresholded binary map(Thresholded according to input arguments on SaliencyMap) and background subtracted(MOG).
Reference: