Camera Profile Config
  • 11 Apr 2025
  • 1 Minute to read
  • Dark
    Light
  • PDF

Camera Profile Config

  • Dark
    Light
  • PDF

Article summary

Introduction

These functions are responsible for configuring the camera profile.

VxLoadProfileConfig

  • Function:

int VxLoadProfileConfig(std::shared_ptr<VxCamera> vxcam, const std::string profile)
def VxLoadProfileConfig(vxcam)
  • Function Description:

  1. This function is for loading the profile configuration from a JSON-formatted string.

  • Parameter Description:

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

  2. profile: A constant string variable that stores the profile configuration.

  3. return 0 = PASS, return -1 = FAIL.

  • Example:

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

VxActivateProfileStreaming

  • Function:

int VxActivateProfileStreaming(std::shared_ptr<VxCamera> vxcam)
def VxActivateProfileStreaming(vxcam)
  • Function Description:

  1. This function enables streaming based on a specified camera profile.

  • Parameter Description:

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

  2. return 0 = PASS, return -1 = FAIL.

  • Example:

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

VxActivateProfileImageProcessing

  • Function:

int VxActivateProfileImageProcessing(std::shared_ptr<VxCamera> vxcam)
def VxActivateProfileImageProcessing(vxcam)
  • Function Description:

  1. This function activates image processing based on a specified camera profile.

  • Parameter Description:

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

  2. return 0 = PASS, return -1 = FAIL.

  • Example:

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

VxGetOSPProfileConfig

  • Function:

int VxGetOSPProfileConfig(std::shared_ptr<VxCamera> vxcam, std::string& profile)
def VxGetOSPProfileConfig(vxcam)
  • Function Description:

  1. This function is used to retrieve the OSP profile configuration and save it to the provided string.

  • Parameter Description:

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

  2. profile: A reference of sting format variable which stores the profile configuration.

  3. Return:

    1. C++: return 0 = PASS, return -1 = FAIL

    2. Python: tuple(return_code, profile)

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

  • Example:

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

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

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

  2. flag: A VX_OSP_PROFILE_FLAG format variable which set and stored the flag value.

  3. VX_OSP_PROFILE_FLAG format:

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:

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


Was this article helpful?

What's Next