librealsense icon indicating copy to clipboard operation
librealsense copied to clipboard

I have a problem in csharp library

Open HungLearner opened this issue 8 years ago • 6 comments

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?

HungLearner avatar Mar 20 '18 07:03 HungLearner

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.

dorodnic avatar Mar 20 '18 12:03 dorodnic

oh.... That's true!!! Thanks you!

HungLearner avatar Mar 20 '18 12:03 HungLearner

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.

dorodnic avatar Mar 20 '18 12:03 dorodnic

OK, I will try. Thanks again~

HungLearner avatar Mar 20 '18 13:03 HungLearner

Could someone please post a sample C# code

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.

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.

maxccgh avatar Nov 15 '18 04:11 maxccgh

Could someone please post a sample C# code

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.

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;
//-----------------------------------------------------

HungLearner avatar Nov 22 '18 23:11 HungLearner