24#include <unordered_map>
66 range.cur =
static_cast<valueType
>(cur);
67 range.def =
static_cast<valueType
>(item.
def);
68 range.max =
static_cast<valueType
>(item.
max);
69 range.min =
static_cast<valueType
>(item.
min);
70 range.step =
static_cast<valueType
>(item.
step);
77class Filter :
public std::enable_shared_from_this<Filter> {
102 for(uint32_t i = 0; i < count; i++) {
118 if(
impl_ !=
nullptr) {
179 virtual std::shared_ptr<Frame>
process(std::shared_ptr<const Frame> frame)
const {
180 const ob_frame *frameImpl =
nullptr;
182 frameImpl = frame->getImpl();
190 return std::make_shared<Frame>(result);
198 virtual void pushFrame(std::shared_ptr<Frame> frame)
const {
199 const ob_frame *frameImpl =
nullptr;
201 frameImpl = frame->getImpl();
278 static void filterCallback(
ob_frame *frame,
void *userData) {
279 auto filter =
static_cast<Filter *
>(userData);
280 filter->
callback_(std::make_shared<Frame>(frame));
296 template <
typename T>
bool is();
298 template <
typename T> std::shared_ptr<T>
as() {
300 throw std::runtime_error(
"unsupported operation, object's type is not require type");
303 return std::static_pointer_cast<T>(shared_from_this());
319 return std::make_shared<Filter>(impl);
329 static std::shared_ptr<Filter>
createPrivateFilter(
const std::string &name,
const std::string &activationKey) {
333 return std::make_shared<Filter>(impl);
457 setConfigValue(
"AlignType",
static_cast<double>(alignToStreamType));
460 virtual ~Align() noexcept override = default;
597 std::map<float, std::string> sequenceIdList_{ { 0.f,
"all" }, { 1.f,
"1" } };
600 void initSequenceIdList() {
604 for(
const auto &pair: sequenceIdList_) {
605 outputSequenceIdList_[i].sequenceSelectId =
static_cast<int>(pair.first);
606 strncpy(outputSequenceIdList_[i].name, pair.second.c_str(),
sizeof(outputSequenceIdList_[i].name) - 1);
607 outputSequenceIdList_[i].name[
sizeof(outputSequenceIdList_[i].name) - 1] =
'\0';
618 initSequenceIdList();
622 if(outputSequenceIdList_) {
623 delete[] outputSequenceIdList_;
624 outputSequenceIdList_ =
nullptr;
647 return outputSequenceIdList_;
656 return static_cast<int>(sequenceIdList_.size());
726 for(
const auto &item: schemaVec) {
727 if(strcmp(item.name,
"min") == 0) {
743 for(
const auto &item: schemaVec) {
744 if(strcmp(item.name,
"max") == 0) {
789 for(
const auto &item: schemaVec) {
790 if(strcmp(item.name,
"alpha") == 0) {
806 for(
const auto &item: schemaVec) {
807 if(strcmp(item.name,
"disp_diff") == 0) {
823 for(
const auto &item: schemaVec) {
824 if(strcmp(item.name,
"radius") == 0) {
840 for(
const auto &item: schemaVec) {
841 if(strcmp(item.name,
"magnitude") == 0) {
899 for(
const auto &item: schemaVec) {
900 if(strcmp(item.name,
"radius") == 0) {
952 for(
const auto &item: schemaVec) {
953 if(strcmp(item.name,
"magnitude") == 0) {
969 for(
const auto &item: schemaVec) {
970 if(strcmp(item.name,
"radius") == 0) {
986 for(
const auto &item: schemaVec) {
987 if(strcmp(item.name,
"disp_diff") == 0) {
1073 setConfigValue(
"max_size",
static_cast<double>(filterParams.max_size));
1074 setConfigValue(
"min_diff",
static_cast<double>(filterParams.disp_diff));
1098 for(
const auto &item: schemaVec) {
1099 if(strcmp(item.name,
"min_diff") == 0) {
1114 for(
const auto &item: schemaVec) {
1115 if(strcmp(item.name,
"max_size") == 0) {
1146 for(
const auto &item: schemaVec) {
1147 if(strcmp(item.name,
"diff_scale") == 0) {
1172 for(
const auto &item: schemaVec) {
1173 if(strcmp(item.name,
"weight") == 0) {
1212 for(
const auto &item: schemaVec) {
1213 if(strcmp(item.name,
"margin_x_th") == 0) {
1228 for(
const auto &item: schemaVec) {
1229 if(strcmp(item.name,
"margin_y_th") == 0) {
1244 for(
const auto &item: schemaVec) {
1245 if(strcmp(item.name,
"limit_x_th") == 0) {
1260 for(
const auto &item: schemaVec) {
1261 if(strcmp(item.name,
"limit_y_th") == 0) {
1276 for(
const auto &item: schemaVec) {
1277 if(strcmp(item.name,
"enable_vertical_direction") == 0) {
1292 for(
const auto &item: schemaVec) {
1293 if(strcmp(item.name,
"width") == 0) {
1308 for(
const auto &item: schemaVec) {
1309 if(strcmp(item.name,
"height") == 0) {
1372 for(
const auto &item: schemaVec) {
1373 if(strcmp(item.name,
"fpEdgeBleedFilterEnable") == 0) {
1389 for(
const auto &item: schemaVec) {
1390 if(strcmp(item.name,
"fpebfROIMinXRatio") == 0) {
1406 for(
const auto &item: schemaVec) {
1407 if(strcmp(item.name,
"fpebfROIMaxXRatio") == 0) {
1423 for(
const auto &item: schemaVec) {
1424 if(strcmp(item.name,
"fpebfROIMinYRatio") == 0) {
1440 for(
const auto &item: schemaVec) {
1441 if(strcmp(item.name,
"fpebfROIMaxYRatio") == 0) {
1457 for(
const auto &item: schemaVec) {
1458 if(strcmp(item.name,
"fpebfMinBleedLength") == 0) {
1474 for(
const auto &item: schemaVec) {
1475 if(strcmp(item.name,
"fpTextureSparsityFilterEnable") == 0) {
1491 for(
const auto &item: schemaVec) {
1492 if(strcmp(item.name,
"fptsfROIMinXRatio") == 0) {
1508 for(
const auto &item: schemaVec) {
1509 if(strcmp(item.name,
"fptsfROIMaxXRatio") == 0) {
1525 for(
const auto &item: schemaVec) {
1526 if(strcmp(item.name,
"fptsfROIMinYRatio") == 0) {
1542 for(
const auto &item: schemaVec) {
1543 if(strcmp(item.name,
"fptsfROIMaxYRatio") == 0) {
1559 for(
const auto &item: schemaVec) {
1560 if(strcmp(item.name,
"fptsfMaxNoiseLevel") == 0) {
1576 for(
const auto &item: schemaVec) {
1577 if(strcmp(item.name,
"fptsfMaxSpeckleSize") == 0) {
1593 for(
const auto &item: schemaVec) {
1594 if(strcmp(item.name,
"fpPatternAmbiguityFilterEnable") == 0) {
1610 for(
const auto &item: schemaVec) {
1611 if(strcmp(item.name,
"fppafROIMinXRatio") == 0) {
1627 for(
const auto &item: schemaVec) {
1628 if(strcmp(item.name,
"fppafROIMaxXRatio") == 0) {
1644 for(
const auto &item: schemaVec) {
1645 if(strcmp(item.name,
"fppafROIMinYRatio") == 0) {
1661 for(
const auto &item: schemaVec) {
1662 if(strcmp(item.name,
"fppafROIMaxYRatio") == 0) {
1678 for(
const auto &item: schemaVec) {
1679 if(strcmp(item.name,
"fppafMaxNoiseLevel") == 0) {
1695 for(
const auto &item: schemaVec) {
1696 if(strcmp(item.name,
"fppafMaxSpeckleSize") == 0) {
1712 for(
const auto &item: schemaVec) {
1713 if(strcmp(item.name,
"fppafMaxWidthRatio") == 0) {
1729 for(
const auto &item: schemaVec) {
1730 if(strcmp(item.name,
"fppafMaxHeightRatio") == 0) {
1746 for(
const auto &item: schemaVec) {
1747 if(strcmp(item.name,
"fppafTolerance") == 0) {
1763 for(
const auto &item: schemaVec) {
1764 if(strcmp(item.name,
"fppafScore") == 0) {
1792 setConfigValue(
"max_width_left",
static_cast<double>(filterParams.max_width_left));
1793 setConfigValue(
"max_width_right",
static_cast<double>(filterParams.max_width_right));
1794 setConfigValue(
"max_radius",
static_cast<double>(filterParams.max_radius));
1795 setConfigValue(
"margin_x_th",
static_cast<double>(filterParams.margin_x_th));
1796 setConfigValue(
"margin_y_th",
static_cast<double>(filterParams.margin_y_th));
1797 setConfigValue(
"limit_x_th",
static_cast<double>(filterParams.limit_x_th));
1798 setConfigValue(
"limit_y_th",
static_cast<double>(filterParams.limit_y_th));
1799 setConfigValue(
"width",
static_cast<double>(filterParams.width));
1800 setConfigValue(
"height",
static_cast<double>(filterParams.height));
1828 for(
const auto &item: schemaVec) {
1829 if(strcmp(item.name,
"max_width_left") == 0) {
1844 for(
const auto &item: schemaVec) {
1845 if(strcmp(item.name,
"max_width_right") == 0) {
1860 for(
const auto &item: schemaVec) {
1861 if(strcmp(item.name,
"max_radius") == 0) {
1876 for(
const auto &item: schemaVec) {
1877 if(strcmp(item.name,
"margin_x_th") == 0) {
1892 for(
const auto &item: schemaVec) {
1893 if(strcmp(item.name,
"margin_y_th") == 0) {
1908 for(
const auto &item: schemaVec) {
1909 if(strcmp(item.name,
"limit_x_th") == 0) {
1924 for(
const auto &item: schemaVec) {
1925 if(strcmp(item.name,
"limit_y_th") == 0) {
1940 for(
const auto &item: schemaVec) {
1941 if(strcmp(item.name,
"width") == 0) {
1956 for(
const auto &item: schemaVec) {
1957 if(strcmp(item.name,
"height") == 0) {
1985 for(
int i = 0; i < 16; ++i) {
1986 setConfigValue(
"max_lut_" + std::to_string(i),
static_cast<double>(filterParams.max_lut[i]));
1988 setConfigValue(
"min_diff",
static_cast<double>(filterParams.min_diff));
1989 setConfigValue(
"width",
static_cast<double>(filterParams.width));
1990 setConfigValue(
"height",
static_cast<double>(filterParams.height));
1999 for(
int i = 0; i < 16; ++i) {
2015 if(index < 0 || index >= 16) {
2018 std::string name =
"max_lut_" + std::to_string(index);
2020 for(
const auto &item: schemaVec) {
2021 if(strcmp(item.name, name.c_str()) == 0) {
2036 for(
const auto &item: schemaVec) {
2037 if(strcmp(item.name,
"min_diff") == 0) {
2052 for(
const auto &item: schemaVec) {
2053 if(strcmp(item.name,
"width") == 0) {
2068 for(
const auto &item: schemaVec) {
2069 if(strcmp(item.name,
"height") == 0) {
2109 template <
typename T>
explicit EnhancedDepthFilter(std::shared_ptr<T> device,
const std::string &modelPath =
"") {
2111 throw std::invalid_argument(
"device is null");
2120 if(!modelPath.empty()) {
2123 optionsPtr = &options;
2139 static const std::vector<std::pair<uint32_t, uint32_t>> supportedResolutions = {
2144 return supportedResolutions;
2177 if(sourceStreamType != alignToStreamType) {
2183 if(res.first == width && res.second == height) {
2200 if(supported == format) {
2242 setConfigValue(
"confidence_threshold",
static_cast<double>(value));
2251 for(
const auto &item: schemaVec) {
2252 const char *name =
"confidence_threshold";
2253 if(std::strcmp(item.name, name) == 0) {
2264 ob_filter_list_t *impl_;
2298 return std::make_shared<Filter>(filter);
2312 static const std::unordered_map<std::string, std::type_index> filterTypeMap = {
2314 {
"Align",
typeid(
Align) },
2334 return filterTypeMap;
2344 std::string name =
type();
2347 auto it = filterTypeMap.find(name);
2348 if(it != filterTypeMap.end()) {
2349 return std::type_index(
typeid(T)) == it->second;
This file defines the Error class, which describes abnormal errors within the SDK....
The processing unit of the SDK can perform point cloud generation, format conversion and other functi...
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 void ob_filter_activate_private_ex(ob_filter *filter, ob_device *device, const ob_priv_filter_activate_options *options, ob_error **error)
Activate a private filter object with a specific device.
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.
OB_EXPORT void ob_delete_filter_list(ob_filter_list *filter_list, ob_error **error)
Delete a list of ob_filter objects.
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 ob_frame * ob_filter_process(ob_filter *filter, const ob_frame *frame, ob_error **error)
Process the frame (synchronous interface).
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_filter_reset(ob_filter *filter, ob_error **error)
Reset the filter, clears the cache, and resets the state. If the asynchronous interface is used,...
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 * ob_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_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 bool ob_filter_is_enabled(const ob_filter *filter, ob_error **error)
Get the enable status of the frame post processing.
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 const char * ob_filter_get_name(const ob_filter *filter, ob_error **error)
Get the name of ob_filter.
OB_EXPORT void ob_delete_filter(ob_filter *filter, ob_error **error)
Delete 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 ob_filter * ob_filter_list_get_filter(const ob_filter_list *filter_list, uint32_t index, ob_error **error)
Get the filter by index.
OB_EXPORT ob_filter * ob_create_filter(const char *name, ob_error **error)
Create a Filter object.
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 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_enable(ob_filter *filter, bool enable, ob_error **error)
Enable the frame post processing.
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.
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.
Frame related function is mainly used to obtain frame data and frame information.
Frame related type, which is mainly used to obtain frame data and frame information.
struct ob_frame_t ob_frame
OBFormat
Enumeration value describing the pixel format.
OBStreamType
Enumeration value describing the type of data stream.
struct ob_filter_t ob_filter
enum OB_COORDINATE_SYSTEM_TYPE OBCoordinateSystemType
OBHoleFillingMode
Hole fillig mode.
OBConvertFormat
Enumeration of format conversion types.
Align for depth to other or other to depth.
Align(OBStreamType alignToStreamType)
virtual ~Align() noexcept override=default
OBStreamType getAlignToStreamType()
void setMatchTargetResolution(bool state)
Sets whether the output frame resolution should match the target resolution. When enabled,...
void setAlignToStreamProfile(std::shared_ptr< const StreamProfile > profile)
Set the Align To Stream Profile.
Decimation filter, reducing complexity by subsampling depth maps and losing depth details.
virtual ~DecimationFilter() noexcept override=default
OBUint8PropertyRange getScaleRange()
Get the property range of the decimation filter scale value.
uint8_t getScaleValue()
Get the decimation filter scale value.
void setScaleValue(uint8_t value)
Set the decimation filter scale value.
OBUint16PropertyRange getVerticalDirectionEnableRange()
Get the edge noise removal filter vertical direction enable range.
OBUint16PropertyRange getLimitXthRange()
Get the edge noise removal filter limit x th range.
EdgeNoiseRemovalFilter(const std::string &activationKey="")
OBUint16PropertyRange getHeightRange()
Get the edge noise removal filter height range.
OBUint16PropertyRange getWidthRange()
Get the edge noise removal filter width range.
OBEdgeNoiseRemovalFilterParams getFilterParams()
Get the edge noise removal filter params.
~EdgeNoiseRemovalFilter() noexcept override=default
OBUint16PropertyRange getMarginYthRange()
Get the edge noise removal filter margin y th range.
OBUint16PropertyRange getLimitYthRange()
Get the edge noise removal filter limit y th range.
OBUint16PropertyRange getMarginXthRange()
Get the edge noise removal filter margin x th range.
void setFilterParams(OBEdgeNoiseRemovalFilterParams filterParams)
Set the edge noise removal filter params.
Enhanced depth filter that requires a device for activation.
static std::vector< OBFormat > getSupportedFormats(OBStreamType streamType)
Get the frame formats supported by the enhanced depth filter for a given stream type.
static const std::vector< std::pair< uint32_t, uint32_t > > & getSupportedResolutions()
Get the resolutions supported by the enhanced depth filter for the constrained (aligned-to) stream.
EnhancedDepthFilter(std::shared_ptr< T > device, const std::string &modelPath="")
Construct an EnhancedDepthFilter and activate it for the given device.
~EnhancedDepthFilter() noexcept override=default
OBIntPropertyRange getConfidenceThresholdRange()
Get the property range of the confidence threshold range.
static bool isSupportedResolution(OBStreamType sourceStreamType, OBStreamType alignToStreamType, uint32_t width, uint32_t height)
Check whether a resolution is supported by the enhanced depth filter for a given stream alignment pai...
uint32_t getCurrentWidth() const
Get the current configured frame width.
void setConfidenceThreshold(uint32_t value)
Set the confidence threshold for depth values.
void setResolution(uint32_t width, uint32_t height)
Set the working resolution of the enhanced depth filter.
uint32_t getCurrentHeight() const
Get the current configured frame height.
static bool isSupportedFormat(OBStreamType streamType, OBFormat format)
Check whether a frame format is supported by the enhanced depth filter for a given stream type.
static void handle(ob_error **error, bool throw_exception=true)
A static function to handle the ob_error and throw an exception if needed.
OBFloatPropertyRange getfppafMaxHeightRatioRange()
Get the FalsePositive filter fppafMaxHeightRatio range.
OBFloatPropertyRange getfppafROIMaxYRatioRange()
Get the FalsePositive filter fppafROIMaxYRatio range.
OBFloatPropertyRange getfptsfROIMinXRatioRange()
Get the FalsePositive filter fptsfROIMinXRatio range.
OBFloatPropertyRange getfptsfROIMaxYRatioRange()
Get the FalsePositive filter fptsfROIMaxYRatio range.
OBFloatPropertyRange getfpebfROIMinXRatioRange()
Get the FalsePositive filter fpebfROIMinXRatio range.
OBFloatPropertyRange getfptsfROIMinYRatioRange()
Get the FalsePositive filter fptsfROIMinYRatio range.
OBUint16PropertyRange getfpebfMinBleedLengthRange()
Get the FalsePositive filter fpebfMinBleedLength range.
OBUint16PropertyRange getfppafMaxNoiseLevelRange()
Get the FalsePositive filter fppafMaxNoiseLevel range.
OBUint16PropertyRange getfptsfMaxSpeckleSizeRange()
Get the FalsePositive filter fptsfMaxSpeckleSize range.
virtual ~FalsePositiveFilter() noexcept override=default
OBUint8PropertyRange getfpPatternAmbiguityFilterEnableRange()
Get the FalsePositive filter fpPatternAmbiguityFilterEnable range.
OBUint8PropertyRange getfpTextureSparsityFilterEnableRange()
Get the FalsePositive filter fpTextureSparsityFilterEnable range.
OBFloatPropertyRange getfppafROIMinYRatioRange()
Get the FalsePositive filter fppafROIMinYRatio range.
OBFloatPropertyRange getfppafToleranceRange()
Get the FalsePositive filter fppafTolerance range.
OBUint8PropertyRange getfpEdgeBleedFilterEnableRange()
Get the FalsePositive filter fpEdgeBleedFilterEnable range.
FalsePositiveFilter(const std::string &activationKey="")
OBUint16PropertyRange getfptsfMaxNoiseLevelRange()
Get the FalsePositive filter fptsfMaxNoiseLevel range.
OBUint16PropertyRange getfppafScoreRange()
Get the FalsePositive filter fppafScore range.
OBFloatPropertyRange getfptsfROIMaxXRatioRange()
Get the FalsePositive filter fptsfROIMaxXRatio range.
OBFloatPropertyRange getfppafROIMinXRatioRange()
Get the FalsePositive filter fppafROIMinXRatio range.
OBUint16PropertyRange getfppafMaxSpeckleSizeRange()
Get the FalsePositive filter fppafMaxSpeckleSize range.
OBFloatPropertyRange getfpebfROIMaxYRatioRange()
Get the FalsePositive filter fpebfROIMaxYRatio range.
OBFloatPropertyRange getfppafMaxWidthRatioRange()
Get the FalsePositive filter fppafMaxWidthRatio range.
OBFloatPropertyRange getfppafROIMaxXRatioRange()
Get the FalsePositive filter fppafROIMaxXRatio range.
OBFloatPropertyRange getfpebfROIMinYRatioRange()
Get the FalsePositive filter fpebfROIMinYRatio range.
OBFloatPropertyRange getfpebfROIMaxXRatioRange()
Get the FalsePositive filter fpebfROIMaxXRatio range.
A factory class for creating filters.
static std::string getFilterVendorSpecificCode(const std::string &name)
Get the vendor specific code of a filter by filter name.
static std::shared_ptr< Filter > createFilter(const std::string &name)
Create a filter by name.
static std::shared_ptr< Filter > createPrivateFilter(const std::string &name, const std::string &activationKey)
Create a private filter by name and activation key.
The Filter class is the base class for all filters in the SDK.
bool is()
Check if the runtime type of the filter object is compatible with a given type.
virtual void init(ob_filter *impl)
std::shared_ptr< T > as()
virtual const std::string & getName() const
Get the type of filter.
virtual std::vector< OBFilterConfigSchemaItem > getConfigSchemaVec() const
Get the Config Schema Vec object.
virtual void enable(bool enable) const
enable the filter
virtual void setConfigValue(const std::string &configName, double value) const
Set the filter config value by name.
virtual std::string getConfigSchema() const
Get config schema of the filter.
std::vector< OBFilterConfigSchemaItem > configSchemaVec_
virtual bool isEnabled() const
Return Enable State.
Filter()=default
Default constructor with nullptr impl, used for derived classes only.
virtual void pushFrame(std::shared_ptr< Frame > frame) const
Pushes the pending frame into the cache for asynchronous processing.
virtual std::shared_ptr< Frame > process(std::shared_ptr< const Frame > frame) const
Processes a frame synchronously.
ob_filter * getImpl() const
Get the Impl object of the filter.
virtual void reset() const
Reset the filter, freeing the internal cache, stopping the processing thread, and clearing the pendin...
virtual const char * type()
virtual double getConfigValue(const std::string &configName) const
Get the Config Value object by name.
virtual void setCallBack(FilterCallback callback)
Set the callback function for asynchronous processing.
virtual ~Filter() noexcept
HdrMerge processing block, the processing merges between depth frames with different sub-preset seque...
virtual ~HdrMerge() noexcept override=default
Hole filling filter,the processing performed depends on the selected hole filling mode.
void setFilterMode(OBHoleFillingMode mode)
Set the HoleFillingFilter mode.
HoleFillingFilter(const std::string &activationKey="")
OBHoleFillingMode getFilterMode()
Get the HoleFillingFilter mode.
~HoleFillingFilter() noexcept override=default
OBUint16PropertyRange getHeightRange()
Get the lut noise removal filter height range.
OBUint16PropertyRange getMinDiffRange()
Get the lut noise removal filter min_diff range.
OBLutNoiseRemovalFilterParams getFilterParams()
Get the lut noise removal filter params.
OBUint16PropertyRange getWidthRange()
Get the lut noise removal filter width range.
OBUint16PropertyRange getMaxLutRange(int index)
Get the lut noise removal filter max_lut range for a given index (0-15).
~LutNoiseRemovalFilter() noexcept override=default
LutNoiseRemovalFilter(const std::string &activationKey="")
void setFilterParams(OBLutNoiseRemovalFilterParams filterParams)
Set the lut noise removal filter params.
OBUint16PropertyRange getWidthRange()
Get the mgc noise removal filter width range.
OBUint16PropertyRange getHeightRange()
Get the mgc noise removal filter height range.
OBUint16PropertyRange getMaxWidthRightRange()
Get the mgc noise removal filter max_width_right range.
OBUint16PropertyRange getMaxWidthLeftRange()
Get the mgc noise removal filter max_width_left range.
OBUint16PropertyRange getLimitYthRange()
Get the mgc noise removal filter limit_y_th range.
void setFilterParams(OBMgcNoiseRemovalFilterParams filterParams)
Set the mgc noise removal filter params.
MgcNoiseRemovalFilter(const std::string &activationKey="")
OBUint16PropertyRange getMarginXthRange()
Get the mgc noise removal filter margin_x_th range.
OBUint16PropertyRange getLimitXthRange()
Get the mgc noise removal filter limit_x_th range.
OBMgcNoiseRemovalFilterParams getFilterParams()
Get the mgc noise removal filter params.
OBUint16PropertyRange getMarginYthRange()
Get the mgc noise removal filter margin_y_th range.
~MgcNoiseRemovalFilter() noexcept override=default
OBUint16PropertyRange getMaxRadiusRange()
Get the mgc noise removal filter max_radius range.
The noise removal filter,removing scattering depth pixels.
OBUint16PropertyRange getDispDiffRange()
Get the noise removal filter disp diff range.
void setFilterParams(OBNoiseRemovalFilterParams filterParams)
Set the noise removal filter params.
NoiseRemovalFilter(const std::string &activationKey="")
~NoiseRemovalFilter() noexcept override=default
OBUint16PropertyRange getMaxSizeRange()
Get the noise removal filter max size range.
OBNoiseRemovalFilterParams getFilterParams()
Get the noise removal filter params.
uint32_t getCount() const
Get the number of filters.
std::shared_ptr< Filter > getFilter(uint32_t index)
Get the Filter object at the specified index.
OBFilterList(ob_filter_list_t *impl)
The PointCloudFilter class is a subclass of Filter that generates point clouds.
void setCoordinateSystem(OBCoordinateSystemType type)
Set the point cloud coordinate system.
void setCoordinateDataScaled(float factor)
Set the point cloud coordinate data zoom factor.
void setCameraParam(OBCameraParam param)
void setPositionDataScaled(float scale)
void setCreatePointFormat(OBFormat format)
Set the output pointcloud frame format.
virtual ~PointCloudFilter() noexcept override=default
void setFrameAlignState(bool state)
OBIntPropertyRange getDecimationFactorRange()
Get the property range of the decimation factor range.
void setDecimationFactor(int value)
Set the point cloud decimation factor. Calling this function to decimation factor will output thedown...
void setColorDataNormalization(bool state)
Set point cloud color data normalization.
Create SequenceIdFilter processing block.
int getSelectSequenceId()
Get the current sequence id.
void selectSequenceId(int sequence_id)
Set the sequenceId filter params.
virtual ~SequenceIdFilter() noexcept override
OBSequenceIdItem * getSequenceIdList()
int getSequenceIdListSize()
Get the sequenceId list size.
Spatial advanced filte smooths the image by calculating frame with alpha and delta settings alpha def...
void setFilterParams(OBSpatialAdvancedFilterParams params)
Set the spatial advanced filter params.
OBSpatialAdvancedFilterParams getFilterParams()
Get the spatial advanced filter params.
OBUint16PropertyRange getRadiusRange()
Get the spatial advanced filter radius range.
SpatialAdvancedFilter(const std::string &activationKey="")
OBFloatPropertyRange getAlphaRange()
Get the spatial advanced filter alpha range.
OBUint16PropertyRange getDispDiffRange()
Get the spatial advanced filter dispdiff range.
virtual ~SpatialAdvancedFilter() noexcept override=default
OBIntPropertyRange getMagnitudeRange()
Get the spatial advanced filter magnitude range.
The Spatial Fast Filter utilizes an enhanced median smoothing algorithm, designed to significantly re...
virtual ~SpatialFastFilter() noexcept override=default
SpatialFastFilter(const std::string &activationKey="")
void setFilterParams(OBSpatialFastFilterParams params)
Set the spatial fast filter params.
OBSpatialFastFilterParams getFilterParams()
Get the spatial fast filter params.
OBIntPropertyRange getRadiusRange()
Get the spatial fast filter radius range.
The Spatial Moderate Filter utilizes an optimized average smoothing algorithm, to achieve a balance b...
SpatialModerateFilter(const std::string &activationKey="")
OBIntPropertyRange getRadiusRange()
Get the spatial moderate filter radius range.
virtual ~SpatialModerateFilter() noexcept override=default
void setFilterParams(OBSpatialModerateFilterParams params)
Set the spatial moderate filter params.
OBSpatialModerateFilterParams getFilterParams()
Get the spatial moderate filter params.
OBIntPropertyRange getMagnitudeRange()
Get the spatial moderate filter magnitude range.
OBIntPropertyRange getDispDiffRange()
Get the spatial moderate filter disp diff range.
OBFloatPropertyRange getWeightRange()
Get the TemporalFilter weight range.
void setDiffScale(float value)
Set the TemporalFilter diffscale value.
~TemporalFilter() noexcept override=default
OBFloatPropertyRange getDiffScaleRange()
Get the TemporalFilter diffscale range.
void setWeight(float value)
Set the TemporalFilter weight value.
TemporalFilter(const std::string &activationKey="")
Creates depth Thresholding filter By controlling min and max options on the block.
bool setValueRange(uint16_t min, uint16_t max)
Set the threshold filter max and min range.
OBIntPropertyRange getMinRange()
Get the threshold filter min range.
virtual ~ThresholdFilter() noexcept override=default
OBIntPropertyRange getMaxRange()
Get the threshold filter max range.
UnDistortionFilter removes lens distortion from a chosen stream (Color, IR, or Depth).
void setNewCameraMatrix(OBCameraIntrinsic depthIntrinsic)
Set the new camera matrix used to project the undistorted image (equivalent to OpenCV's newCameraMatr...
void setStreamType(OBStreamType streamType)
Set which stream to undistort (default: OB_STREAM_COLOR).
virtual ~UnDistortionFilter() noexcept override=default
void clearNewCameraMatrix()
Clear the new camera matrix and return to pure undistortion.
UnDistortionFilter(OBStreamType streamType=OB_STREAM_COLOR)
OBStreamType getStreamType() const
const std::unordered_map< std::string, std::type_index > & getFilterTypeMap()
Returns the mapping of filter type names to their corresponding type_index.
std::function< void(std::shared_ptr< Frame >)> FilterCallback
A callback function that takes a shared pointer to a Frame object as its argument.
T getPropertyRange(const OBFilterConfigSchemaItem &item, const double cur)
Get T Property Range.
Structure for camera intrinsic parameters.
float fx
Focal length in x direction.
float cx
Optical center abscissa.
int16_t height
Image height.
float cy
Optical center ordinate.
int16_t width
Image width.
float fy
Focal length in y direction.
Structure for camera parameters.
int limit_y_th
Maximum vertical threshold.
int margin_x_th
Horizontal threshold settings.
uint32_t height
Image height.
uint32_t width
Image width.
bool enable_direction
Set to true for horizontal and vertical, false for horizontal only.
int limit_x_th
Maximum horizontal threshold.
int margin_y_th
Vertical threshold settings.
Configuration Item for the filter.
double min
Minimum value casted to double.
double max
Maximum value casted to double.
double def
Default value casted to double.
double step
Step value casted to double.
Structure for float range.
Structure for integer range.
Configuration parameters for the LUT noise removal filter.
uint32_t width
Depth map width the above parameters correspond to.
uint32_t height
Depth map height the above parameters correspond to.
uint16_t max_lut[16]
LUT max size of noise pixels (4x4 LUT, 16 entries total).
uint16_t min_diff
Difference threshold between neighbor pixels.
Configuration parameters for the MGC noise removal filter.
int limit_y_th
Maximum vertical threshold.
int limit_x_th
Maximum horizontal threshold.
int max_radius
Chamfer radius threshold settings.
int max_width_right
Right chamfer threshold settings.
int margin_y_th
Vertical threshold settings.
uint32_t height
Depth map height the above parameters correspond to.
uint32_t width
Depth map width the above parameters correspond to.
int max_width_left
Left chamfer threshold settings.
int margin_x_th
Horizontal threshold settings.
SequenceId fliter list item.
Structure for float range.
Structure for float range.
Get the type of a PropertyRange member.
The error class exposed by the SDK, users can get detailed error information according to the error.
Extensible options for activating a private filter instance.
uint32_t struct_size
Size of this struct in bytes, set by the caller to sizeof(ob_priv_filter_activate_options).
const char * model_path
Path to the inference model file. NULL or empty selects the filter's default model.