How to Install OpenCV in Ubuntu 16.04 LTS for C / C++

Video is ready, Click Here to View ×

List of all commands –
In this post we will see How to Install OpenCV in Ubuntu for C/C++.
OpenCV is an image processing library created by Intel and later supported by Willow Garage and now maintained by Itseez. OpenCV means IntelĀ® Open Source Computer Vision Library. It is a collection of C functions and a few C++ classes that implement some popular Image Processing and Computer Vision algorithms. OpenCV is Available on Mac,…


  1. hello! i tried this procedure and till c make i'm okay and while i'm trying to install make j4 my system got shutdown. i tried for it many times but i don't know where the mistakes lies. can you please help me in this regard.

  2. hello! I followed all the procedures and everything went fine except for this error "No package 'tesseract' found" and the –modversion output for opencv is "" can someone help me with this please

  3. opencv_contrib is not added to the library. found the problem while running some code.

    here is the output of pkg-config –libs opencv

    -L/usr/local/lib -lopencv_stitching -lopencv_superres -lopencv_videostab -lopencv_photo -lopencv_aruco -lopencv_bgsegm -lopencv_bioinspired -lopencv_ccalib -lopencv_dpm -lopencv_face -lopencv_freetype -lopencv_fuzzy -lopencv_img_hash -lopencv_line_descriptor -lopencv_optflow -lopencv_reg -lopencv_rgbd -lopencv_saliency -lopencv_stereo -lopencv_structured_light -lopencv_phase_unwrapping -lopencv_surface_matching -lopencv_tracking -lopencv_datasets -lopencv_text -lopencv_dnn -lopencv_plot -lopencv_xfeatures2d -lopencv_shape -lopencv_video -lopencv_ml -lopencv_ximgproc -lopencv_calib3d -lopencv_features2d -lopencv_highgui -lopencv_videoio -lopencv_flann -lopencv_xobjdetect -lopencv_imgcodecs -lopencv_objdetect -lopencv_xphoto -lopencv_imgproc -lopencv_core

    please suggest how to add opencv_contrib to the list.

  4. sir i got this error ……

    CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
    Please set them or make sure they are set and tested correctly in the CMake files:
    linked by target "opencv_dnn_modern" in directory /opt/opencv_contrib/modules/dnn_modern

    — Configuring incomplete, errors occurred!
    See also "/opt/opencv/release/CMakeFiles/CMakeOutput.log".
    See also "/opt/opencv/release/CMakeFiles/CMakeError.log".

Leave a Reply

Your email address will not be published.