Report this

What is the reason for this report?

How to install openCv in Digital Ocean ubuntu One click AI droplet.

Posted on December 1, 2017

How can I install opencv on digital ocean or is there any droplet available which comes with pre-installed opencv. ??



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Digital Ocean doesn’t come with a pre-installed “one click” solution for OpenCV. You can do the install as follows on an Ubuntu 16.04 droplet

// Open CV 3

sudo apt-get -y install libtiff5-dev

sudo apt-get -y install libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev sudo apt-get -y install libxine2-dev libv4l-dev sudo apt-get -y install libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev sudo apt-get -y install qt5-default libgtk2.0-dev libtbb-dev sudo apt-get -y install libatlas-base-dev sudo apt-get -y install libfaac-dev libmp3lame-dev libtheora-dev sudo apt-get -y install libvorbis-dev libxvidcore-dev sudo apt-get -y install libopencore-amrnb-dev libopencore-amrwb-dev sudo apt-get -y install x264 v4l-utils sudo apt-get install -y gcc-5 g+±5

// Optional sudo apt-get -y install libprotobuf-dev protobuf-compiler sudo apt-get -y install libgoogle-glog-dev libgflags-dev sudo apt-get -y install libgphoto2-dev libeigen3-dev libhdf5-dev doxygen

// download opencv-3.3.1 wget https://github.com/opencv/opencv/archive/3.3.1.zip -O opencv-3.3.1.zip unzip opencv-3.3.1.zip

// download opencv_corntib-3.3.1 wget https://github.com/opencv/opencv_contrib/archive/3.3.1.zip -O opencv_contrib-3.3.1.zip unzip opencv_contrib-3.3.1.zip

cd opencv-3.3.1 mkdir release cd release

// compile and install export CC=/usr/bin/gcc-5 export CXX=/usr/bin/g+±5 cmake -D CMAKE_BUILD_TYPE=RELEASE
-D CMAKE_INSTALL_PREFIX=/usr/local
-D INSTALL_C_EXAMPLES=ON
-D INSTALL_PYTHON_EXAMPLES=ON
-D WITH_TBB=ON
-D WITH_V4L=ON
-D WITH_QT=ON
-D WITH_OPENGL=ON
-D OPENCV_EXTRA_MODULES_PATH=…/…/opencv_contrib-3.3.1/modules
-D BUILD_EXAMPLES=ON …

// Build with all cores make “-j$(nproc)”

sudo make install sudo sh -c ‘echo “/usr/local/lib” >> /etc/ld.so.conf.d/opencv.conf’ sudo ldconfig

Need to add:

sudo apt-get install unzip

before:

// download opencv-3.3.1

opencvcontrib url path changed to opencv_contrib

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.