- 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:
- Mac clion configuring opencv environment
- Vs configure tensorrt environment to use
- error LNK2038: mismatch detected for ‘RuntimeLibrary’: value ‘MTd_StaticDebug’ doesn’t match value ‘
- 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
- plt.show () and plt.imshow The difference between ()
- How to solve the error after Java importing project
- OpenGL environment configuration
- Configuration of OpenGL development environment under Windows environment, win10 + vs2019 + glfw + glad
- Cmake compile opencv report error qtcore_ DIR QtOpenglDIR QtGui_ Dir ffmpeg loading failed
- Configuring OpenGL in Chinese version of VS2010 and problem solving
- Vs2015 configuring OpenGL development environment: configuration of glfw library and glad Library
- Mobile app development: installation and configuration of react native
- Vs2013 + glfw + glew configure OpenGL development environment
- VS2010 library function problem: objidl. H (11266): error c2061: syntax error: identifier ‘__ RPC__ out_ xcount_ part’
- Problems encountered in window10 system configuration tesseract
- Undeclared identifier CV in opencv4.2.0_ WINDOW_ AUTOSIZE
- How to Fix Invalid bound statement (not found) Error
- Installing opencv and Linux Makefile:160 : recipe for target ‘all’ failed problem resolution
- Error resolution-“Error in configuration process, project files may be invalid” appears when Cmake compiles openCV
- cv2.error: OpenCV(3.4.2) error: (-215:Assertion failed) !empty() in function ‘detectMultiScale‘