- CMake (3.11 or higher) - Build system generator
- OpenCV - Computer vision library
- A C++ compiler (e.g., g++) - Code compiler
-
If downloaded from the lecture (Using linux)
- Delete build file and start over
-
Create a build directory and navigate into it:
mkdir build cd build
This creates a separate directory for build artifacts to keep source code clean.
-
Run CMake to configure the project:
cmake ..
CMake will:
- Read the CMakeLists.txt files
- Check for required dependencies (OpenCV)
- Detect system architecture (ARM64/x86)
- Generate build files (Makefiles)
- Configure compiler settings and flags
-
Build the project:
make
Make will:
- Read the generated Makefiles
- Compile source files into object files
- Link object files with libraries (OpenCV)
- Create the final executable
- Place the executable in build/src/camera_with_fps
-
After building, you can run the executable from the build directory: In the build folder, execute
./src/camera_with_fps
-
Ensure your camera is connected and properly configured.
-
Follow any on-screen instructions provided by the application.
/opt/homebrew/include/opencv4/opencv2
g++ camera_with_fps.cpp -o cv -I/opt/homebrew/include/opencv4/opencv2
Actually the open cv can be found here
-- Found OpenCV: /opt/homebrew/Cellar/opencv/4.11.0 (found version "4.11.0")
- Create a folder called include
- Copy paste include folder from text
- rm -rf build && mkdir build && cd build
- cmake ..
- make