From 52de0e30b94e1427bf8e4216ce6636af25adb372 Mon Sep 17 00:00:00 2001 From: noacoohen Date: Thu, 14 Nov 2024 15:20:34 +0200 Subject: [PATCH] add rotation filter to python --- src/media/ros/ros_writer.cpp | 2 ++ src/rscore-pp-block-factory.cpp | 3 +++ wrappers/python/pyrs_processing.cpp | 1 + 3 files changed, 6 insertions(+) diff --git a/src/media/ros/ros_writer.cpp b/src/media/ros/ros_writer.cpp index beb836715b..c55d38f7da 100644 --- a/src/media/ros/ros_writer.cpp +++ b/src/media/ros/ros_writer.cpp @@ -2,6 +2,7 @@ // Copyright(c) 2019 Intel Corporation. All Rights Reserved. #include "proc/decimation-filter.h" +#include "proc/rotation-filter.h" #include "proc/threshold.h" #include "proc/disparity-transform.h" #include "proc/spatial-filter.h" @@ -513,6 +514,7 @@ namespace librealsense RETURN_IF_EXTENSION(block, RS2_EXTENSION_HOLE_FILLING_FILTER); RETURN_IF_EXTENSION(block, RS2_EXTENSION_HDR_MERGE); RETURN_IF_EXTENSION(block, RS2_EXTENSION_SEQUENCE_ID_FILTER); + RETURN_IF_EXTENSION(block, RS2_EXTENSION_ROTATION_FILTER); #undef RETURN_IF_EXTENSION diff --git a/src/rscore-pp-block-factory.cpp b/src/rscore-pp-block-factory.cpp index 679bcf63e0..d09fd7978b 100644 --- a/src/rscore-pp-block-factory.cpp +++ b/src/rscore-pp-block-factory.cpp @@ -4,6 +4,7 @@ #include "rscore-pp-block-factory.h" #include "proc/decimation-filter.h" +#include "proc/rotation-filter.h" #include "proc/disparity-transform.h" #include "proc/hdr-merge.h" #include "proc/hole-filling-filter.h" @@ -27,6 +28,8 @@ rscore_pp_block_factory::create_pp_block( std::string const & name, rsutils::jso if( rsutils::string::nocase_equal( name, "Decimation Filter" ) ) return std::make_shared< decimation_filter >(); + if( rsutils::string::nocase_equal( name, "Rotation Filter" ) ) + return std::make_shared< rotation_filter >(); if( rsutils::string::nocase_equal( name, "HDR Merge" ) ) // and Hdr Merge return std::make_shared< hdr_merge >(); if( rsutils::string::nocase_equal( name, "Filter By Sequence id" ) // name diff --git a/wrappers/python/pyrs_processing.cpp b/wrappers/python/pyrs_processing.cpp index 29b6066c18..5dd80f2f0a 100644 --- a/wrappers/python/pyrs_processing.cpp +++ b/wrappers/python/pyrs_processing.cpp @@ -65,6 +65,7 @@ void init_processing(py::module &m) { return new rs2::filter(filter_function, queue_size); }), "filter_function"_a, "queue_size"_a = 1) .def(BIND_DOWNCAST(filter, decimation_filter)) + .def( BIND_DOWNCAST( filter, rotation_filter ) ) .def(BIND_DOWNCAST(filter, disparity_transform)) .def(BIND_DOWNCAST(filter, hole_filling_filter)) .def(BIND_DOWNCAST(filter, spatial_filter))