Right click the downloaded folder and press “Extract All…”. Then press “Extract.”
Go to the start menu and type “environment”. Then press “Edit the system environment variables.”
You should now see a window that looks like the one below:
Press “Environment Variables…,” click on “Path,” and then press “Edit…”:
Now press “New” and then “Browse…” and find the location of the OpenCV bin folder (for me it’s inside the downloaded OpenCV folder, and then inside x64 > mingw > bin. Click on this bin folder and press “Ok” to add it to the computer’s Path. Then be sure to exit by pressing “Ok” on each of the windows you opened (otherwise the changes may not be saved). This whole step just helps the computer easily find some important OpenCV files.
Restart your computer (if you don’t, the steps below won’t work properly)
Replace “D:\OpenCV\Lib\include” with the location of the OpenCV include folder on your computer.
Replace “D:\OpenCV\Lib\x64\mingw\bin” with the location of the OpenCV bin folder on your computer.
Click on c_cpp_properties.json and update the “includePath” so that it also contains the OpenCV include folder. Now my “includePath” looks like this (yours will be different depending on where the include folder is located on your computer):