OrbbecSDK 2.5.5
OrbbecSDK: Software-Development-Kit for Orbbec 3D Cameras
Loading...
Searching...
No Matches
Filter.h File Reference

The processing unit of the SDK can perform point cloud generation, format conversion and other functions. More...

#include "ObTypes.h"

Go to the source code of this file.

Macros

#define ob_get_filter   ob_filter_list_get_filter
#define ob_get_filter_name   ob_filter_get_name

Functions

OB_EXPORT ob_filterob_create_filter (const char *name, ob_error **error)
 Create a Filter object.
OB_EXPORT const char * ob_filter_get_name (const ob_filter *filter, ob_error **error)
 Get the name of ob_filter.
OB_EXPORT const char * ob_filter_get_vendor_specific_code (const char *name, ob_error **error)
 Get the vendor specific code of a filter by filter name.
OB_EXPORT ob_filterob_create_private_filter (const char *name, const char *activation_key, ob_error **error)
 Create a private Filter object with activation key.
OB_EXPORT void ob_delete_filter (ob_filter *filter, ob_error **error)
 Delete the filter.
OB_EXPORT const char * ob_filter_get_config_schema (const ob_filter *filter, ob_error **error)
 Get config schema of the filter.
OB_EXPORT ob_filter_config_schema_listob_filter_get_config_schema_list (const ob_filter *filter, ob_error **error)
 Get the filter config schema list of the filter.
OB_EXPORT void ob_delete_filter_config_schema_list (ob_filter_config_schema_list *config_schema_list, ob_error **error)
 Delete a list of filter config schema items.
OB_EXPORT void ob_filter_update_config (ob_filter *filter, uint8_t argc, const char **argv, ob_error **error)
 Update config of the filter.
OB_EXPORT double ob_filter_get_config_value (const ob_filter *filter, const char *config_name, ob_error **error)
 Get the filter config value by name and cast to double.
OB_EXPORT void ob_filter_set_config_value (ob_filter *filter, const char *config_name, double value, ob_error **error)
 Set the filter config value by name.
OB_EXPORT void ob_filter_reset (ob_filter *filter, ob_error **error)
 Reset the filter, clears the cache, and resets the state. If the asynchronous interface is used, the processing thread will also be stopped and the pending cache frames will be cleared.
OB_EXPORT void ob_filter_enable (ob_filter *filter, bool enable, ob_error **error)
 Enable the frame post processing.
OB_EXPORT bool ob_filter_is_enabled (const ob_filter *filter, ob_error **error)
 Get the enable status of the frame post processing.
OB_EXPORT ob_frameob_filter_process (ob_filter *filter, const ob_frame *frame, ob_error **error)
 Process the frame (synchronous interface).
OB_EXPORT void ob_filter_set_callback (ob_filter *filter, ob_filter_callback callback, void *user_data, ob_error **error)
 Set the processing result callback function for the filter (asynchronous callback interface).
OB_EXPORT void ob_filter_push_frame (ob_filter *filter, const ob_frame *frame, ob_error **error)
 Push the frame into the pending cache for the filter (asynchronous callback interface).
OB_EXPORT uint32_t ob_filter_list_get_count (const ob_filter_list *filter_list, ob_error **error)
 Get the number of filter in the list.
OB_EXPORT ob_filterob_filter_list_get_filter (const ob_filter_list *filter_list, uint32_t index, ob_error **error)
 Get the filter by index.
OB_EXPORT void ob_delete_filter_list (ob_filter_list *filter_list, ob_error **error)
 Delete a list of ob_filter objects.
OB_EXPORT uint32_t ob_filter_config_schema_list_get_count (const ob_filter_config_schema_list *config_schema_list, ob_error **error)
 Get the number of config schema items in the config schema list.
OB_EXPORT ob_filter_config_schema_item ob_filter_config_schema_list_get_item (const ob_filter_config_schema_list *config_schema_list, uint32_t index, ob_error **error)
 Get the config schema item by index.
OB_EXPORT void ob_align_filter_set_align_to_stream_profile (ob_filter *filter, const ob_stream_profile *align_to_stream_profile, ob_error **error)
 Set the align to stream profile for the align filter.

Detailed Description

The processing unit of the SDK can perform point cloud generation, format conversion and other functions.

Definition in file Filter.h.

Macro Definition Documentation

◆ ob_get_filter

#define ob_get_filter   ob_filter_list_get_filter

Definition at line 259 of file Filter.h.

◆ ob_get_filter_name

#define ob_get_filter_name   ob_filter_get_name

Definition at line 260 of file Filter.h.

Function Documentation

◆ ob_create_filter()

OB_EXPORT ob_filter * ob_create_filter ( const char * name,
ob_error ** error )

Create a Filter object.

Attention
If the filter of the specified name is a private filter, and the creator of the filter have not been activated, the function will return NULL.
Parameters
nameThe name of the filter.
errorPointer to an error object that will be set if an error occurs.

Referenced by ob::Align::Align(), ob::FilterFactory::createFilter(), ob::DecimationFilter::DecimationFilter(), ob::FormatConvertFilter::FormatConvertFilter(), ob::HdrMerge::HdrMerge(), ob::PointCloudFilter::PointCloudFilter(), ob::SequenceIdFilter::SequenceIdFilter(), and ob::ThresholdFilter::ThresholdFilter().

◆ ob_filter_get_name()

OB_EXPORT const char * ob_filter_get_name ( const ob_filter * filter,
ob_error ** error )

Get the name of ob_filter.

Parameters
filterob_filter object
errorPointer to an error object that will be set if an error occurs.
Returns
char The filter of name

Referenced by ob::Filter::init().

◆ ob_filter_get_vendor_specific_code()

OB_EXPORT const char * ob_filter_get_vendor_specific_code ( const char * name,
ob_error ** error )

Get the vendor specific code of a filter by filter name.

A private filter can define its own vendor specific code for specific purposes.

Parameters
nameThe name of the filter.
errorPointer to an error object that will be set if an error occurs.
Returns
const char* Return the vendor specific code of the filter.

Referenced by ob::FilterFactory::getFilterVendorSpecificCode().

◆ ob_create_private_filter()

OB_EXPORT ob_filter * ob_create_private_filter ( const char * name,
const char * activation_key,
ob_error ** error )

Create a private Filter object with activation key.

Some private filters require an activation key to be activated, its depends on the vendor of the filter.

Parameters
nameThe name of the filter.
activation_keyThe activation key of the filter.
errorPointer to an error object that will be set if an error occurs.
Returns
ob_filter* Return the private filter object.

Referenced by ob::FilterFactory::createPrivateFilter(), ob::DisparityTransform::DisparityTransform(), ob::HoleFillingFilter::HoleFillingFilter(), ob::NoiseRemovalFilter::NoiseRemovalFilter(), ob::SpatialAdvancedFilter::SpatialAdvancedFilter(), ob::SpatialFastFilter::SpatialFastFilter(), ob::SpatialModerateFilter::SpatialModerateFilter(), and ob::TemporalFilter::TemporalFilter().

◆ ob_delete_filter()

OB_EXPORT void ob_delete_filter ( ob_filter * filter,
ob_error ** error )

Delete the filter.

Parameters
[in]filterThe filter object to be deleted.
[out]errorPointer to an error object that will be set if an error occurs.

Referenced by ob::Filter::~Filter().

◆ ob_filter_get_config_schema()

OB_EXPORT const char * ob_filter_get_config_schema ( const ob_filter * filter,
ob_error ** error )

Get config schema of the filter.

The returned string is a csv format string representing the configuration schema of the filter. The format of the string is: <parameter_name>, <parameter_type: "int", "float", "bool">, <minimum_value>, <maximum_value>, <value_step>, <default_value>, <parameter_description>

Parameters
[in]filterThe filter object to get the configuration schema for
[out]errorPointer to an error object that will be set if an error occurs
Returns
A csv format string representing the configuration schema of the filter

Referenced by ob::Filter::getConfigSchema().

◆ ob_filter_get_config_schema_list()

OB_EXPORT ob_filter_config_schema_list * ob_filter_get_config_schema_list ( const ob_filter * filter,
ob_error ** error )

Get the filter config schema list of the filter.

The returned string is a list of ob_config_schema_item representing the configuration schema of the filter.

Attention
The returned list should be deleted by calling ob_delete_filter_config_schema_list when it is no longer needed.
Parameters
filterThe filter object to get the configuration schema for
errorPointer to an error object that will be set if an error occurs
Returns
ob_filter_config_schema_list* Return the filter config schema list of the filter

Referenced by ob::Filter::init().

◆ ob_delete_filter_config_schema_list()

OB_EXPORT void ob_delete_filter_config_schema_list ( ob_filter_config_schema_list * config_schema_list,
ob_error ** error )

Delete a list of filter config schema items.

Parameters
config_schema_listThe list of filter config schema items to delete.
errorPointer to an error object that will be set if an error occurs.

Referenced by ob::Filter::init().

◆ ob_filter_update_config()

OB_EXPORT void ob_filter_update_config ( ob_filter * filter,
uint8_t argc,
const char ** argv,
ob_error ** error )

Update config of the filter.

Attention
The passed in argc and argv must match the configuration schema returned by the ob_filter_get_config_schema function.
Parameters
[in]filterThe filter object to update the configuration for
[in]argcThe number of arguments in the argv array
[in]argvAn array of strings representing the configuration values
[out]errorPointer to an error object that will be set if an error occurs

◆ ob_filter_get_config_value()

OB_EXPORT double ob_filter_get_config_value ( const ob_filter * filter,
const char * config_name,
ob_error ** error )

Get the filter config value by name and cast to double.

Attention
The returned value is cast to double, the actual type of the value depends on the filter config schema returned by ob_filter_get_config_schema.
Parameters
[in]filterA filter object.
[in]config_nameconfig name
[out]errorPointer to an error object that will be set if an error occurs.
Returns
double The value of the config.

Referenced by ob::Filter::getConfigValue().

◆ ob_filter_set_config_value()

OB_EXPORT void ob_filter_set_config_value ( ob_filter * filter,
const char * config_name,
double value,
ob_error ** error )

Set the filter config value by name.

Attention
The pass into value type is double, witch will be cast to the actual type inside the filter. The actual type can be queried by the filter config schema returned by ob_filter_get_config_schema.
Parameters
[in]filterA filter object.
[in]config_nameconfig name
[in]valueThe value to set.
[out]errorPointer to an error object that will be set if an error occurs.

Referenced by ob::Filter::setConfigValue().

◆ ob_filter_reset()

OB_EXPORT void ob_filter_reset ( ob_filter * filter,
ob_error ** error )

Reset the filter, clears the cache, and resets the state. If the asynchronous interface is used, the processing thread will also be stopped and the pending cache frames will be cleared.

Parameters
[in]filterA filter object.
[out]errorPointer to an error object that will be set if an error occurs.

Referenced by ob::Filter::reset().

◆ ob_filter_enable()

OB_EXPORT void ob_filter_enable ( ob_filter * filter,
bool enable,
ob_error ** error )

Enable the frame post processing.

The filter default is enable.

Attention
If the filter has been disabled by calling this function, processing will directly output a clone of the input frame.
Parameters
[in]filterA filter object.
[in]enableenable status, true: enable; false: disable.
[out]errorPointer to an error object that will be set if an error occurs.

Referenced by ob::Filter::enable().

◆ ob_filter_is_enabled()

OB_EXPORT bool ob_filter_is_enabled ( const ob_filter * filter,
ob_error ** error )

Get the enable status of the frame post processing.

Attention
If the filter is disabled, the processing will directly output a clone of the input frame.
Parameters
[in]filterA filter object.
[out]errorPointer to an error object that will be set if an error occurs.
Returns
The post processing filter status. True: enable; False: disable.

Referenced by ob::Filter::isEnabled().

◆ ob_filter_process()

OB_EXPORT ob_frame * ob_filter_process ( ob_filter * filter,
const ob_frame * frame,
ob_error ** error )

Process the frame (synchronous interface).

Parameters
[in]filterA filter object.
[in]framePointer to the frame object to be processed.
[out]errorPointer to an error object that will be set if an error occurs.
Returns
The frame object processed by the filter.

Referenced by ob::Filter::process().

◆ ob_filter_set_callback()

OB_EXPORT void ob_filter_set_callback ( ob_filter * filter,
ob_filter_callback callback,
void * user_data,
ob_error ** error )

Set the processing result callback function for the filter (asynchronous callback interface).

Parameters
[in]filterA filter object.
[in]callbackCallback function.
[in]user_dataArbitrary user data pointer can be passed in and returned from the callback.
[out]errorPointer to an error object that will be set if an error occurs.

Referenced by ob::Filter::setCallBack().

◆ ob_filter_push_frame()

OB_EXPORT void ob_filter_push_frame ( ob_filter * filter,
const ob_frame * frame,
ob_error ** error )

Push the frame into the pending cache for the filter (asynchronous callback interface).

The frame will be processed by the filter when the processing thread is available and return a new processed frame to the callback function.

Attention
The frame object will be add reference count, so the user still need call ob_delete_frame to release the frame after calling this function.
Parameters
[in]filterA filter object.
[in]framePointer to the frame object to be processed.
[out]errorPointer to an error object that will be set if an error occurs.

Referenced by ob::Filter::pushFrame().

◆ ob_filter_list_get_count()

OB_EXPORT uint32_t ob_filter_list_get_count ( const ob_filter_list * filter_list,
ob_error ** error )

Get the number of filter in the list.

Parameters
[in]filter_listfilter list
[out]errorPointer to an error object that will be set if an error occurs.
Returns
uint32_t The number of list

Referenced by ob::Sensor::createRecommendedFilters(), and ob::OBFilterList::getCount().

◆ ob_filter_list_get_filter()

OB_EXPORT ob_filter * ob_filter_list_get_filter ( const ob_filter_list * filter_list,
uint32_t index,
ob_error ** error )

Get the filter by index.

Parameters
[in]filter_listFilter list
[in]indexFilter index
[out]errorPointer to an error object that will be set if an error occurs.
Returns
ob_filter The index of ob_filter

Referenced by ob::Sensor::createRecommendedFilters(), and ob::OBFilterList::getFilter().

◆ ob_delete_filter_list()

OB_EXPORT void ob_delete_filter_list ( ob_filter_list * filter_list,
ob_error ** error )

Delete a list of ob_filter objects.

Parameters
[in]filter_listThe list of ob_filter objects to delete.
[out]errorPointer to an error object that will be set if an error occurs.

Referenced by ob::Sensor::createRecommendedFilters(), and ob::OBFilterList::~OBFilterList().

◆ ob_filter_config_schema_list_get_count()

OB_EXPORT uint32_t ob_filter_config_schema_list_get_count ( const ob_filter_config_schema_list * config_schema_list,
ob_error ** error )

Get the number of config schema items in the config schema list.

Parameters
config_schema_listFilter config schema list
errorPointer to an error object that will be set if an error occurs.
Returns
uint32_t The number of config schema items in the filter list

Referenced by ob::Filter::init().

◆ ob_filter_config_schema_list_get_item()

OB_EXPORT ob_filter_config_schema_item ob_filter_config_schema_list_get_item ( const ob_filter_config_schema_list * config_schema_list,
uint32_t index,
ob_error ** error )

Get the config schema item by index.

Parameters
config_schema_listFilter config schema list
indexConfig schema item index
errorPointer to an error object that will be set if an error occurs.
Returns
ob_filter_config_schema_item* The config schema item by index

Referenced by ob::Filter::init().

◆ ob_align_filter_set_align_to_stream_profile()

OB_EXPORT void ob_align_filter_set_align_to_stream_profile ( ob_filter * filter,
const ob_stream_profile * align_to_stream_profile,
ob_error ** error )

Set the align to stream profile for the align filter.

It is useful when the align target stream dose not started (without any frame to get intrinsics and extrinsics).

Parameters
filterA filter object.
align_to_stream_profileThe align target stream profile.
errorPointer to an error object that will be set if an error occurs.

Referenced by ob::Align::setAlignToStreamProfile().