I have a problem in csharp library
In d415 tools, i can use "Holes Fill" to fix my depth image, but i can't change this value on csharp library, why?
This is my code: profile.Device.Sensors[0].Options[Option.HolesFill].Supported
So, i get "False" output, it's mean not support?
Hi @HungLearner
It's a bit more complicated then that.
Please fetch the latest SDK from source and build the C# project under wrappers directory (just to make sure we are working with the same version).
Then create SpatialFilter object like this:
filter = new SpatialFilter();
filter.Options[Option.HolesFill].Value = 5.0f;
If you are working with capture example, modify the main loop by adding a call to ApplyFilter:
var frames = pipeline.WaitForFrames();
var filtered_depth = filter.ApplyFilter(frames.DepthFrame);
var colorized_depth = colorizer.Colorize(filtered_depth);
filtered_depth.Dispose();
UploadImage(imgDepth, colorized_depth);
Then you should see the effect of hole filling. In this example, I have set filter intensity to max, just to demonstrate, but you can play with the Value to get better effect for you.
Of course, the built-in hole-filling algorithm is not the best you can do, but rather something optimized for fast processing.
oh.... That's true!!! Thanks you!
Also, I would recommend to play with Visual Preset option on depth sensor. Built-in visual presets invoke hardware hole-filling when you prioritise dense depth.
OK, I will try. Thanks again~
Could someone please post a sample C# code
Also, I would recommend to play with
Visual Presetoption on depth sensor. Built-in visual presets invoke hardware hole-filling when you prioritise dense depth.
Could you please post a sample C# code snippet to show how we can use Visual Presets ? I wish to set the depthClampMin and depthClampmax values from C#. I cant seem to find a way to do this. I have built the sdk including CSharp code as well. Any help will be appreciated.
Could someone please post a sample C# code
Also, I would recommend to play with
Visual Presetoption on depth sensor. Built-in visual presets invoke hardware hole-filling when you prioritise dense depth.Could you please post a sample C# code snippet to show how we can use Visual Presets ? I wish to set the depthClampMin and depthClampmax values from C#. I cant seem to find a way to do this. I have built the sdk including CSharp code as well. Any help will be appreciated.
Hi, maxccgh ~
Sorry, I'm delaying to answer your question.
You can try these methods to solve the problem.
Profile.Device.Sensors[0].Options[Option.VisualPreset].Value = 4.0f;
//---------------Presets---------------------
Colorize.Options[Option.VisualPreset].Value = 1.0f;
//----------------------------------------------
//--------------Color Format---------------------
Colorize.Options[Option.ColorScheme].Value = 2.0f;
//-----------------------------------------------------