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