- This sample project demonstrates how to use CMake to build and run a C++ project integrating VizionSDK with OpenCV.
- In addition to the C++ examples, Python example code and usage instructions are also included in the documentation.
The following sample programs demonstrate key functionalities using VizionSDK (or pyvizionsdk) together with OpenCV:
-
vizionsdk_opencv.cpp / pyvizionsdk_cv.py
Captures images from the camera and displays them using OpenCV'simshow
function. -
vizionsdkcapture.cpp / pyvizionsdkcapture.py
Adjusts the image brightness through VizionSDK and captures video frames with OpenCV’sVideoCapture
. -
vizionsdk_ehdr.cpp / pyvizionsdk_ehdr.py
Shows how to configure the eHDR maximum exposure number and capture images using OpenCV’sVideoCapture
. -
vizionsdk_cv_saveimg.cpp / pyvizionsdk_cv_saveimg.py
Captures images from the camera and saves them using OpenCV'simsave
function.
Before building and running this project, ensure you have the following installed:
-
CMake (Version 3.0 or newer):
- CMake is required to configure the build.
- If you don't have it, download and install it from the official CMake website.
- Make sure the
cmake
executable is in your system's PATH. You can verify by runningcmake --version
in your terminal.
-
C++ Compiler (Supporting C++11):
- A C++ compiler compatible with the C++11 standard is needed (e.g., GCC, Clang, MSVC). Install one suitable for your platform if necessary (e.g.,
build-essential
on Ubuntu/Debian, Visual Studio C++ workload on Windows).
If you're using Ubuntu, install with:
sudo apt install cmake build-essential
- A C++ compiler compatible with the C++11 standard is needed (e.g., GCC, Clang, MSVC). Install one suitable for your platform if necessary (e.g.,
-
OpenCV(version 4.9 or newer)
- For C++ Development:
- OpenCV can be downloaded at release page: OpenCV
- Windows: Before building the sample code, please ensure the path in CMakeList.txt is correctly set to your local OpenCV installation.
- Linux: To install OpenCV, please follow the steps provided in the official tutorial: OpenCV installation
- OpenCV can be downloaded at release page: OpenCV
- For Python Development: Install with
pip install opencv-python
- Open Terminal and navigate to the directory of the project
- Create a build directory:
mkdir build && cd build
- Generate build files using CMake:
cmake ..
- Build the project using the generated build files:
- Windows:
cmake --build . --config Release
- Linux:
make
- Windows:
⚠️ Warning:
- eHDR-related properties are only supported on VCI-AR0821 and VCI-AR0822. Running eHDR example on unsupported devices may result in undefined behavior.
- Ensure that eHDR mode is enabled before running the eHDR example.
After successful building the project, the executable will be located in the build
directory
- Windows: Run the executable from the Command Prompt or double-click it in File Explorer.
- Linux: Open a terminal and run it using
./{execution_name}
.
- Use the following commands to run the examples
python python/pyvizionsdk_cv.py python python/pyvizionsdkcapture.py python python/pyvizionsdk_ehdr.py python python/pyvizionsdk_cv_saveimg.py