VizionSDK Overview
  • 13 Nov 2024
  • 21 Minutes to read
  • Dark
    Light
  • PDF

VizionSDK Overview

  • Dark
    Light
  • PDF

Article summary

VizionSDK API Manual

Article is keeping on updating

We are working on this article to update more information about VizionSDK and ensure the contents are correct.

Introduction

VizionSDK is a software development kit designed for Windows and Linux platforms. It mainly supports TechNexion cameras on various types of platform, including Windows10/11, Ubuntu, Yocto, NXP-imx8mp, and so on. It provides the methods to easily control AR Series Cameras for companies and individuals who are looking to develop custom applications.

Supported Cameras

Camera SeriesProducts
TEVSTEVS-AR0144-C
TEVS-AR0234-C
TEVS-AR0521-C
TEVS-AR0522-C
TEVS-AR0522-M
TEVS-AR0821-C
TEVS-AR0822-C
TEVS-AR1335-C
TEVI (NRND)TEVI-AR0144-C
TEVI-AR0234-C
TEVI-AR0521-C
TEVI-AR0522-C
TEVI-AR0522-M
TEVI-AR0821-C
TEVI-AR1335-C
TEVI-OV5640
VLS3 CamerasVLS3-AR0144-C
VLS3-AR0234-C
VLS3-AR0521-C
VLS3-AR0522-C
VLS3-AR0522-M
VLS3-AR0821-C
VLS3-AR0822-C
VLS3-AR1335-C
UVC CamerasVCI-AR0144-C
VCI-AR0234-C
VCI-AR0521-C
VCI-AR0522-C
VCI-AR0522-M
VCI-AR0821-C
VCI-AR0822-C
VCI-AR1335-C

Supported Platforms

  • Windows 10/11
  • Ubuntu
  • NXP i.MX8MP
  • NXP i.MX8MM
  • NXP i.MX93
  • NXP i.MX95
  • Jetson Nano (JetPack 4.x)
  • Jetson Orin Nano (JetPack 5.x/6.x)
  • UP Squared Pro 7000

How to load VizionSDK

Download the VizionSDK for your corresponding platform from the following link: VizionSDK Download Page.

Windows:

Prerequisites

We recommend to use Visual Studio 2017 or later to develop the application with VizionSDK.
Environment: Visual C++ Redistributable for Visual Studio 2017 or later.

There is a example for loading VizionSDK:

#include <windows.h>
HINSTANCE hsvizionsdk;
hsvizionsdk = LoadLibrary(L"VizionSDK.dll");

The detail step to build sample code on Windows, you can follow the steps here.

Linux:

Prerequisites

You can follow the steps in Sample Build Guide to install the nessary package in your host PC.

There is a example for loading VizionSDK:

std::string nameOfLib("libVizionSDK.so");
dlopen(nameOfLib.c_str(), RTLD_LAZY);

Camera Capture Function

These functions are responsible for capturing images from a camera.

VcCreateVizionCamDevice

  • Function:
VizionCam* VcCreateVizionCamDevice()
  • Function Description:

    1. This function is used to create an object of the VizionCam class.
    2. This function allocates memory for a new VizionCam object and returns a pointer to it.
  • Parameter Description:

    1. This function does not take any input parameters.
  • Example:

VizionCam* vizion_cam; 
vizion_cam=VcCreateVizionCamDevice();

VcGetVideoDeviceList

  • Function:
int VcGetVideoDeviceList(VizionCam* vizion_cam, std::vector<std::wstring>& devname_list)
  • Function Description:
    1. This function retrieves a list of available video devices and their names, and stores the device names in a vector of wide strings.
※This function needs to be called before using VcOpen to initialize the VizionCam parameters
  • Parameter Description:

    1. vizion_cam: A pointer to a VizionCam instance.
    2. devname_list: A vector of wide strings to store the retrieved device names.
    3. return 0 = PASS, return -1 = FAIL.
  • Example:

// Declare a vector to store the device names
std::vector<std::wstring> devname_list;
// Call the function to retrieve the device names and store them in the vector
VcGetVideoDeviceList(vizion_cam, devname_list);

VcOpen

  • Function:
int VcOpen(VizionCam* vizion_cam, int dev_idx)
  • Function Description:

    1. This function is used to open a VizionCam device specified by the index in the device list obtained by calling VcGetVideoDeviceList().
※This function needs to be called before using any functional program except for VcGetVideoDeviceList.
  • Parameter Description:
    1. vizion_cam: A pointer to the VizionCam object.
    2. list_idx: An integer specifying the index of the device to be opened in the device list.
    3. return 0 = PASS, return -1 = FAIL.
  • Example:
VcOpen(vizion_cam, 0);

VcClose

  • Function:
int VcClose(VizionCam *vizion_cam)
  • Function Description:

    1. This function is used to close the camera device and release any allocated resources.
  • Parameter Description:

    1. vizion_cam: A pointer to the VizionCam object representing the camera device to be closed.
    2. return 0 = PASS, return -1 = FAIL.
  • Example:

VcClose(vizion_cam); // Close the camera device represented by the VizionCam object.

VcGetCaptureFormatList

  • Function:
int VcGetCaptureFormatList(VizionCam *vizion_cam, std::vector<VzFormat> &capformats)
  • Function Description:

    1. This function is used to retrieve the available capture formats of a VizionCam device.

To retrieve the available capture formats of a VizionCam device, first create a vector of VzFormat structures, and then call VcGetCaptureFormatList function passing in the VizionCam object and the vector as parameters

  • Parameter Description:

    1. vizion_cam: A pointer to a VizionCam device object.
    2. capformats: A vector of VzFormat structures. The function will populate this vector with the available capture formats.
    3. VzFormat structures{uint16_t width; uint16_t height; uint16_t framerate};
    4. return 0 = PASS, return -1 = FAIL.
    5. VZ_IMAGE_FORMAT format:
enum VZ_IMAGE_FORMAT {
YUY2,
UYVY,
NV12,
MJPG,
};
  • Example:
std::vector<VzFormat> capfmtlist;
VcGetCaptureFormatList(vizion_cam, capfmtlist); // Get the capture formats list

VcSetCaptureFormat

  • Function:
int VcSetCaptureFormat(VizionCam *vizion_cam, VzFormat capformat)
  • Function Description:

    1. The VcSetCaptureFormat function sets the capture format of the camera to the specified format.
  • Parameter Description:

    1. vizion_cam: A pointer to the VizionCam object.
    2. format: The capture format to be set. The format must be obtained from the VcGetCaptureFormatList function
    3. return 0 = PASS, return -1 = FAIL.
  • Example:

VzFormat format = capfmtlist[0];
VcSetCaptureFormat(vizion_cam, format); // Set the capture format

VcGetRawImageCapture

  • Function:
int VcGetRawImageCapture(VizionCam *vizion_cam, uint8_t *raw_data, int *data_size, uint16_t timeout=2500)
  • Function Description:
    1. This function is used to get a single frame of raw image data. To capture multiple frames, the function should be repeatedly called.

※Note: This function call requires calling VcSetCaptureFormat first.

  • Parameter Description:

    1. vizion_cam: A pointer to the VizionCam object.
    2. raw_data: A pointer to a buffer that stores the raw image data.
    3. data_size: A pointer to an integer that stores the size of the raw image data.
    4. (Option)timeout: The timeout value in milliseconds, default value is 2500 ms.
    5. return 0 = PASS, return -1 = FAIL.
  • Return Values:

    • VZ_SUCCESS = 0
    • VZ_TIMEOUT = -1
    • VZ_CAM_OCCUPIED = -2
    • VZ_FAIL = -3
    • VZ_OTHER_ERROR = -4
    • VZ_BUFFER_CORRUPTED = -5
    • VZ_CAPTURE_FORMAT_ERROR = -6
  • Example:

uint8_t* img_data = new uint8_t[format.width * format.height * 3];
int data_size=0;
VcGetRawImageCapture(vizion_cam, img_data, &data_size, 2500);

VcGetVizionCamDeviceName

  • Function:
int VcGetVizionCamDeviceName(VizionCam *vizion_cam, wchar_t *devname)
  • Function Description:

    1. The function retrieves the device name of the specified VizionCam device.
    2. It is necessary to call VcOpen() before calling this function.
  • Parameter Description:

    1. vizion_cam: A pointer to the VizionCam instance.
    2. devname: A wide character buffer to store the device name string.
    3. return 0 = PASS, return -1 = FAIL.
  • Example:

wchar_t  wchstr[256];
VcGetVizionCamDeviceName(vizion_cam, wchstr);
std::wcout << L"Device Name: " << std::wstring(wchstr) << std::endl;

VcGetUSBFirmwareVersion

  • Function:
int VcGetUSBFirmwareVersion(VizionCam* vizion_cam, char* fw_ver)
  • Function Description:

    1. This function retrieves the firmware version of the connected USB camera.
  • Parameter Description:

    1. vizion_cam: A pointer to the VizionCam structure obtained by calling VcOpen().
    2. fw_ver: A character array to store the firmware version. The array must have a minimum length of 16 bytes.
    3. return 0 = PASS, return -1 = FAIL.
  • Example:

char fw_ver[16];
VcGetUSBFirmwareVersion(vizion_cam, fw_ver);
std::cout << "fw_ver ::"<< fw_ver << std::endl;

VcGetUniqueSensorID

  • Function:
int VcGetUniqueSensorID(VizionCam* vizion_cam, char* sensor_id);
  • Function Description:

    1. The function VcGetUniqueSensorID retrieves the unique sensor ID of the VizionCam device.
  • Parameter Description:

    1. vizion_cam: A pointer to the VizionCam instance obtained through VcOpen function.
    2. sensor_id: A pointer to a character array that receives the unique sensor ID of the VizionCam device.
    3. return 0 = PASS, return -1 = FAIL.
  • Example

char UID[24];
VcGetUniqueSensorID(vizion_cam,UID);

Camera Control Function

These function is responsible for controlling various parameters of the camera.

VcGetAutoExposureMode &VcSetAutoExposureMode

  • Function:
int VcGetAutoExposureMode(VizionCam *vizion_cam, AE_MODE_STATUS &ae_mode)
int VcSetAutoExposureMode(VizionCam *vizion_cam, AE_MODE_STATUS ae_mode)
  • Function Description:

    1. The VcGetAutoExposureMode() function is used to get the current auto exposure mode status of the VizionCam camera
    2. The VcSetAutoExposureMode() function is used to set the auto exposure mode of the camera.
  • Parameter Description:

    1. The first parameter of both functions is a pointer to the VizionCam object representing the camera.
    2. The second parameter of VcGetAutoExposureMode() is a reference to an AE_MODE_STATUS variable that is updated with the current auto exposure mode status of the camera.
    3. The second parameter of VcSetAutoExposureMode() is an AE_MODE_STATUS variable that represents the desired auto exposure mode to be set.
    4. return 0 = PASS, return -1 = FAIL.
enum class AE_MODE_STATUS{
    MANUAL_EXP = 0,
    AUTO_GAIN = 0x9,
    AUTO_EXP = 0xC,
};
  • Explanation of Modes

    • MANUAL_EXP
      Allows manual control over exposure time and gain settings.
    • AUTO_GAIN
      Automatically adjusts the camera's gain to maintain brightness while allowing manual control of the exposure time. This helps keep FPS stable in varying light conditions.
    • AUTO_EXP
      Automatically adjusts both exposure time and gain to ensure balanced exposure across different lighting conditions.
  • Example

AE_MODE_STATUS ae_mode;
ae_mode = AE_MODE_STATUS::MANUAL_EXP;
VcSetAutoExposureMode(vizion_cam, ae_mode);
VcGetAutoExposureMode(vizion_cam, ae_mode);
if (ae_mode == AE_MODE_STATUS::AUTO_EXP) {
    printf("Get AE Mode: AUTO_EXP\n");
} else if (ae_mode == AE_MODE_STATUS::MANUAL_EXP) {
    printf("Get AE Mode: MANUAL_EXP\n");
} else if (ae_mode == AE_MODE_STATUS::AUTO_GAIN) {
    printf("Get AE Mode: AUTO_GAIN\n");
} else {
    printf("Get AE Mode: Unknown Mode\n");
}

VcGetExposureTime&VcSetExposureTime

  • Function:
int VcGetExposureTime(VizionCam* vizion_cam, uint32_t& exptime)
int VcSetExposureTime(VizionCam* vizion_cam, uint32_t exptime)
  • Function Description

    1. VcGetExposureTime() retrieves the current exposure time of the camera and stores it in the exptime variable passed as a reference.
    2. VcSetExposureTime() sets the exposure time of the camera to the specified value in microseconds.
  • Parameter Description

    1. The VizionCam pointer vizion_cam must be initialized and connected to a camera device before calling these functions.
    2. The exposure time must be a value between 1 and 500000 microseconds.
    3. The exptime parameter in VcGetExposureTime() must be a reference to a uint32_t variable that can store the retrieved exposure time value.
    4. return 0 = PASS, return -1 = FAIL.
  • Example

uint32_t exp_time = 0;
VcSetExposureTime(vizion_cam, 13333); // Set exp time 5000 us.  Range: 1 ~ 500000 us
VcGetExposureTime(vizion_cam, exp_time);
printf("Get AE Exposure Time: %d us\n", exp_time);

VcGetExposureGain &VcSetExposureGain

  • Function:
int VcSetExposureGain(VizionCam *vizion_cam, uint8_t expgain)
int VcGetExposureGain(VizionCam *vizion_cam, uint8_t &expgain)
  • Function Description:

    1. The VcSetExposureGain function is used to set the camera's exposure gain value.
    2. The exposure gain controls the amplification of the signal that the camera receives, allowing the camera to adjust the brightness of the image.
    3. The VcGetExposureGain function, on the other hand, retrieves the current exposure gain value of the camera.
  • Parameter Description

    1. Both functions take the VizionCam object and a parameter for the exposure gain value as input.
    2. The VcSetExposureGain function takes an unsigned integer value between 1 and 64, representing the exposure gain multiplied by 1x to 64x.
    3. The VcGetExposureGain function takes an unsigned integer reference as input, which will store the retrieved exposure gain value.
    4. return 0 = PASS, return -1 = FAIL.
  • Example

uint8_t exp_gain = 0;
VcSetExposureGain(vizion_cam, 3); // Set exp gain 3x.   Range: 1x ~ 64x
VcGetExposureGain(vizion_cam, exp_gain);
printf("Get Exp Gain: %d\n", exp_gain);

VcGetMaxFPS &VcSetMaxFPS

  • Function:
int VcSetMaxFPS(VizionCam *vizion_cam, uint8_t max_fps)
int VcGetMaxFPS(VizionCam *vizion_cam, uint8_t &max_fps)
  • Function Description:

    1. The VcSetMaxFPS and VcGetMaxFPS APIs allow the user to set and retrieve the maximum frame rate supported by the camera.
    2. The maximum frame rate represents the upper limit for the number of frames that can be captured per second.
  • Parameter Description:

    1. The VcSetMaxFPS API takes two parameters: a pointer to a VizionCam structure and the maximum frame rate value in frames per second (fps) that needs to be set. The fps value should be between 1 and 255.
    2. The VcGetMaxFPS API also takes two parameters: a pointer to a VizionCam structure and a reference to an unsigned 8-bit integer variable. Upon successful execution, the maximum frame rate value is stored in the variable referenced by the second parameter.
    3. return 0 = PASS, return -1 = FAIL.
  • Example:

uint8_t max_fps = 0;
max_fps = 120;
VcSetMaxFPS(vizion_cam, max_fps); // Set max fps
VcGetMaxFPS(vizion_cam, max_fps);
printf("Get Max FPS: %d\n", max_fps);

VcGetAutoWhiteBalanceMode &VcSetAutoWhiteBalanceMode

  • Function:
int VcGetAutoWhiteBalanceMode(VizionCam *vizion_cam, AWB_MODE_STATUS &awb_mode)
int VcSetAutoWhiteBalanceMode(VizionCam *vizion_cam, AWB_MODE_STATUS awb_mode)
  • Function Description:

    1. The VcGetAutoWhiteBalanceMode function gets the current automatic white balance mode of the camera, which can be one of the following options:

      MANUAL_TEMPERATURE_WB: Manual white balance using color temperature.

      AUTO_WB: Automatic white balance.

    2. The VcSetAutoWhiteBalanceMode function sets the automatic white balance mode of the camera to the specified value.

  • Parameter Description:

    1. vizion_cam: A pointer to a VizionCam object representing the camera.
    2. awb_mode: A reference to an AWB_MODE_STATUS variable that will hold the white balance mode. This parameter is both an input and an output parameter.
    3. return 0 = PASS, return -1 = FAIL.
enum class AWB_MODE_STATUS{ 
MANUAL_TEMPERATURE_WB = 0x7, 
AUTO_WB = 0xF,
};
  • Example:
AWB_MODE_STATUS awb_mode;
awb_mode = AWB_MODE_STATUS::MANUAL_TEMPERATURE_WB;
VcSetAutoWhiteBalanceMode(vizion_cam, awb_mode);
VcGetAutoWhiteBalanceMode(vizion_cam, awb_mode);

VcGetTemperature &VcSetTemperature

  • Function:
int VcSetTemperature(VizionCam *vizion_cam, uint16_t temp)
int VcGetTemperature(VizionCam *vizion_cam, uint16_t &temp)
  • Function Description
    1. The VcSetTemperature function is used to set the white balance temperature of a VizionCam. The function takes a pointer to a VizionCam object and the desired temperature in Kelvin as input parameters. The function sets the white balance temperature of the camera to the specified value.
    2. The VcGetTemperature function is used to get the current white balance temperature of a VizionCam. The function takes a pointer to a VizionCam object and a reference to a variable that will store the temperature as input parameters. The function returns the current white balance temperature of the camera.
  • Parameter Description
    1. vizion_cam: A pointer to a VizionCam object.
    2. temp: The desired white balance temperature in Kelvin. Valid range is 2300K to 15000K.
    3. return 0 = PASS, return -1 = FAIL.
  • Example:
uint16_t wb_temp = 0;
VcSetTemperature(vizion_cam, 6500);  // Set wb temperature 6500.   Range: 2300 ~ 15000K
VcGetTemperature(vizion_cam, wb_temp);
printf("Get WB Temperature: %d\n", wb_temp);

VcGetFlipMode&VcSetFlipMode

  • Function:
int VcGetFlipMode(VizionCam* vizion_cam, FLIP_MODE& flip)

int VcSetFlipMode(VizionCam* vizion_cam, FLIP_MODE flip)
  • Function Description:
    1. The VcGetFlipMode function retrieves the current flip mode of a VizionCam instance and stores the result in the FLIP_MODE variable passed as an argument.
    2. The VcSetFlipMode function sets the flip mode of a VizionCam instance to the FLIP_MODE passed as an argument.
  • Parameter Description:
    1. vizion_cam: a pointer to a VizionCam instance.
    2. flip: a reference to a FLIP_MODE variable.
    3. The VcGetFlipMode function stores the current flip mode in this variable
    4. The VcSetFlipMode function sets the flip mode to the value passed in this variable.
    5. FLIP_MODE: an enumeration that defines the flip modes supported by the VizionCam library.
    6. return 0 = PASS, return -1 = FAIL.
enum class FLIP_MODE{
FLIP_NORMAL = 0, 
FLIP_H_MIRROR,
FLIP_V_MIRROR,
FLIP_ROTATE_180,
};
  • Example:
// Set the flip mode to vertical mirror.
VcSetFlipMode(vizion_cam, FLIP_V_MIRROR);
// Get the current flip mode.
FLIP_MODE flip_mode;
VcGetFlipMode(vizion_cam, flip_mode);
printf("Current flip mode: %d\n", (int)flip_mode);

VcGetEffectMode &VcSetEffectMode

  • Function:
int VcGetEffectMode(VizionCam* vizion_cam, EFFECT_MODE& effect)
int VcSetEffectMode(VizionCam* vizion_cam, EFFECT_MODE effect)
  • Function Description:

    1. The VcGetEffectMode() function gets the current effect mode of the camera, while the VcSetEffectMode() function sets the effect mode of the camera.
    2. The effect mode can be used to change the appearance of the camera image, such as making it black and white or negative.
  • Parameter Description:

    1. vizion_cam: a pointer to the VizionCam object representing the camera
    2. effect: a reference to the EFFECT_MODE enum that will be used to get or set the effect mode
    3. return 0 = PASS, return -1 = FAIL.
enum class EFFECT_MODE{
NORMAL_MODE = 0x00,
BLACK_WHITE_MODE= 0x03,
GRAYSCALE_MODE = 0x06, 
NEGATIVE_MODE = 0x07, 
SKETCH_MODE = 0x0F,
};
  • Example:
EFFECT_MODE effect_mode = EFFECT_MODE::GRAYSCALE_MODE;
VcSetEffectMode(vizion_cam, effect_mode);
VcGetEffectMode(vizion_cam, effect_mode);
printf("Current Effect Mode: %d\n", effect_mode);

VcGetGamma &VcSetGamma

  • Function:
int VcGetGamma(VizionCam* vizion_cam, double& gamma)
int VcSetGamma(VizionCam* vizion_cam, double gamma)
  • Function Description:

    1. The VcGetGamma and VcSetGamma functions are used to get and set the gamma correction value for the VizionCam. Gamma correction is a technique used to adjust the brightness levels of an image to compensate for differences in the way that cameras capture light compared to how the human eye perceives it.
    2. A gamma value of 1.0 is considered "linear", meaning that the brightness values in the image are represented exactly as they were captured by the camera. A gamma value greater than 1.0 will result in darker shadows and brighter highlights, while a gamma value less than 1.0 will result in brighter shadows and darker highlights.
  • Parameter Description:

    1. vizion_cam: A pointer to a VizionCam object that represents the camera to which the gamma value will be applied.
    2. gamma: A double-precision floating point value that represents the desired gamma correction value. The range of valid values is from 0.0 to 2.5, with a default value of 1.0.
    3. return 0 = PASS, return -1 = FAIL.
  • Example:

double gamma = 0.0;
VcSetGamma(vizion_cam, 1.5);  // Set gamma 1.5   Range: 0.0 ~ 2.5
VcGetGamma(vizion_cam, gamma);
printf("Get Gamma: %.4f\n", gamma);

VcGetSaturation &VcSetSaturation

  • Function:
int VcGetSaturation(VizionCam* vizion_cam, double& saturation)
int VcSetSaturation(VizionCam* vizion_cam, double saturation)
  • Function Description:

    1. The functions VcGetSaturation and VcSetSaturation are used to get and set the saturation level of the image captured by the VizionCam.
  • Parameter Description:

    1. vizion_cam: a pointer to the VizionCam object.

    2. saturation: a reference to a variable to store/get the saturation level. The value of saturation ranges from 0.0 to 2.0, with a default value of 1.0.

    3. return 0 = PASS, return -1 = FAIL.

  • Example:

double saturation = 0.0;
VcSetSaturation(vizion_cam, 1.5);  // Set Saturatoin 1.5   Range: 0.0 ~ 2.0
VcGetSaturation(vizion_cam, saturation);
printf("Get Saturation: %.4f\n", saturation);

VcGetContrast&VcSetContrast

  • Function:
int VcGetContrast(VizionCam* vizion_cam, double& contrast)
int VcSetContrast(VizionCam* vizion_cam, double contrast)
  • Function Description:
    1.VcGetContrast: Get the current contrast value of the camera.
    2.VcSetContrast: Set the contrast value of the camera.

  • Parameter Description:
    1.vizion_cam: A pointer to the VizionCam object.
    2.contrast: A reference to a double variable that holds the contrast value.Range: -5.0 to 5.0.
    3.return 0 = PASS, return -1 = FAIL.

  • Example:

double contrast = 0.0;
VcSetContrast(vizion_cam, -2.0);
VcGetContrast(vizion_cam, contrast);
printf("Get Contrast: %.4f\n", contrast);

VcGetSharpening& VcSetSharpening

  • Function:
int VcGetSharpening(VizionCam* vizion_cam, double& sharpness)
int VcSetSharpening(VizionCam* vizion_cam, double sharpness)
  • Function Description:
    1. The VcGetSharpening function retrieves the current sharpness level of the VizionCam, while the VcSetSharpening function sets the sharpness level of the VizionCam.
    2. Sharpness is a measure of the clarity of details in an image. Increasing sharpness enhances the edge contrast of the image, making it appear clearer and more defined, while decreasing sharpness can have the opposite effect, making the image appear softer and less detailed.
  • Parameter Description:
    1. vizion_cam: A pointer to the VizionCam object.
      sharpness: A double-precision floating-point variable that holds the current or desired sharpness level.
    2. The valid range of sharpness values is from -2.0 to 2.0, where negative values decrease sharpness and positive values increase it.
    3. return 0 = PASS, return -1 = FAIL.
  • Example:
double sharpening = 0.0;
VcSetSharpening(vizion_cam, -1.5);  // Set Sharpening 1.5   Range: -2.0 ~ 2.0
VcGetSharpening(vizion_cam, sharpening);
printf("Get harpening: %.4f\n", sharpening);

VcGetDenoise&VcSetDenoise

  • Function:
int VcGetDenoise(VizionCam* vizion_cam, double& denoise)
int VcSetDenoise(VizionCam* vizion_cam, double denoise)
  • Function Description:
    1.The functions VcGetDenoise and VcSetDenoise are used to get and set the level of denoising applied to the image captured by the VizionCam device.
  • Parameter Description:
    1.vizion_cam: A pointer to a VizionCam object representing the camera device.
    denoise:
    2.A reference to a double variable that will be used to get or set the level of denoising. The value is in the range of -2.0 to 2.0, where a negative value indicates that the denoising effect is applied to the image.
    3.return 0 = PASS, return -1 = FAIL.
  • Example:
double denoise = 0.0;
VcSetDenoise(vizion_cam, -1.5);  // Set Denoise 1.5   Range: -2.0 ~ 2.0
VcGetDenoise(vizion_cam, denoise);
printf("Get Denoise: %.4f\n", denoise);

VcGetDigitalZoomType&VcSetDigitalZoomType

  • Function:
int VcGetDigitalZoomType(VizionCam* vizion_cam, DZ_MODE_STATUS& zoom_type)
int VcSetDigitalZoomType(VizionCam* vizion_cam, DZ_MODE_STATUS zoom_type)
  • Function Description:
    1.These functions are used to get and set the digital zoom mode of a VizionCam object. The digital zoom mode can be set to either DZ_FAST or DZ_SMOOTH.
  • Parameter Description:
    1.vizion_cam: a pointer to the VizionCam object
    2.zoom_type: a reference to a DZ_MODE_STATUS variable, which is an enumeration type representing the digital zoom mode. It can be either DZ_FAST or DZ_SMOOTH.
    3.return 0 = PASS, return -1 =FAIL.
    4. DZ_MODE_STATUS:
enum class DZ_MODE_STATUS
{
DZ_IMMEDIATE = 0x8000,
DZ_SLOW = 0x0040,
DZ_FAST = 0x0200,
};
  • Example:
DZ_MODE_STATUS dz_mode;
dz_mode = DZ_MODE_STATUS::DZ_FAST;
VcSetDigitalZoomType(vzcam, dz_mode);
VcGetDigitalZoomType(vzcam, dz_mode);

VcGetDigitalZoomTarget&VcSetDigitalZoomTarget

  • Function:
int VcGetDigitalZoomTarget(VizionCam* vizion_cam, double& times)
int VcSetDigitalZoomTarget(VizionCam* vizion_cam, double times)
  • Function Description:
    1.The functions VcGetDigitalZoomTarget() and VcSetDigitalZoomTarget() are used to get and set the digital zoom target factor, respectively. The digital zoom target factor is the factor by which the camera image is zoomed in, i.e., the target zoom factor.
  • Parameter Description:
    1.VizionCam* vizion_cam: Pointer to a VizionCam object that represents the camera.
    2. times: Reference to a double variable that will be used to store the digital zoom target factor.
    3.return 0 = PASS, return -1 = FAIL.
  • Example:
double dz_tgt;
VcGetDigitalZoomTarget(vizion_cam, dz_tgt);
printf("Get Digital Zoom Target: %f ms\n", dz_tgt);

VcGetDigitalZoom_CT_X&VcGetDigitalZoom_CT_Y &VcSetDigitalZoom_CT_X&VcSetDigitalZoom_CT_Y

  • Function:
int VcGetDigitalZoom_CT_X(VizionCam* vizion_cam, double& ct_x)
int VcSetDigitalZoom_CT_X(VizionCam* vizion_cam, double ct_x)
int VcGetDigitalZoom_CT_Y(VizionCam* vizion_cam, double& ct_y)
int VcSetDigitalZoom_CT_Y(VizionCam* vizion_cam, double ct_y)
  • Function Description:
    1.VcGetDigitalZoom_CT_X: This function is used to get the X coordinate of the center point of the digital zoom window.
    2.VcSetDigitalZoom_CT_X: This function is used to set the X coordinate of the center point of the digital zoom window.
    3.VcGetDigitalZoom_CT_Y: This function is used to get the Y coordinate of the center point of the digital zoom window.
    4.VcSetDigitalZoom_CT_Y: This function is used to set the Y coordinate of the center point of the digital zoom window.
  • Parameter Description:
    1.vizion_cam: A pointer to a VizionCam structure that represents the camera device.
    2.ct_x: A reference to a double variable that will be used to store the X coordinate of the center point of the digital zoom window.
    3.ct_y: A reference to a double variable that will be used to store the Y coordinate of the center point of the digital zoom window.
    4.return 0 = PASS, return -1 = FAIL.
  • Example:
double dz_ct_x, dz_ct_y;
VcGetDigitalZoom_CT_X(vizion_cam, dz_ct_x);
printf("Get Digital Zoom CT_X: %f\n", dz_ct_x);
VcGetDigitalZoom_CT_Y(vizion_cam, dz_ct_y);
printf("Get Digital Zoom CT_Y: %f\n", dz_ct_y);
VcSetDigitalZoom_CT_X(vizion_cam, 0.5);
VcSetDigitalZoom_CT_Y(vizion_cam, 0.5);

VcGetBacklightCompensation&VcSetBacklightCompensation

  • Function:
int VcGetBacklightCompensation(VizionCam* vizion_cam, double& ae_comp)
int VcSetBacklightCompensation(VizionCam* vizion_cam, double ae_comp)
  • Function Description:
    1.VcGetBacklightCompensation:This function retrieves the current backlight compensation setting of a VizionCam device. Backlight compensation is a feature that adjusts the exposure in scenes where the background is significantly brighter than the subject of the image, thus preventing the subject from appearing in shadow.
    2.VcSetBacklightCompensation: This function sets the backlight compensation level for a VizionCam device. Adjusting this setting can help to balance the exposure in challenging lighting conditions, ensuring that the subject of the image is neither too dark nor overexposed.

  • Parameter Description:
    1.vizion_cam: A pointer to the VizionCam object.

    2.ae_comp: A reference to a double variable to store the backlight compensation value.
    3.return 0 = PASS, return -1 = FAIL.

  • Example:

// Get the current backlight compensation value
double ae_comp;
VcGetBacklightCompensation(vizion_cam, ae_comp);
printf("Backlight compensation value: %.2f\n", ae_comp);
// Set the backlight compensation value to 1.5
VcSetBacklightCompensation(vizion_cam, 1.5);

VcGetJpegQual&VcSetJpegQual

  • Function:
int VcGetJpegQual(VizionCam *vizion_cam, uint8_t &qual);
int VcSetJpegQual(VizionCam *vizion_cam, uint8_t qual);
  • Function Description:
    1.VcGetJpegQual: Retrieves the current JPEG quality setting of the camera and stores it in the qual variable passed as a reference.
    2.VcSetJpegQual: Sets the JPEG quality of the camera to the specified value.
  • Parameter Description:
    1.vizion_cam: A pointer to the VizionCam object.
    2.qual: A reference to a uint8_t variable to store the JPEG quality value.
    3.return 0 = PASS, return -1 = FAIL.
  • Example:
// Get the current JPEG quality value
uint8_t qual = 0;
VcGetJpegQual(vizion_cam, qual);
printf("Backlight compensation value: %.d\n", qual);
// Set the JPEG quality value to 80
VcSetJpegQual(vizion_cam, 80);

VcGetThroughPut&VcSetThroughPut

  • Function:
int VcGetThroughput(VizionCam *vizion_cam, uint16_t &throughput);
int VcSetThroughput(VizionCam *vizion_cam, uint16_t throughput);
  • Function Description:
    1.VcGetThroughPut: Retrieves the current throughput setting of the camera and stores it in the throughput variable passed as a reference.
    2.VcSetThroughPut: Sets the throughput of the camera to the specified value.
  • Parameter Description:
    1.vizion_cam: A pointer to the VizionCam object.
    2.throughput: A reference to a uint16_t variable to store the throughput value.
    3.return 0 = PASS, return -1 = FAIL.
  • Example:
// Get the current throughput value
uint16_t throughput = 0;
VcGetThroughPut(vizion_cam, throughput);
printf("Throughput value: %.d\n", throughput);
// Set the throughput value to 100
VcSetThroughPut(vizion_cam, 100);

VcRecoverDefaultSetting

  • Function:
int VcRecoverDefaultSetting(VizionCam* vizion_cam)
  • Function Description:
    1.The function VcRecoverDefaultSetting() is used to recover the default settings of the camera device.
    2.This function resets all camera settings to their default values.

  • Parameter Description:
    1.The VizionCam* vizion_cam parameter is a pointer to the camera device that needs to recover its default settings.
    2.return 0 = PASS, return -1 = FAIL.

  • Example:

// Recover the default settings of the camera device
VcRecoverDefaultSetting(vizion_cam);

VcLoadProfileSettingFromPath

  • Function:
int VcLoadProfileSettingFromPath(VizionCam* vizion_cam, const char* profile_path)
  • Function Description:
    1The VcLoadProfileSettingFromPath function is used to load camera settings from a JSON file located at a specified path and apply those settings to the camera.
  • Parameter Description:
    1.vizion_cam: A pointer to the VizionCam object.
    2.profile_path: profile_path: The path of the JSON file containing the profile settings.
    3.return 0 = PASS, return -1 = FAIL.
  • Example:
const char* profile_path = "/usr/local/bin/Profile.json";
std::ifstream file(profile_path);
VcLoadProfileSettingFromPath(vizion_cam, profile_path);

VcLoadProfileSetting

  • Function:
int VcLoadProfileSetting(VizionCam* vizion_cam, const char* profile_string)
  • Function Description:
    1.The function VcLoadProfileSetting loads camera settings from a JSON-formatted string and applies them to the specified VizionCam instance.
  • Parameter Description:
    1.vizion_cam: A pointer to the VizionCam instance to which the settings should be applied.
    2.profile_string: A pointer to a null-terminated string containing the JSON-formatted camera settings to be loaded.
    3.return 0 = PASS, return -1 = FAIL.
  • Example:
const char* profile_path = "/usr/local/bin/Profile.json";
std::ifstream file(profile_path);
if (!file.is_open()) {
     std::cerr << "Failed to open file: " << profile_path << std::endl;
     return -1;
 }
std::string profile_str((std::istreambuf_iterator<char>(file)),
std::istreambuf_iterator<char>());
std::cout << "profile_str.c_str():::" << profile_str.c_str() << std::endl;
int ret = VcLoadProfileSetting(vizion_cam, profile_str.c_str());
if (ret != 0) {
     std::cerr << "Failed to load profile from string" << std::endl;
     return -1;
}

VcSetProfileControlConfig

  • Function:
int VcSetProfileControlConfig(VizionCam* vizion_cam)
  • Function Description:
    1.The VcSetProfileControlConfig function is used to apply the camera control configuration settings stored in the current profile to the connected VizionCam object.
  • Parameter Description:
    1.vizion_cam: A pointer to the VizionCam object that has been initialized and connected to a physical camera device.
    2.return 0 = PASS, return -1 = FAIL.
  • Example:
    To use the VcSetProfileControlConfig function, you must first load the profile settings using either VcLoadProfileSetting or VcLoadProfileSettingFromPath. Once the profile settings have been loaded, call the VcSetProfileControlConfig function to apply the settings to the connected VizionCam object.
VcSetProfileControlConfig(vizion_cam);

VcGotoSaveOSPProfile

  • Function:
int VcGotoSaveOSPProfile(VizionCam *vizion_cam, uint8_t check)
  • Function Description:
    1.The VcGotoSaveOSPProfile function is to store the current ISP parameters into EEPROM.

  • Parameter Description:
    1.vizion_cam: A pointer to the VizionCam object that has been initialized and connected to a physical camera device.
    2.check: Profile check flag.

    • 0: Disable 1: Enable, but don't write OSP 2: Enable, write OSP by controller

    3.return 0 = PASS, return -1 = FAIL.

  • Example:

uint8_t  check = 2 ;
VcGotoSaveOSPProfile(vizion_cam, check);

VcGetOSPProfileConfig

  • Function:
int VcGetOSPProfileConfig(VizionCam *vizion_cam, std::string &profile_str)
  • Function Description:
    1.The VcGetOSPProfileConfig function is used to retrieves the OSP profile configuration and saves it to the provided string.
  • Parameter Description:
    1.vizion_cam: A pointer to the VizionCam object that has been initialized and connected to a physical camera device.
    2.profile_str: a reference to a string where the profile configuration will be saved.
    3.return 0 = PASS, return -1 = FAIL.
  • Example:
std::string profile_str;
VcGetOSPProfileConfig(vizion_cam, profile_str);

VcCheckOSPProfile

  • Function:
int VcCheckOSPProfile(VizionCam *vizion_cam)
  • Function Description:
    1.The VcCheckOSPProfile function is used to Retrieve the value of profile check flag.
  • Parameter Description:
    1.vizion_cam: A pointer to the VizionCam object that has been initialized and connected to a physical camera device.
    2.return 0 = Disable, return 1 = Enable, but don't write OSP, return 2 = Enable, write OSP by controller, return -1 = FAIL.
  • Example:
int profile_check;
profile_check = VcCheckOSPProfile(vizion_cam);

Was this article helpful?