1. Download the opencv installation package
Releases - OpenCVhttps://opencv.org/releases/
2. Install opencv-4.6.0-vc14_vc15.exe to D:\opencv\
3. Configure the opencv system environment
4. Verify the installation results
4.1 Create a new win32 console program
4.2 Configure X64 for Debug and Release
The actual operation uses the debug mode
4.3 Configuration library dependencies
4.4 Test code example
#include "stdafx.h"
#include <opencv2\opencv.hpp>
using namespace std;
using namespace cv;
int main()
{
Mat img = imread("D://SSphoto.jpg");
if (img.empty())
{
cout << "not" << endl;
system("pause");
return -1;
}
namedWindow("mao", 1);
imshow("mao", img);
waitKey(0);
return 0;
}
4.5. Run the test program