Install tool for compile OpenCV, Setup Environment variables for OpenCV, Configure in Visual Studio and simple example, Result As the main contents of the document "Setup Opencv ". Invite you to consult. | SETUP OPENCV Author: Nguyen Van Ca Overview 1. Install tool for compile OpenCV 2. Setup Environment variables for OpenCV 3. Configure in Visual Studio and simple example. 4. Result I. Install tools for compile OpenCV 1. Visual Studio Download and install Visual Studio 2013 or Visual Studio 2015 (C/C++). It’s free and choosing all default options will work fine 2. OpenCV Goto and download the OpenCV latest version for Windows. Then set "Extract to:" to your "C:\" directory. II. Setup Environment variables for OpenCV] Goto “My Computer”, click ringt mouse select “Properties” Then chose “Advanced system setting”. Then we chose And edit “Path” field Add “C:\opencv\build\x64\vc12\bin”. Because we are using Visual Studio 2013 (vc12) Click “OK” to save. Pull up a Command Prompt and verify the bin directory is now in PATH, then reboot III. Configure in Visual Studio and simple example. Start Visual Studio, choose File -> New -> Project. Choose Visual C++, Empty Project, name as you prefer, ex “OpenCV_Test1”, set preferred location, uncheck "Create directory for solution" and "Add to source control", choose OK. Then right click in Solution Explorer, choose Add -> New Item. Choose "C++ File", name the C++ file as preferred, ex. "", choose "Add". In the Visual Studio toolbar, verify that "Solution Configurations" is set to "Debug", then change "Solution Platforms" to "x64" (make sure not to skip this step, or 32-bit vs 64-bit errors will be encountered). Chose “OpenCV_Test1”, click “Properties” Chose “Configuration Manager” Click “Win 32” in “Platofrom” Chose “x64”, then click OK In “VC++ Directories”, in “Include Directories ” field add “C:\opencv\build\include” and in field “Library Directories” “C:\opencv\build\x64\vc12\lib” In “Input” field of “Linker” field. Add “” in “Additional Dependencies” field. (“” when Debug mode, “” when Release mode) So, we configured environment for Visual Studio. IV. Result Project “Trace the red” use Camera.