librealsense icon indicating copy to clipboard operation
librealsense copied to clipboard

Post processing / filters with Python wrapper

Open TheMikeyR opened this issue 8 years ago • 9 comments


Required Info
Camera Model D415
Firmware Version 05.08.15.00
Operating System & Version Linux (Ubuntu 16.04.4)
Kernel Version (Linux Only) 4.14.13-041413-generic
Platform PC
SDK Version v2.10.0
Language Python

Issue Description

It seems like the post processing steps / filters are not available to the python wrapper, any plans on porting it?

TheMikeyR avatar Apr 09 '18 10:04 TheMikeyR

Hi @TheMikeyR Yes, we should add it.

dorodnic avatar Apr 09 '18 11:04 dorodnic

[Realsense Customer Engineering Team Comment] Hello @TheMikeyR, the post-processing via Python API has been added in release v2.11.0.

Thanks @RealSense-Customer-Engineering

TheMikeyR avatar May 09 '18 10:05 TheMikeyR

Hello @TheMikeyR and @RealSense-Customer-Engineering ,

Could you please point me to the v.2.11.0 release, where the filters have been added? I don't seem to be able to find it.

Many thanks!

phojjat avatar Aug 28 '18 20:08 phojjat

@phojjat https://github.com/IntelRealSense/librealsense/blob/a8e38426bf2bf0fc4233bca054cec32caaf60bc8/wrappers/python/python.cpp#L534-L544

TheMikeyR avatar Sep 04 '18 06:09 TheMikeyR

Thank you for this! However, in here it doesn’t seem that those filters take any input but can only be initialized, as opposed to “align”, for instance. What I want to do is to apply the filters to the aligned frames. Could you please let me know how that should look?

Many thanks! Parsa

py::class_<rs2::align, rs2::processing_block> align(m, "align"); align.def(py::init<rs2_stream>(), "align_to"_a) .def("process", &rs2::align::process, "frames"_a);

phojjat avatar Sep 04 '18 20:09 phojjat

This is what I have tried: aligned_frames = align.process(frames) decimated=rs.decimation_filter(aligned_frames)

but I get a TypeError: init(): incompatible constructor arguments.

phojjat avatar Sep 04 '18 20:09 phojjat

@phojjat - did you figure out how to use these filters in python? I am having a similar issue.

EDIT: I found this which was helpful to me: https://github.com/IntelRealSense/librealsense/blob/jupyter/notebooks/depth_filters.ipynb

lauer2356 avatar Sep 18 '18 20:09 lauer2356

@phojjat - did you figure out how to use these filters in python? I am having a similar issue.

EDIT: I found this which was helpful to me: https://github.com/IntelRealSense/librealsense/blob/jupyter/notebooks/depth_filters.ipynb

Yes, I implemented a similar script. Thank you!

phojjat avatar Sep 19 '18 14:09 phojjat