Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No available methods to filter depth stream #313

Closed
poripsa opened this issue Feb 12, 2018 · 10 comments
Closed

No available methods to filter depth stream #313

poripsa opened this issue Feb 12, 2018 · 10 comments

Comments

@poripsa
Copy link

poripsa commented Feb 12, 2018

None of the filters from realsense (library) can be applied without modifying the ros-wrapper. If it is going to be supported by the wrapper an approximate date of release would be great.

@icarpis
Copy link
Contributor

icarpis commented Feb 13, 2018

Hello @poripsa, we are planning to add the Depth filters in the next releases.

@poripsa
Copy link
Author

poripsa commented Feb 13, 2018

Hi @icarpis I will be trying to do it parallely with librealsense 2.10.0

@icarpis
Copy link
Contributor

icarpis commented Feb 14, 2018

Thank you @poripsa, that's would be great.
As a reference you can take a look at the implementation of post-processing example.

@akifh
Copy link

akifh commented Mar 8, 2018

@icarpis Any update on adding post-processing options to ROS wrapper? Or any guide on how and where to implement them?

@piotrpolatowski
Copy link

piotrpolatowski commented Mar 12, 2018

@akifh quick way for most filters is to modify base_realsense_node. I have skipped decimation filter though, since it would require more changes because of resolution change.

  1. declare filters in header.
        // Decalre filters
        std::shared_ptr<rs2::decimation_filter> decimation_filter;
        std::shared_ptr<rs2::spatial_filter> spatial_filter; // edge-preserving spatial smoothing
        std::shared_ptr<rs2::temporal_filter> temporal_filter; // reduces temporal noise
        std::shared_ptr<rs2::disparity_transform> depth_to_disparity;
        std::shared_ptr<rs2::disparity_transform> disparity_to_depth;
  1. initialize in constructor
    decimation_filter = std::make_shared<rs2::decimation_filter>();
    temporal_filter = std::make_shared<rs2::temporal_filter>();
    spatial_filter = std::make_shared<rs2::spatial_filter>();
    depth_to_disparity = std::make_shared<rs2::disparity_transform>(true);
    disparity_to_depth = std::make_shared<rs2::disparity_transform>(false);
  1. apply filters in BaseRealSenseNode::setupStreams() around line 563
if (stream_type == RS2_STREAM_DEPTH)
{
  f = depth_to_disparity->process(f);
//                            f = decimation_filter->process(f);
  f = spatial_filter->process(f);
  f = temporal_filter->process(f);
  f = disparity_to_depth->process(f);
}

@anleger92
Copy link

anleger92 commented Mar 14, 2018

@piotrpolatowski Thank you for your code :)
But when i insert the lines of code you posted I get errors. But this is probably because I just inserted them in the wrong order. I usually do not program in cpp.
Could you just name the lines in which I have to insert the code you posted?
Would appreciate it.

edit:
I now added the code to declare filters in header file in line 35.
And I initialized in constructor in line 25 in cpp file.
The third part of code I added where you mentioned

@anleger92
Copy link

Is there any update concerning the implementation of the decimation filter?

@baumanta
Copy link
Contributor

@icarpis I also have the same problem, that I would need the decimation filter using the ROS wrapper. Is there any update on this issue?

@johannesburg
Copy link

In case anyone needs a quick fix: I've added the filter code to a forked repo of the realsense library and currently have three of the four filters added (temporal, spatial, and hole filling filter). Currently working on adding in the decimation filter.

@RealSenseCustomerSupport
Copy link
Collaborator

[Please Ignore - RealSense system comment]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants