CV C++

CV C++ runs a supported 64-bit Windows DLL against frames from the active capture tool. Each Helios release includes the version-matched C++ SDK and examples under:

text
versions/<version>/sdk/

Start with that package when creating or rebuilding a script. Do not mix headers from one Helios version with another release.

Requirements

  • One running capture tool
  • Visual Studio 2026 with the v145 x64 C++ tools
  • CMake 3.28 or newer when using the packaged example
  • C++23, x64, and the dynamic MSVC runtime (/MD)
  • OpenCV 5.0.0 development files
  • A compatible Compute GPU when the script uses inference or OCR

Basic Script

cpp
#include <helios/HeliosCVSDK.h>

class CVWorker {
public:
    CVWorker(std::uint32_t width, std::uint32_t height) {
        (void)width;
        (void)height;
    }

    void process(Helios::Frame& frame) {
        Helios::Overlay::circle(
            200, 160, 18,
            Helios::Overlay::Color{0, 255, 0});

        // frame.image is the current BGR cv::Mat.
        (void)frame;
    }
};

HELIOS_CV_SCRIPT(CVWorker)

The worker constructor receives the capture width and height. process(Helios::Frame&) is called for each frame and returns void. The frame contains:

  • image: the current BGR cv::Mat;
  • sequence: the frame sequence number;
  • timestampNs: the frame timestamp in nanoseconds.

The frame and its image are borrowed for the current callback. Do not retain references or pointers after process() returns.

HELIOS_CV_SCRIPT(CVWorker) generates the three required DLL exports:

text
helios_cv_script_create
helios_cv_script_process
helios_cv_script_destroy

Use the packaged macro to declare the required script entry points. Build with the SDK from your installed Helios release and update Helios before using newly added SDK features.

Build

The SDK includes ready-to-copy examples and a CMake project under examples/cpp, a Python example under examples/python, and matching references under docs. Point your build at the packaged include directory and OpenCV 5.0.0, then produce an x64 DLL.

Keep any additional DLL dependencies beside your script DLL. The finished Controls, Overlay, OCR, Inference, host, and script-lifecycle surfaces keep existing named functions and published layouts stable; newer optional functionality is added as another named function. Build new scripts against the complete SDK from the installed Helios version because a script that calls a newer function requires a runtime that provides it.

Vision and Meter are still active-development surfaces and may change before they are declared finalized. Review their current packaged references when rebuilding a script that uses them.

CV C++ inherits the Python environment selected under Preferences → Python. A DLL that embeds Python can read the exact selected interpreter path from HELIOS_PYTHON_EXECUTABLE; keep its other native dependencies beside the script DLL.

Run

Step Action
1 Start one capture tool.
2 Open CV C++ and select the script DLL.
3 Confirm Video Input: Active.
4 Start CV C++.
5 Use Restart after rebuilding the DLL or when resetting script state.

Only load DLLs built as Helios CV C++ scripts and obtained from a source you trust.

Supported APIs

Including HeliosCVSDK.h provides the public script surface for:

  • frame processing and OpenCV access;
  • controller, keyboard, and mouse state;
  • compact data output;
  • Overlay drawing;
  • Inference, Vision, and Meter helpers.

See the Script API Reference or the matching references under sdk/docs.

Troubleshooting

  • Video not detected: start one capture tool, then restart CV C++.
  • DLL will not load: confirm the build is x64, uses the current packaged headers, includes HELIOS_CV_SCRIPT, exports all three lifecycle functions, and has its dependencies beside it.
  • Build errors: begin with the packaged example and use the documented compiler, C++23, /MD, and matching OpenCV package.
  • Script crashes: stop it, check Output Panel, and test the unchanged packaged example before restoring optional models or assets.
  • Low performance: reduce the inference ROI or capture resolution and lower the display preview rate.

See Also