- First of all, the configuration of the system environment (after the computer has configured OpenCV once, there is no need to reconfigure). After the configuration of the system environment variables, the corresponding configuration is carried out on VS2015. First select the new project — VC++ — Win32 console program — empty project, and then right-click the source file to create a corresponding main function;
Then find the property manager in the view – Microsoft.cpp.x64.user in the Debugx64, and right-click to select the property; Add and edit the include file in the VC++ directory:
E:\opencv\opencv\build\include\opencv2
E:\opencv\opencv\build\include\opencv
E:\opencv\opencv\build\include
To add and edit the library directory:
E:\opencv\opencv\build\x64\vc15\lib
Add and edit the — input — attached dependencies in the linker:
Opencv_world341d. Lib
After the above three steps, click Apply and all the variables are configured. At this point, you can choose a simple program to run (e.g., display an image).
# include & lt; opencv2/opencv.hpp>
# include & lt; iostream>
Using the namespace CV;
Using namespace STD.
Int main(int argc, char** argv)
{
cout < < “Hello World” & lt; < Endl;
Mat image = imread (” E: \ \ v \ \ c + + \ \ hello word2 \ \ hello word2 \ \ 10. JPG “);
// NamedWindow (” test image “);
Imshow (” ceshi “, image);
/*if (image.empty())
{
imshow(“window”, image);
} * /
waitKey(0);
Return 0;
}
In particular, it is necessary to pay attention to:
1. Be sure to configure it on the solution configuration and solution platform. Debug+x64
2. The images that need to be opened must be placed in the same path as the.cpp file
The escape character in the path is uble slash.
Can consult to solve video https://v.qq.com/x/page/d0519qgy4lu.html?
Read More:
- Opencv perfect configuration strategy 2015 (win7 + opencv 2.4.9 + vs 2013)
- Configuration of OpenGL development environment under Windows environment, win10 + vs2019 + glfw + glad
- OpenGL environment configuration under VS2010 / vs2012 / vs2015
- Vs2015 OpenGL environment configuration
- Vs configuration of OpenGL development environment: configuration of glfw library and glad Library
- Construction of vs2015 OpenGL configuration environment
- Vs2015 + OpenGL environment configuration
- Split keyword in ABAP when the separator is at the beginning and end of the string
- OpenGL class library and environment configuration under win10 and vs2015
- On the configuration of OpenGL Red Book eighth edition environment in vs2013
- Simple configuration of glfw + glad in vs2015 OpenGL development environment
- Problems encountered in vs2015 configuration using OpenGL environment
- Vs2015 + PCL. 1.8.1 (win10) environment configuration
- OpenGL + vs2015 environment configuration problem solving
- Vs2015 configuring OpenGL development environment: configuration of glfw library and glad Library
- Project files may be invalid appears when cmake compiles opencv3.1, and the debug additional dependency of the compiled opencv3.1 is at the end
- PCL environment configuration (pcl1.8.1, vs2017, win10)
- Mac clion configuring opencv environment
- Vs configure tensorrt environment to use
- Imshow() reports an error after C + + opencv 4.5.1 configures the environment