Camera Profile Config
Introduction
These functions are responsible for configuring the camera profile.
VxLoadProfileConfig
Function:
- C++
- Python
- C#
int VxLoadProfileConfig(std::shared_ptr<VxCamera> vxcam, const std::string profile)
def VxLoadProfileConfig(vxcam)
int VxLoadProfileConfig(VxCamera vxcam, string profile)
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
- C#
const std::string profile;
// load the profile config
VxLoadProfileConfig(vxcam, profile);
# load the profile config
pyvizionsdk.VxLoadProfileConfig(vxcam)
string profile = "PROFILE";
// load the profile config
CSVizionSDK.VxLoadProfileConfig(vxcam, profile);
VxActivateProfileStreaming
Function:
- C++
- Python
- C#
int VxActivateProfileStreaming(std::shared_ptr<VxCamera> vxcam)
def VxActivateProfileStreaming(vxcam)
int VxActivateProfileStreaming(VxCamera 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
- C#
// streaming base on the profile config
VxActivateProfileStreaming(vxcam);
# streaming base on the profile config
pyvizionsdk.VxActivateProfileStreaming(vxcam)
// streaming base on the profile config
CSVizionSDK.VxActivateProfileStreaming(vxcam);
VxActivateProfileImageProcessing
Function:
- C++
- Python
- C#
int VxActivateProfileImageProcessing(std::shared_ptr<VxCamera> vxcam)
def VxActivateProfileImageProcessing(vxcam)
int VxActivateProfileImageProcessing(VxCamera 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
- C#
// activates image processing base on the profile config
VxActivateProfileImageProcessing(vxcam);
# activates image processing base on the profile config
pyvizionsdk.VxActivateProfileImageProcessing(vxcam)
// activates image processing base on the profile config
CSVizionSDK.VxActivateProfileImageProcessing(vxcam);
VxGetOSPProfileConfig
Function:
- C++
- Python
- C#
int VxGetOSPProfileConfig(std::shared_ptr<VxCamera> vxcam, std::string& profile)
def VxGetOSPProfileConfig(vxcam)
int VxGetOSPProfileConfig(VxCamera vxcam, ref string profile)
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++ / C# : return 0 = PASS, return -1 = FAIL
- Python : tuple(return_code, profile)
return_code : return 0 = PASS, return -1 = FAIL
Example:
- C++
- Python
- C#
std::string profile;
// get the OSP profile configuration
VxGetOSPProfileConfig(vxcam, profile);
# get the OSP profile configuration
pyvizionsdk.VxGetOSPProfileConfig(vxcam)
string profile = "";
// get the OSP profile configuration
CSVizionSDK.VxGetOSPProfileConfig(vxcam, ref profile);
VxSetOSPProfileFlag & VxGetOSPProfileFlag
Function:
- C++
- Python
- C#
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)
int VxSetOSPProfileFlag(VxCamera vxcam, VX_OSP_PROFILE_FLAG flag)
int VxGetOSPProfileFlag(VxCamera vxcam, out VX_OSP_PROFILE_FLAG flag)
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
- C#
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
public enum VX_OSP_PROFILE_FLAG {
DISABLED,
ENABLED,
ENABLED_AND_SAVE
}
Return Values:
-
C++ / 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
- C#
// 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)
// set the OSP profile flag
CSVizionSDK.VxSetOSPProfileFlag(vxcam, VX_OSP_PROFILE_FLAG.ENABLED);
VX_OSP_PROFILE_FLAG flag;
// get the OSP profile flag
CSVizionSDK.VxGetOSPProfileFlag(vxcam, out flag);
VxExportSensorConfig & VxDecodeSensorConfig
Function:
- C++
- Python
- C#
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)
int VxExportSensorConfig(VxCamera vxcam, string configPath)
int VxDecodeSensorConfig(string configPath, string 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
- C#
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)
string configPath = "config.bin";
// export sensor config
CSVizionSDK.VxExportSensorConfig(vxcam, configPath);
string jsonPath = "config.json";
// decode sensor config
CSVizionSDK.VxDecodeSensorConfig(configPath, jsonPath);