librealsense icon indicating copy to clipboard operation
librealsense copied to clipboard

how can i load Json file or enable post processing (Hole filling) by writing in my code ?

Open Medo91code opened this issue 7 years ago • 10 comments

Hi I use D435 , c++ as a programing language. how can i enable post processing (Hole filling) in my code (manually by writing )? or when i save the configuration of post processing (Hole filling) from RealSense Viewer as JSON file , how can i load this file in the code ?

Thank you

img

Medo91code avatar Jan 09 '19 14:01 Medo91code

post-processing We don't have an example for loading JSON, but you could do it like this:

rs2::pipeline p;
auto prof = p.start();
rs2::device dev = prof.get_device();
auto advanced = dev.as<advanced_mode>();
advanced.load_json(str);

You could also apply one of the standard presets by setting VISUAL_PRESET option on the depth sensor.

dorodnic avatar Jan 09 '19 15:01 dorodnic

i tried what you wrote :

rs2::pipeline p; auto prof = p.start(); rs2::device dev = prof.get_device(); auto advanced = dev.as<advanced_mode>(); advanced.load_json(str);

but the compiler can not identify "advanced_mode" in (auto advanced = dev.as<advanced_mode>();).

i use ralsense D435 and C++ and i included (rs_advanced_mode.hpp)

thank you

Medo91code avatar Jan 09 '19 16:01 Medo91code

For hole filling, look up:

rs2::hole_filling_filter holeFilter;
...
...
data = pipe->wait_for_frames().apply_filter(holeFilter);

HippoEug avatar Jan 10 '19 02:01 HippoEug

@Medo91code You might need using namespace rs2;

dorodnic avatar Jan 10 '19 10:01 dorodnic

@dorodnic

You might need using namespace rs2;

i used it , but nothing happens ( dev.as<advanced_mode>(); still doesn't work).

@HippoEug

data = pipe->wait_for_frames().apply_filter(holeFilter);

it works but how can i add to it the choice (fill from left)?

Medo91code avatar Jan 13 '19 22:01 Medo91code

That I do not know, maybe @dorodnic can give some insights 👍

HippoEug avatar Jan 14 '19 04:01 HippoEug

For advanced mode, you need namespace rs400 - rs_advanced_mode.hpp:10 Please review the linked post-processing example to learn how to configure filter settings.

dorodnic avatar Jan 14 '19 08:01 dorodnic

[Please Ignore - RealSense system comment]

[Please Ignore - RealSense system comment]

[Please Ignore - RealSense system comment]