Camera Profile Config
Introduction
These functions are responsible for configuring the camera profile.
VxLoadProfileConfig
Function:
- C++
- Python
int VxLoadProfileConfig(std::shared_ptr<VxCamera> vxcam, const std::string profile)
def VxLoadProfileConfig(vxcam)
Function Description:
- This function is for loading the profile configuration from a JSON-formatted string.
Parameter Description:
- vxcam : A pointer shared ownership of a camera obtained from VxInitialCameraDevice().
- profile : A constant string variable that stores the profile configuration.
- return 0 = PASS, return -1 = FAIL.
Example:
- C++
- Python
const std::string profile;
// load the profile config
VxLoadProfileConfig(vxcam, profile);
# load the profile config
pyvizionsdk.VxLoadProfileConfig(vxcam)
VxActivateProfileStreaming
Function:
- C++
- Python
int VxActivateProfileStreaming(std::shared_ptr<VxCamera> vxcam)
def VxActivateProfileStreaming(vxcam)
Function Description:
- This function enables streaming based on a specified camera profile.
Parameter Description:
- vxcam : A pointer shared ownership of a camera obtained from VxInitialCameraDevice().
- return 0 = PASS, return -1 = FAIL.
Example:
- C++
- Python
// streaming base on the profile config
VxActivateProfileStreaming(vxcam);
# streaming base on the profile config
pyvizionsdk.VxActivateProfileStreaming(vxcam)
VxActivateProfileImageProcessing
Function:
- C++
- Python
int VxActivateProfileImageProcessing(std::shared_ptr<VxCamera> vxcam)
def VxActivateProfileImageProcessing(vxcam)
Function Description:
- This function activates image processing based on a specified camera profile.
Parameter Description:
- vxcam : A pointer shared ownership of a camera obtained from VxInitialCameraDevice().
- return 0 = PASS, return -1 = FAIL.
Example:
- C++
- Python
// activates image processing base on the profile config
VxActivateProfileImageProcessing(vxcam);
# activates image processing base on the profile config
pyvizionsdk.VxActivateProfileImageProcessing(vxcam)
VxGetOSPProfileConfig
Function:
- C++
- Python
int VxGetOSPProfileConfig(std::shared_ptr<VxCamera> vxcam, std::string& profile)
def VxGetOSPProfileConfig(vxcam)
Function Description:
- This function is used to retrieve the OSP profile configuration and save it to the provided string.
Parameter Description:
- vxcam : A pointer shared ownership of a camera obtained from VxInitialCameraDevice().
- profile : A reference of sting format variable which stores the profile configuration.
- Return:
- C++ : return 0 = PASS, return -1 = FAIL
- Python : tuple(return_code, profile)
return_code : return 0 = PASS, return -1 = FAIL
Example:
- C++
- Python
std::string profile;
// get the OSP profile configuration
VxGetOSPProfileConfig(vxcam, profile);
# get the OSP profile configuration
pyvizionsdk.VxGetOSPProfileConfig(vxcam)
VxSetOSPProfileFlag & VxGetOSPProfileFlag
Function:
- C++
- Python
int VxSetOSPProfileFlag(std::shared_ptr<VxCamera> vxcam, VX_OSP_PROFILE_FLAG flag)
int VxGetOSPProfileFlag(std::shared_ptr<VxCamera> vxcam, VX_OSP_PROFILE_FLAG& flag)
def VxSetOSPProfileFlag(vxcam, flag)
def VxGetOSPProfileFlag(vxcam)
Function Description:
- VxSetOSPProfileFlag : This function is used to set the flag to the OSP profile configuration.
- VxGetOSPProfileFlag : This function is for retrieving the flag from the OSP profile configuration.
Parameter Description:
- vxcam : A pointer shared ownership of a camera obtained from VxInitialCameraDevice().
- flag : A VX_OSP_PROFILE_FLAG format variable which set and stored the flag value.
- VX_OSP_PROFILE_FLAG format:
- C++
- Python
enum class VX_OSP_PROFILE_FLAG { DISABLED, ENABLED, ENABLED_AND_SAVE };
class VX_OSP_PROFILE_FLAG(Enum):
DISABLED = 0
ENABLED = 1
ENABLED_AND_SAVE = 2
Return Values:
-
C++:
- 0 = Disable
- 1 = Enable, but don't write OSP
- 2 = Enable, write OSP by controller
- -1 = FAIL.
-
Python:
- VxSetOSPProfileFlag: return value same as C++
- VxGetOSPProfileFlag: tuple(return_code, flag)
return_code : return value same as C++
Example:
- C++
- Python
// set the OSP profile flag
VxSetOSPProfileFlag(vxcam, VX_OSP_PROFILE_FLAG::ENABLED);
VX_OSP_PROFILE_FLAG flag;
// get the OSP profile flag
VxGetOSPProfileFlag(vxcam, flag);
from pyvizionsdk import VX_OSP_PROFILE_FLAG
# set the OSP profile flag
pyvizionsdk.VxSetOSPProfileFlag(vxcam, VX_OSP_PROFILE_FLAG.ENABLED)
# get the OSP profile flag
pyvizionsdk.VxGetOSPProfileFlag(vxcam)
VxExportSensorConfig & VxDecodeSensorConfig
Function:
- C++
- Python
int VxExportSensorConfig(std::shared_ptr<VxCamera> vxcam, std::string configPath)
int VxDecodeSensorConfig(std::string configPath, std::string jsonPath)
def VxExportSensorConfig(vxcam, configPath)
def VxDecodeSensorConfig(configPath, jsonPath)
Function Description:
- VxExportSensorConfig : This function is used to dump the sensor profile configuration to the binary file.
- VxDecodeSensorConfig : This function is for decoding the binary file which dump from VxExportSensorConfig and save as json format file.
Parameter Description:
- vxcam : A pointer shared ownership of a camera obtained from VxInitialCameraDevice().
- configPath : The destination for binary file saving.
- jsonPath : The destination for json file saving
- Return : return 0 = PASS, return -1 = FAIL
Example:
- C++
- Python
std::string configPath = "config.bin";
// export sensor config
VxExportSensorConfig(vxcam, configPath);
std::string jsonPath = "config.json";
// decode sensor config
VxDecodeSensorConfig(configPath, jsonPath);
configPath = "config.bin"
# export sensor config
pyvizionsdk.VxExportSensorConfig(vxcam, configPath)
jsonPath = "config.json"
# decode sensor config
pyvizionsdk.VxDecodeSensorConfig(configPath, jsonPath)