By Suman Jha
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!
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
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.