Background

C++

How to install the BOW C++ API.

Prerequisites

First, ensure the following:

Installing OpenCV

Windows Installation Options

There are two main ways to install OpenCV on Windows:

The easiest way to get started with OpenCV on Windows is to use the pre-built binaries:

  1. Download the latest Windows release from the official OpenCV releases page
  2. Run the self-extracting archive
  3. Add the opencv/build/bin directory to your system PATH
  4. Set up the following environment variables:
    • OPENCV_DIR pointing to C:\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:

  1. Install Visual Studio 2019 or later with C++ development tools
  2. Install CMake 3.5 or later
  3. Clone or download the OpenCV source code
  4. Follow the official Windows build guide for detailed steps

Visual Studio Integration

To use OpenCV in your Visual Studio projects:

  1. Create a new C++ project
  2. Right-click on your project in Solution Explorer
  3. Select "Properties"
  4. Under "C/C++" → "General" → "Additional Include Directories", add:
    $(OPENCV_DIR)\..\..\include
  5. Under "Linker" → "General" → "Additional Library Directories", add:
    $(OPENCV_DIR)\lib
  6. Under "Linker" → "Input" → "Additional Dependencies", add:
    opencv_world460.lib
    (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

PlatformArchitectureCompilerStatus
Windowsx64MSVC (VS2019+)✅ Supported
Windowsx64MinGW-w64✅ Supported
Linuxx64GCC 7+✅ Supported
macOSx64Apple Clang🔄 Coming Soon
macOSARM64Apple Clang🔄 Coming Soon
WindowsARM64Any❌ Not Supported
LinuxARM64Any❌ Not Supported
Anyx86Any❌ 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.