Skip to main content

Camera Information

Introduction

These functions are retrieving the information from the camera device.

VxGetUSBFirmwareVersion

Function:

int VxGetUSBFirmwareVersion(std::shared_ptr<VxCamera> vxcam, std::string& fwVer)

Function Description:

  • This function retrieves the firmware version of the connected USB camera.

Parameter Description:

  • vxcam : A pointer shared ownership of a camera obtained from VxInitialCameraDevice().
  • fwVer : A string to store the firmware version.
  • Return:
    • return 0 = PASS, return -1 = FAIL
    • Python : tuple(return_code, fwVer)

      return_code : return 0 = PASS, return -1 = FAIL

Example:

std::string fwVer;
// get the version of USB device firmware
VxGetUSBFirmwareVersion(vxcam, fwVer);

VxGetTEVSFirmwareVersion

Function:

int VxGetTEVSFirmwareVersion(std::shared_ptr<VxCamera> vxcam, std::string& fwVer)

Function Description:

  • This function retrieves the firmware version of the connected TEVS camera.

Parameter Description:

  • vxcam : A pointer shared ownership of a camera obtained from VxInitialCameraDevice().
  • fwVer : A string to store the firmware version.
  • Return:
    • return 0 = PASS, return -1 = FAIL
    • Python : tuple(return_code, fwVer)

      return_code : return 0 = PASS, return -1 = FAIL

Example:

std::string fwVer;
// get the version of TEVS device firmware
VxGetTEVSFirmwareVersion(vxcam, fwVer);

VxGetSensorUniqueID

Function:

int VxGetSensorUniqueID(std::shared_ptr<VxCamera> vxcam, std::string& uniqueId)

Function Description:

  • This function is used to retrieve the unique ID from the sensor.

Parameter Description:

  • vxcam : A pointer shared ownership of a camera obtained from VxInitialCameraDevice().
  • uniqueId : A string to store the sensor ID.
  • Return:
    • return 0 = PASS, return -1 = FAIL
    • Python : tuple(return_code, uniqueId)

      return_code : return 0 = PASS, return -1 = FAIL

Example:

std::string uniqueId;
// get the sensor id
VxGetSensorUniqueID(vxcam, uniqueId);

VxGetSensorFirmwareVersion

Function:

int VxGetSensorFirmwareVersion(std::shared_ptr<VxCamera> vxcam, std::string& fwVer)

Function Description:

  • This function is used to retrieve the firmware version from the sensor.

Parameter Description:

  • vxcam : A pointer shared ownership of a camera obtained from VxInitialCameraDevice().
  • fwVer : A string to store the firmware version.
  • Return:
    • return 0 = PASS, return -1 = FAIL
    • Python : tuple(return_code, fwVer)

      return_code : return 0 = PASS, return -1 = FAIL

Example:

std::string fwVer;
// get the firmware version
VxGetSensorFirmwareVersion(vxcam, fwVer);

VxFlashProductInfo

Function:

int VxFlashProductInfo(std::shared_ptr<VxCamera> vxcam, std::string imgPath)

Function Description:

  • This function updates the device’s product information section by flashing new data from the specified image file.
warning

This function is supported only on VCS/VCM/TEVS/TEVM cameras.

Parameter Description:

  • vxcam : A pointer shared ownership of a camera obtained from VxInitialCameraDevice().
  • imgPath : A string constants of file path to the image that contains the product information data to be flashed to the device.
  • Return: return 0 = PASS, return -1 = FAIL

Example:

std::string imgPath = "IMG_PATH";
// flash product information section
VxFlashProductInfo(vxcam, imgPath);

VxWriteIntrinsics

Function:

int VxWriteIntrinsics(std::shared_ptr<VxCamera> vxcam, VxIntrinsics intrinsics)

Function Description:

  • This function writes camera intrinsic parameters to the device, updating the internal calibration data used for image processing and geometric correction.
warning

This function is supported only on TEVM/TEVS cameras.

Parameter Description:

  • vxcam : A pointer shared ownership of a camera obtained from VxInitialCameraDevice().

  • intrinsics: A VxIntrinsics structure that contains the camera intrinsic calibration parameters to be written to the device, including image resolution, focal lengths, principal point, distortion model, and distortion coefficients.

  • Return: return 0 = PASS, return -1 = FAIL

  • VxIntrinsics structures:

    • w, h: Image width and height in pixels.
    • fx, fy: Focal lengths along the horizontal (U) and vertical (V) axes.
    • cx, cy: Principal point coordinates along the horizontal (U) and vertical (V) axes.
    • model: Distortion model used by the camera.
    • coeffs: Distortion coefficients (k1–k3, r1, r2).
    struct VxIntrinsics {
    int w;
    int h;
    float fx;
    float fy;
    float cx;
    float cy;
    VX_DISTORTION_MODEL model;
    float coeffs[5];
    }
  • VX_DISTORTION_MODEL format:

    enum class VX_DISTORTION_MODEL {
    VX_DIST_NONE,
    VX_DIST_MODEL_RADTAN
    }

Example:

VxIntrinsics intrinsics;
// Fill in the intrinsic parameters with your own calibration values
// before calling the function.
VxWriteIntrinsics(vxcam, intrinsics);

VxGetIntrinsics

Function:

int VxGetIntrinsics(std::shared_ptr<VxCamera> vxcam, VxIntrinsics& intrinsics)

Function Description:

  • This function retrieves the camera intrinsic parameters from the device.
warning

This function is supported only on TEVM/TEVS cameras.

Parameter Description:

  • vxcam : A pointer shared ownership of a camera obtained from VxInitialCameraDevice().

  • intrinsics: A VxIntrinsics structure that will be populated with the camera's intrinsic calibration parameters, including image resolution, focal lengths, principal point, distortion model, and distortion coefficients.

  • Return:

    • return 0 = PASS, return -1 = FAIL
    • Python : tuple(return_code, intrinsics)

      return_code : return 0 = PASS, return -1 = FAIL

  • VxIntrinsics structures:

    • w, h: Image width and height in pixels.
    • fx, fy: Focal lengths along the horizontal (U) and vertical (V) axes.
    • cx, cy: Principal point coordinates along the horizontal (U) and vertical (V) axes.
    • model: Distortion model used by the camera.
    • coeffs: Distortion coefficients (k1–k3, r1, r2).
    struct VxIntrinsics {
    int w;
    int h;
    float fx;
    float fy;
    float cx;
    float cy;
    VX_DISTORTION_MODEL model;
    float coeffs[5];
    }
  • VX_DISTORTION_MODEL format:

    enum class VX_DISTORTION_MODEL {
    VX_DIST_NONE,
    VX_DIST_MODEL_RADTAN
    }

Example:

VxIntrinsics intrinsics;
VxGetIntrinsics(vxcam, intrinsics);