Skip to main content

Camera Profile Config

Introduction

These functions are responsible for configuring the camera profile.

warning

On Linux, I2C access may require elevated privileges. See I2C permission troubleshooting.

VxLoadProfileConfig

Function:

int VxLoadProfileConfig(std::shared_ptr<VxCamera> vxcam, const std::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:

const std::string profile;
// load the profile config
VxLoadProfileConfig(vxcam, profile);

VxActivateProfileStreaming

Function:

int VxActivateProfileStreaming(std::shared_ptr<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:

// streaming base on the profile config
VxActivateProfileStreaming(vxcam);

VxActivateProfileImageProcessing

Function:

int VxActivateProfileImageProcessing(std::shared_ptr<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:

// activates image processing base on the profile config
VxActivateProfileImageProcessing(vxcam);

VxGetOSPProfileConfig

Function:

int VxGetOSPProfileConfig(std::shared_ptr<VxCamera> vxcam, std::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:
    • return 0 = PASS, return -1 = FAIL
    • Python : tuple(return_code, profile)

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

Example:

std::string profile;
// get the OSP profile configuration
VxGetOSPProfileConfig(vxcam, profile);

VxSetOSPProfileFlag & VxGetOSPProfileFlag

Function:

int VxSetOSPProfileFlag(std::shared_ptr<VxCamera> vxcam, VX_OSP_PROFILE_FLAG flag)
int VxGetOSPProfileFlag(std::shared_ptr<VxCamera> vxcam, 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:
enum class VX_OSP_PROFILE_FLAG { 
DISABLED,
ENABLED,
ENABLED_AND_SAVE
}

Return Values:

  • Return Code:

    • 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:

// 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);

VxExportSensorConfig & VxDecodeSensorConfig

Function:

int VxExportSensorConfig(std::shared_ptr<VxCamera> vxcam, std::string configPath)
int VxDecodeSensorConfig(std::string configPath, std::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:

std::string configPath = "config.bin";
// export sensor config
VxExportSensorConfig(vxcam, configPath);

std::string jsonPath = "config.json";
// decode sensor config
VxDecodeSensorConfig(configPath, jsonPath);