Camera Information
Introduction
These functions are retrieving the information from the camera device.
VxGetUSBFirmwareVersion
Function:
- C++
- Python
- C#
- C
int VxGetUSBFirmwareVersion(std::shared_ptr<VxCamera> vxcam, std::string& fwVer)
def VxGetUSBFirmwareVersion(vxcam)
int VxGetUSBFirmwareVersion(VxCamera vxcam, ref string fwVer)
int vx_get_usb_firmware_version(vx_camera vxcam, const char** 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:
- C++
- Python
- C#
- C
std::string fwVer;
// get the version of USB device firmware
VxGetUSBFirmwareVersion(vxcam, fwVer);
# get the version of USB device firmware
result, fwVer = pyvizionsdk.VxGetUSBFirmwareVersion(vxcam)
string fwVer = "";
// get the version of USB device firmware
CSVizionSDK.VxGetUSBFirmwareVersion(vxcam, ref fwVer);
const char* fwVer;
// get the version of USB device firmware
vx_get_usb_firmware_version(vxcam, &fwVer);
VxGetTEVSFirmwareVersion
Function:
- C++
- Python
- C#
- C
int VxGetTEVSFirmwareVersion(std::shared_ptr<VxCamera> vxcam, std::string& fwVer)
def VxGetTEVSFirmwareVersion(vxcam)
int VxGetTEVSFirmwareVersion(VxCamera vxcam, ref string fwVer)
int vx_get_tevs_firmware_version(vx_camera vxcam, const char** 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:
- C++
- Python
- C#
- C
std::string fwVer;
// get the version of TEVS device firmware
VxGetTEVSFirmwareVersion(vxcam, fwVer);
# get the version of TEVS device firmware
result, fwVer = pyvizionsdk.VxGetTEVSFirmwareVersion(vxcam)
string fwVer = "";
// get the version of TEVS device firmware
CSVizionSDK.VxGetTEVSFirmwareVersion(vxcam, ref fwVer);
const char* fwVer;
// get the version of TEVS device firmware
vx_get_tevs_firmware_version(vxcam, &fwVer);
VxGetSensorUniqueID
Function:
- C++
- Python
- C#
- C
int VxGetSensorUniqueID(std::shared_ptr<VxCamera> vxcam, std::string& uniqueId)
def VxGetSensorUniqueID(vxcam)
int VxGetSensorUniqueID(VxCamera vxcam, ref string uniqueId)
int vx_get_sensor_unique_id(vx_camera vxcam, const char** 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:
- C++
- Python
- C#
- C
std::string uniqueId;
// get the sensor id
VxGetSensorUniqueID(vxcam, uniqueId);
# get the sensor id
result, uniqueId = pyvizionsdk.VxGetSensorUniqueID(vxcam)
print("Sensor unique ID:", uniqueId)
print("Return code:", result)
string uniqueId = "";
// get the sensor id
CSVizionSDK.VxGetSensorUniqueID(vxcam, ref uniqueId);
const char* uniqueId;
// get the sensor id
vx_get_sensor_unique_id(vxcam, &uniqueId);
VxGetSensorFirmwareVersion
Function:
- C++
- Python
- C#
- C
int VxGetSensorFirmwareVersion(std::shared_ptr<VxCamera> vxcam, std::string& fwVer)
def VxGetSensorFirmwareVersion(vxcam)
int VxGetSensorFirmwareVersion(VxCamera vxcam, ref string fwVer)
int vx_get_sensor_firmware_version(vx_camera vxcam, const char** 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:
- C++
- Python
- C#
- C
std::string fwVer;
// get the firmware version
VxGetSensorFirmwareVersion(vxcam, fwVer);
# get the sensor id
result, fwVer = pyvizionsdk.VxGetSensorFirmwareVersion(vxcam)
string fwVer = "";
// get the firmware version
CSVizionSDK.VxGetSensorFirmwareVersion(vxcam, ref fwVer);
const char* fwVer;
// get the firmware version
vx_get_sensor_firmware_version(vxcam, &fwVer);
VxFlashProductInfo
Function:
- C++
- Python
- C#
- C
int VxFlashProductInfo(std::shared_ptr<VxCamera> vxcam, std::string imgPath)
def VxFlashProductInfo(vxcam, imgPath)
int VxFlashProductInfo(VxCamera vxcam, string imgPath)
int vx_flash_product_info(vx_camera vxcam, const char* img_path)
Function Description:
- This function updates the device’s product information section by flashing new data from the specified image file.
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:
- C++
- Python
- C#
- C
std::string imgPath = "IMG_PATH";
// flash product information section
VxFlashProductInfo(vxcam, imgPath);
# flash product information section
imgPath = "IMG_PATH"
pyvizionsdk.VxFlashProductInfo(vxcam, imgPath)
string imgPath = "IMG_PATH";
// flash product information section
CSVizionSDK.VxFlashProductInfo(vxcam, imgPath);
const char* imgPath = "IMG_PATH";
// flash product information section
vx_flash_product_info(vxcam, imgPath);
VxWriteIntrinsics
Function:
- C++
- Python
- C#
- C
int VxWriteIntrinsics(std::shared_ptr<VxCamera> vxcam, VxIntrinsics intrinsics)
def VxWriteIntrinsics(vxcam, intrinsics)
int VxWriteIntrinsics(VxCamera vxcam, VxIntrinsics intrinsics)
int vx_write_intrinsics(vx_camera vxcam, vx_intrinsics intrinsics)
Function Description:
- This function writes camera intrinsic parameters to the device, updating the internal calibration data used for image processing and geometric correction.
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).
- C++
- Python
- C#
- C
struct VxIntrinsics {
int w;
int h;
float fx;
float fy;
float cx;
float cy;
VX_DISTORTION_MODEL model;
float coeffs[5];
}class VxIntrinsics:
def __init__(self, w, h, fx, fy, cx, cy, model, coeffs):
self.w = w
self.h = h
self.fx = fx
self.fy = fy
self.cx = cx
self.cy = cy
self.model = model
self.coeffs = coeffspublic struct VxIntrinsics {
public int x;
public int h;
public float fx;
public float fy;
public float cx;
public float cy;
public VX_DISTORTION_MODEL model;
public float[] coeffs;
}typedef struct vx_intrinsics {
int w;
int h;
float fx;
float fy;
float cx;
float cy;
vx_distortion_model model;
float coeffs[5];
} vx_intrinsics; -
VX_DISTORTION_MODEL format:
- C++
- Python
- C#
- C
enum class VX_DISTORTION_MODEL {
VX_DIST_NONE,
VX_DIST_MODEL_RADTAN
}class VX_DISTORTION_MODEL(Enum):
VX_DIST_NONE = 0
VX_DIST_MODEL_RADTAN = 1public enum VX_DISTORTION_MODEL {
VX_DIST_NONE,
VX_DIST_MODEL_RADTAN
}typedef enum vx_distortion_model {
VX_DIST_NONE,
VX_DIST_MODEL_RADTAN
} vx_distortion_model;
Example:
- C++
- Python
- C#
- C
VxIntrinsics intrinsics;
// Fill in the intrinsic parameters with your own calibration values
// before calling the function.
VxWriteIntrinsics(vxcam, intrinsics);
# Create a VxIntrinsics object
# Replace the placeholders with your own calibration values
intrinsics = pyvizionsdk.VxIntrinsics(
w=<image_width>,
h=<image_height>,
fx=<focal_length_u>,
fy=<focal_length_v>,
cx=<principal_point_u>,
cy=<principal_point_v>,
model=<distortion_model>,
coeffs=<distortion_coefficients>
)
result = pyvizionsdk.VxWriteIntrinsics(vxcam, intrinsics)
VxIntrinsics intrinsics = new VxIntrinsics();
// Fill in the intrinsic parameters with your own calibration values
// before calling the function.
CSVizionSDK.VxWriteIntrinsics(vxcam, intrinsics);
vx_intrinsics intrinsics;
// Fill in the intrinsic parameters with your own calibration values
// before calling the function.
vx_write_intrinsics(vxcam, intrinsics);
VxGetIntrinsics
Function:
- C++
- Python
- C#
- C
int VxGetIntrinsics(std::shared_ptr<VxCamera> vxcam, VxIntrinsics& intrinsics)
def VxGetIntrinsics(vxcam)
int VxGetIntrinsics(VxCamera vxcam, out VxIntrinsics intrinsics)
int vx_get_intrinsics(vx_camera vxcam, vx_intrinsics* intrinsics)
Function Description:
- This function retrieves the camera intrinsic parameters from the device.
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).
- C++
- Python
- C#
- C
struct VxIntrinsics {
int w;
int h;
float fx;
float fy;
float cx;
float cy;
VX_DISTORTION_MODEL model;
float coeffs[5];
}class VxIntrinsics:
def __init__(self, w, h, fx, fy, cx, cy, model, coeffs):
self.w = w
self.h = h
self.fx = fx
self.fy = fy
self.cx = cx
self.cy = cy
self.model = model
self.coeffs = coeffspublic struct VxIntrinsics {
public int x;
public int h;
public float fx;
public float fy;
public float cx;
public float cy;
public VX_DISTORTION_MODEL model;
public float[] coeffs;
}typedef struct vx_intrinsics {
int w;
int h;
float fx;
float fy;
float cx;
float cy;
vx_distortion_model model;
float coeffs[5];
} vx_intrinsics; -
VX_DISTORTION_MODEL format:
- C++
- Python
- C#
- C
enum class VX_DISTORTION_MODEL {
VX_DIST_NONE,
VX_DIST_MODEL_RADTAN
}class VX_DISTORTION_MODEL(Enum):
VX_DIST_NONE = 0
VX_DIST_MODEL_RADTAN = 1public enum VX_DISTORTION_MODEL {
VX_DIST_NONE,
VX_DIST_MODEL_RADTAN
}typedef enum vx_distortion_model {
VX_DIST_NONE,
VX_DIST_MODEL_RADTAN
} vx_distortion_model;
Example:
- C++
- Python
- C#
- C
VxIntrinsics intrinsics;
VxGetIntrinsics(vxcam, intrinsics);
result, intrinsics = pyvizionsdk.VxGetIntrinsics(vxcam)
VxIntrinsics intrinsics = new VxIntrinsics();
CSVizionSDK.VxGetIntrinsics(vxcam, out intrinsics);
vx_intrinsics intrinsics;
vx_get_intrinsics(vxcam, &intrinsics);