ubuntu16.04 under OPENCV installation notes and routines

Source: Internet
Author: User

Problem:

Recently reinstalled the system, need to reconfigure the opencv2.4.13, the configuration after the completion of each time CMake Error,google error, tried various methods, did not solve the problem, then re-git clone The opencv2.4.9, found the same problem and error.

Workaround:

just started not to update the version before tossing for two days, and then feel particularly no sense of accomplishment, then slowly put down the matter, began to learn their own postgraduate courses, learning boring time and try to reinstall the next, and finally ran through the routine, posted routines and test results :

Test routines:

Create a new Demo folder

To create a new demo.cpp, copy the following code to paste:

#include <opencv2/core/core.hpp>
#include <opencv2/viz/vizcore.hpp>

int main ()
{
cv::viz::viz3d window = cv::viz::viz3d ("Viz demonstration");

CV::P Oint3d min (0.25, 0.0, 0.25);
CV::P Oint3d Max (0.75, 0.5, 0.75);

Cv::viz::wcube cube (min, Max, True, Cv::viz::color::blue ());
Cube.setrenderingproperty (cv::viz::line_width, 4.0);

Window.showwidget ("Axis widget", Cv::viz::wcoordinatesystem ());
Window.showwidget ("Cube widget", Cube);

while (!window.wasstopped ()) {
Window.spinonce (1, true);
}

return 0;
}

Create a new CMakeLists.txt folder, copy and paste the following code:

Cmake_minimum_required (VERSION 2.8.12)

Project (Demo)

Find_package (OpenCV REQUIRED)
Include_directories (${opencv_include_dirs})

Add_executable (Demo demo.cpp)
Target_link_libraries (Demo ${opencv_libs})

Compile

CD Demo

mkdir Build

CD Build

CMake.

Make

./demo

The test results are as follows:

ubuntu16.04 OPENCV Installation notes and routines

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.