Items with no label
3335 Discussions

MEASURE SIZE OF THE BOX WITH D415

ldao01
Beginner
1,808 Views

Hi, i am working with small project is measure dimension of the box with the D415 camera. I have test the rs-measure code and modify to work with own purpose but i still have some problem about holes.

Because the camera can not see everything so the edge of the box is fill by black pixel(zero depth)(example image below) , so when i catch the corner of the box, the result of distance between 2 corner is not accurate, the dimension error around 1-5(cm).

So how can i approximately the holes to get the most accurate depth of the zero depth pixel?

Hope to see your answer soonUntitled.png

0 Kudos
5 Replies
ldao01
Beginner
1,413 Views

Here is my project i am working on, i want to calculate the distance between the ( blue point, green point) and ( green point, red point ) , because the point is in the black pixel(zero depth) so it give me the wrong result.

 

1.png

0 Kudos
MartyG
Honored Contributor III
1,413 Views

The black border around the boxes looks like a camera phenomenon called Occlusion. You may be able to reduce this by using one of the SDK's post-processing filters called 'Hole-Filling Filter'. In the RealSense Viewer, you can activate this filter by expanding open the 'Post-Processing' section of the options side-panel. If the 'Hole Filling Filter' option has a red icon beside it (indicating that it is off), left-click on the icon to turn it blue and add hole-filling processing to the image.

 

You can add post-processing filters to your own program via script code.

 

Please left-click on the image below to view it in full size.

 

1.png

0 Kudos
ldao01
Beginner
1,413 Views

Thank for your respond, i will test what you have said.

In my code i also add rs2::hole_filtering , but i can see it imporve at all. Any way thank you very much:))

0 Kudos
MartyG
Honored Contributor III
1,413 Views

You are very welcome. :) Some advice about using the hole-filling filter in code is given in the link below. It advises that (a) the hole-filling filter can only be used with depth frames, and (b) if you are using a colorizer, it should be applied after the hole-filling filter.

 

https://github.com/IntelRealSense/librealsense/issues/4296#issuecomment-507218858

 

0 Kudos
ldao01
Beginner
1,413 Views

Hi MartyG, i have apply what you suggest and it work, so thank you very much for that:))

But i have another question, if i can fill the black hole, as i know when you apply fill holes, you can not get the distance right, it get you some error, so do you know any document talk about it, so when i apply this method, i can subtract this error.

Hope to see your answer soon

0 Kudos
Reply