BGAPI2 Polarization Functions

Functions related to the Polarization Camera. More...

Typedefs

typedef struct BGAPI2_Polarizer BGAPI2_Polarizer
 Struct for pointers of type Polarizer. More...
 

Enumerations

enum  BGAPI2_POLARIZER_FORMATS {
  BGAPI2_POLARIZER_AOP = 0, BGAPI2_POLARIZER_DOLP = 1, BGAPI2_POLARIZER_ADOLP = 2, BGAPI2_POLARIZER_INTENSITY = 3,
  BGAPI2_POLARIZER_POL0_DEG = 4, BGAPI2_POLARIZER_POL45_DEG = 5, BGAPI2_POLARIZER_POL90_DEG = 6, BGAPI2_POLARIZER_POL135_DEG = 7,
  BGAPI2_POLARIZER_REFLECTION_MIN = 8, BGAPI2_POLARIZER_REFLECTION_MAX = 9
}
 Enumeration containing the string representation of the possible polarization formats. More...
 

Functions

BGAPI2_C_DECL BGAPI2_RESULT BGAPI2CALL BGAPI2_Polarizer_Create (BGAPI2_Polarizer **polarizer)
 Creates a polarizer object. More...
 
BGAPI2_C_DECL BGAPI2_RESULT BGAPI2CALL BGAPI2_Polarizer_Release (BGAPI2_Polarizer *polarizer)
 Release a polarizer object. More...
 
BGAPI2_C_DECL BGAPI2_RESULT BGAPI2CALL BGAPI2_Polarizer_Initialize (BGAPI2_Polarizer *polarizer, BGAPI2_Buffer *buffer)
 Initialize the Polarizer and provide the buffer with the raw polarized data for calculations. More...
 
BGAPI2_C_DECL BGAPI2_RESULT BGAPI2CALL BGAPI2_Polarizer_ReadCalibrationData (BGAPI2_Polarizer *polarizer, BGAPI2_Device *device)
 Get the calibration data and angle offset from the camera. More...
 
BGAPI2_C_DECL BGAPI2_RESULT BGAPI2CALL BGAPI2_Polarizer_EnableInterpolation (BGAPI2_Polarizer *polarizer, bo_bool interpolate)
 Keep output image the same size as the input buffer. The default is disabled. More...
 
BGAPI2_C_DECL BGAPI2_RESULT BGAPI2CALL BGAPI2_Polarizer_Enable (BGAPI2_Polarizer *polarizer, BGAPI2_POLARIZER_FORMATS format, bo_bool enable)
 Each component to be calculated must be enabled first. More...
 
BGAPI2_C_DECL BGAPI2_RESULT BGAPI2CALL BGAPI2_Polarizer_Get (BGAPI2_Polarizer *polarizer, BGAPI2_POLARIZER_FORMATS format, BGAPI2_Image *image)
 Get the calculated component (BGAPI_POLARIZER_AOP, etc.) from the buffer. More...
 
BGAPI2_C_DECL BGAPI2_RESULT BGAPI2CALL BGAPI2_Polarizer_GetFormatString (BGAPI2_Polarizer *polarizer, BGAPI2_POLARIZER_FORMATS format, char *format_string, bo_uint64 *size)
 Get the string of the polarization format. More...
 
BGAPI2_C_DECL BGAPI2_RESULT BGAPI2CALL BGAPI2_Polarizer_SetMaxThreads (BGAPI2_Polarizer *polarizer, bo_uint number)
 Set the number of threads the Polarizer can use for calculations. More...
 

Detailed Description

Functions related to the Polarization Camera.

Typedef Documentation

◆ BGAPI2_Polarizer

Struct for pointers of type Polarizer.

Enumeration Type Documentation

◆ BGAPI2_POLARIZER_FORMATS

Enumeration containing the string representation of the possible polarization formats.

Enumerator
BGAPI2_POLARIZER_AOP 

Enum value AOP - Angle of polarization.

BGAPI2_POLARIZER_DOLP 

Enum value DOLP - Degree of linear polarization.

BGAPI2_POLARIZER_ADOLP 

Enum value ADOLP - Angle and degree of linear polarization.

BGAPI2_POLARIZER_INTENSITY 

Enum value Intensity - Gray scale image.

BGAPI2_POLARIZER_POL0_DEG 

Enum value Pol0Deg - The polarization information 0 degrees.

BGAPI2_POLARIZER_POL45_DEG 

Enum value Pol45Deg - The polarization information 45 degrees.

BGAPI2_POLARIZER_POL90_DEG 

Enum value Pol90Deg - The polarization information 90 degrees.

BGAPI2_POLARIZER_POL135_DEG 

Enum value Pol135Deg - The polarization information 135 degrees.

BGAPI2_POLARIZER_REFLECTION_MIN 

Enum value ReflectionMin - Image with suppressed reflections.

BGAPI2_POLARIZER_REFLECTION_MAX 

Enum value ReflectionMax - Image with enhanced reflections.

Function Documentation

◆ BGAPI2_Polarizer_Create()

BGAPI2_C_DECL BGAPI2_RESULT BGAPI2CALL BGAPI2_Polarizer_Create ( BGAPI2_Polarizer **  polarizer)

Creates a polarizer object.

Parameters
[out]polarizerPointer on polarizer object
Return values
BGAPI2_RESULT_SUCCESSNo error

◆ BGAPI2_Polarizer_Release()

BGAPI2_C_DECL BGAPI2_RESULT BGAPI2CALL BGAPI2_Polarizer_Release ( BGAPI2_Polarizer polarizer)

Release a polarizer object.

Parameters
[in]polarizerPointer to the polarizer object
Return values
BGAPI2_RESULT_SUCCESSNo error

◆ BGAPI2_Polarizer_Initialize()

BGAPI2_C_DECL BGAPI2_RESULT BGAPI2CALL BGAPI2_Polarizer_Initialize ( BGAPI2_Polarizer polarizer,
BGAPI2_Buffer buffer 
)

Initialize the Polarizer and provide the buffer with the raw polarized data for calculations.

Parameters
[in]polarizerInstance of polarizer.
[in]bufferA valid buffer with polarized data acquired by a Baumer camera
Return values
BGAPI2_RESULT_SUCCESSNo error
BGAPI2_RESULT_INVALID_PARAMETERError for invalid parameters
BGAPI2_RESULT_ERRORInternal error

◆ BGAPI2_Polarizer_ReadCalibrationData()

BGAPI2_C_DECL BGAPI2_RESULT BGAPI2CALL BGAPI2_Polarizer_ReadCalibrationData ( BGAPI2_Polarizer polarizer,
BGAPI2_Device device 
)

Get the calibration data and angle offset from the camera.

Reads the calibration matrix and the configured polarization angle offset from the camera device to enhance the calculation of different polarization formats.

Parameters
[in]polarizerInstance of polarizer.
[in]deviceThe polarization camera (opened, must be able to read features from the camera)
Return values
BGAPI2_RESULT_SUCCESSNo error
BGAPI2_RESULT_INVALID_PARAMETERError for invalid parameters
BGAPI2_RESULT_NOT_INITIALIZEDThe is not open.

◆ BGAPI2_Polarizer_EnableInterpolation()

BGAPI2_C_DECL BGAPI2_RESULT BGAPI2CALL BGAPI2_Polarizer_EnableInterpolation ( BGAPI2_Polarizer polarizer,
bo_bool  interpolate 
)

Keep output image the same size as the input buffer. The default is disabled.

If enabled, the calculated images will be interpolated to have the same size as the raw image buffer provided

Parameters
[in]polarizerInstance of polarizer
[in]interpolateIf set to true the result images will be interpolated
Return values
BGAPI2_RESULT_SUCCESSNo error
BGAPI2_RESULT_INVALID_PARAMETERError for invalid parameters

◆ BGAPI2_Polarizer_Enable()

BGAPI2_C_DECL BGAPI2_RESULT BGAPI2CALL BGAPI2_Polarizer_Enable ( BGAPI2_Polarizer polarizer,
BGAPI2_POLARIZER_FORMATS  format,
bo_bool  enable 
)

Each component to be calculated must be enabled first.

To speed up the calculation of the different components it is necessary to enable them first. This allows for the calculation to re-use and combine some of the necessary calculations

Parameters
[in]polarizerInstance of polarizer
[in]formatThe format to enable or disable
[in]enableSet to true to enable or false to disable
Return values
BGAPI2_RESULT_SUCCESSNo error
BGAPI2_RESULT_INVALID_PARAMETERError for invalid parameters

◆ BGAPI2_Polarizer_Get()

BGAPI2_C_DECL BGAPI2_RESULT BGAPI2CALL BGAPI2_Polarizer_Get ( BGAPI2_Polarizer polarizer,
BGAPI2_POLARIZER_FORMATS  format,
BGAPI2_Image image 
)

Get the calculated component (BGAPI_POLARIZER_AOP, etc.) from the buffer.

For performance reasons when handling more than one component, a component must first be enabled via the BGAPI2_Polarizer_Enable() method

Parameters
[in]polarizerInstance of polarizer
[in]formatThe format to enable or disable
[in,out]imageBGAPI2_Image to store the result of the calculation
See also
BGAPI2_POLARIZER_FORMATS
BGAPI2_Polarizer_Initialize()
BGAPI2_ImageProcessor_CreateImage()
Return values
BGAPI2_RESULT_SUCCESSNo error
BGAPI2_RESULT_INVALID_PARAMETERError for invalid parameters
BGAPI2_RESULT_NOT_AVAILABLEPolarizer result not available
BGAPI2_RESULT_ERRORInternal error

◆ BGAPI2_Polarizer_GetFormatString()

BGAPI2_C_DECL BGAPI2_RESULT BGAPI2CALL BGAPI2_Polarizer_GetFormatString ( BGAPI2_Polarizer polarizer,
BGAPI2_POLARIZER_FORMATS  format,
char *  format_string,
bo_uint64 *  size 
)

Get the string of the polarization format.

Parameters
[in]polarizerInstance of polarizer.
[in]formatThe polarization format
[out]format_stringThe buffer of the polarization format
[in,out]sizeThe buffer size (in) / The format string size (out)
See also
BGAPI2_POLARIZER_FORMATS
Return values
BGAPI2_RESULT_SUCCESSNo error
BGAPI2_RESULT_INVALID_PARAMETERError for invalid parameters

◆ BGAPI2_Polarizer_SetMaxThreads()

BGAPI2_C_DECL BGAPI2_RESULT BGAPI2CALL BGAPI2_Polarizer_SetMaxThreads ( BGAPI2_Polarizer polarizer,
bo_uint  number 
)

Set the number of threads the Polarizer can use for calculations.

To speed up the calculation of components more than one thread can be used internally. The default is 4 threads on processors which have 8 or more logical cores, otherwise half of the logical cores are used. Depending on your application you can change this here

Parameters
[in]polarizerInstance of polarizer
[in]numberThe amount of threads used internally
Return values
BGAPI2_RESULT_INVALID_PARAMETERError for invalid parameters
BGAPI2_RESULT_SUCCESSNo error