Credits
WalkWithMe https://youtu.be/MAoQqhcKKAo
- opencv undistort code
Kevin Wood https://youtu.be/CnXUTG9XYGI
- how to run opencv with visual studio code
Go to the cmake website (https://cmake.org/download/) and downlad cmake-3.28.1-windows-x86_64.msi
for the Windows x64 Installer
.
Download OpenCV release from the opencv website (https://opencv.org/releases/). Under OpenCV - 4.8.0
, click on the Windows
button, and run the exe isntall. Specify path to save (i.e. C:\opt
)
Download latest from https://www.boost.org/. Follow the build+install guide (https://www.boost.org/doc/libs/1_85_0/more/getting_started/windows.html).
Especially step 5 Prepare to Use a Boost Library Binary
and 5.1 Simplified Build From Source
Open CMakeLists.txt and update this line to point to your boost install root directory
set(BOOST_ROOT "C:/Program Files/boost/boost_1_85_0")
Create a new environment variable (Windows > Edit the system environment variables). Restart VS Code to take effect if already open. This step is required when we call find_package(OpenCV REQUIRED)
in the CMakeList.txt
file as we will see later.
Variable: `OpenCV_DIR`
Value:`C:\opt\opencv\build`
Add the following paths to your environment variables (Windows -> Edit the system environment variables). This is to find the bin and lib folders.
C:\Program Files\CMake\bin
C:\opt\opencv\build\x64\vc16\bin
C:\opt\opencv\build\x64\vc16\lib
Add your CMakeLists.txt
file to your project.
Create your main.cpp program.
Configure the build
mkdir build
cmake -B .\build\
Build and Run Exe in Debug
cmake --build .\build\
.\build\Debug\OpenCVExample.exe
Build and Run Exe in Debug
cmake --build .\build\ --config Release
.\build\Release\OpenCVExample.exe
If you make any changes to your main.cpp file, you just need to re-run the build step and not the configure step.
cmake --build .\build\
.\build\Debug\OpenCVExample.exe
Drag and drop your raw video file onto the exe
- Requires a Result
folder in the same directory as the exe