-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
A problem when applying Filter and Align together #1658
Comments
Hi @tarekmuallim |
Hi @dorodnic My code is a part of a bigger program. But I tried to make a new simple one for test.
The program crash when it reach calculate (last statement).
With this program it takes some time then it crashed. Again the program crash when it reach calculate. |
Hi @tarekmuallim #include <librealsense2/rs.hpp>
rs2::pointcloud pc;
rs2::points points;
rs2::spatial_filter spat_filter;
rs2::temporal_filter temp_filter;
rs2::frameset frames;
rs2::frameset framesf;
rs2::frameset aligned_frames;
rs2::align align(rs2_stream::RS2_STREAM_COLOR);
int main() {
rs2::pipeline pipe;
auto profile = pipe.start();
spat_filter.set_option(rs2_option::RS2_OPTION_FILTER_MAGNITUDE, 5.0f);
spat_filter.set_option(rs2_option::RS2_OPTION_FILTER_SMOOTH_DELTA, 50.0f);
spat_filter.set_option(rs2_option::RS2_OPTION_FILTER_SMOOTH_ALPHA, 0.3f);
temp_filter.set_option(rs2_option::RS2_OPTION_FILTER_SMOOTH_DELTA, 100.0f);
temp_filter.set_option(rs2_option::RS2_OPTION_FILTER_SMOOTH_ALPHA, 0.3f);
frames = pipe.wait_for_frames();
aligned_frames = align.process(frames);
// auto depth = framesf.get_depth_frame();
rs2::frame depth;
for (auto&& f : aligned_frames)
{
if (f.get_profile().format() == RS2_FORMAT_Z16)
depth = f;
}
depth = spat_filter.process(depth);//apply filter
depth = temp_filter.process(depth);//apply filter
points = pc.calculate(depth);
} |
Thank you for insightful and easy to reproduce feedback. There are several issues highlighted by the two snippets:
measure example can also offer some working reference. |
Thank you for the explanation. |
(cherry picked from commit e7fc8dc3270c11816adf669be4eabb30046d9a4d)
Fixing issue with post-processing blocks. Post-processing filters to report error on failure. Addressing #1658
[Realsense Customer Engineering Team Comment] |
@RealSense-Customer-Engineering |
I am trying to: get a frameset, then apply spatial filter and temporal filter, after that do alignment between the color and the depth.
But my program crash such as "AccessViolationException".
This is my code:
The program crash when it reach calculate
I tried to do alignment first then do filtering but also it crash when I apply the filter
I think the Filter and Align can't use in the same time.
How can I fix this problem?
The text was updated successfully, but these errors were encountered: