C++
How to install the BOW C++ API.
Prerequisites
First, ensure the following:
- The BOW Hub is installed and running.
- OpenCV 4.x is installed (installation guide below)
- A suitable C++ compiler is installed for your operating system:
- Install CMake 3.5 or later
- Install Microsoft Visual Studio 2017 (VS17) or later for the MSVC toolchain
- As an alternative to VS17 install MSYS2 for the MinGW-w64 (pthreads) toolchain
Installing OpenCV
Windows Installation Options
There are two main ways to install OpenCV on Windows:
1. Using Pre-built Binaries (Recommended)
The easiest way to get started with OpenCV on Windows is to use the pre-built binaries:
- Download the latest Windows release from the official OpenCV releases page
- Run the self-extracting archive
- Add the
opencv/build/bin
directory to your system PATH - Set up the following environment variables:
OPENCV_DIR
pointing toC:\opencv\build\x64\vc15
(adjust path as needed)- Add
%OPENCV_DIR%\bin
to your PATH
The exact paths may vary depending on your installation location and OpenCV version. Make sure to adjust the paths accordingly.
2. Building from Source
If you need custom modules or specific optimizations, you can build OpenCV from source:
- Install Visual Studio 2019 or later with C++ development tools
- Install CMake 3.5 or later
- Clone or download the OpenCV source code
- Follow the official Windows build guide for detailed steps
Visual Studio Integration
To use OpenCV in your Visual Studio projects:
- Create a new C++ project
- Right-click on your project in Solution Explorer
- Select "Properties"
- Under "C/C++" → "General" → "Additional Include Directories", add:
- Under "Linker" → "General" → "Additional Library Directories", add:
- Under "Linker" → "Input" → "Additional Dependencies", add:
(Replace 460 with your OpenCV version number)
For debug builds, use opencv_world460d.lib
instead (note the 'd' suffix).
Installation
The C++ API is installed automatically with the installation of the BOW Hub. If you haven't installed the BOW Hub yet follow the steps here.
Compatible Platforms
Platform | Architecture | Compiler | Status |
---|---|---|---|
Windows | x64 | MSVC (VS2019+) | ✅ Supported |
Windows | x64 | MinGW-w64 | ✅ Supported |
Linux | x64 | GCC 7+ | ✅ Supported |
macOS | x64 | Apple Clang | 🔄 Coming Soon |
macOS | ARM64 | Apple Clang | 🔄 Coming Soon |
Windows | ARM64 | Any | ❌ Not Supported |
Linux | ARM64 | Any | ❌ Not Supported |
Any | x86 | Any | ❌ Not Supported |
Recommendations
Ensure your code is compatible with C++17 standard or later, which is required for the BOW API.
To download a standalone copy of the C++ API follow the Download C++ guide.