How to reduce "bridges" between spherical objects in depth image
I'm trying to use a D430 for measuring the size of spherical objects (eggs on a table). The camera is vertically above the objects, approximately 30 cm away. I have encountered the problem that there a "bridges" in the depth image between the eggs.
What is the best configuration to remove/reduce these bridges? The main problem is that in the bridge regions, the depth value seems very inaccurate. If they were sharp "trenches" like they are physically, it would be easy enough to remove them through image processing. (see my attempt to draw it in the following image)
The first picture was captured with the preset "Medium Density" which I have found to work best for the general surface, except the bridges. I have played around with different other presets, but I have not accomplished to remove the bridges while still keeping an acceptable area of the objects.
Hi Mkoelker You could try increasing the value of the Advanced Controls setting DS Second Peak Threshold, which influences how much confidence is placed in the accuracy of depth values. Reducing the value can fill in holes by making the criteria for acceptable depth values less strict, whilst increasing the value above its default of '325' creates more holes by being more strict with accuracy. Increasing the Second Peak threshold may therefore open up gaps between the eggs if the depth values in those areas are inaccurate.
I tested with two pebbles placed at the same distance apart as your eggs, and increasing the DS Second Peak Threshold value opened black areas of separation between the pebbles, whereas lowering the value bridged them together like in the above image.
You can find the option by expanding open the Depth Control sub-category of Advanced Controls in the Viewer's options side-panel.
thanks for your response. I have tried to vary the DS Second Peak Threshold parameter as you suggested, but unfortunately it didn't have the desired effect. The bridges persist, albeit they are a little bit more narrow. See the following, I have tried different threshold values (0, 325, 750, 1023). The effect is much more noticable on the shadow outline than on the bridges.
Because the eggs are physically touching at their edges, it will make it more difficult to perceive the eggs as separate objects.
Next, please try increasing the Gain setting above the default value of '16' to introduce depth noise into the image and expand the black areas between eggs. Gain can be found under Stereo Module > Controls
Unfortunately it is not possible to physically separate the eggs for this application. The eggs may be arranged in all kind of ways randomly. Ideally I would like to remove the bridges entirely through camera configuration, but I'm not sure if that's possible.
If I can get the bridges to be much more narrow and sharp, then there are computer vision techniques to detect and remove them.
The image below shows a (binarized) depth image of chicken eggs. The image is taken from a scientific paper where they used a different brand of depth camera. In this image, the bridges are very narrow and the egg shape is very clear. This makes the bridges easy to detect and remove. I don't have acess to the underlying depth image, so I don't know if the bridges are only narrow because it's been binarized.
Compared to the depth image of the D430:
This image is also binarized through thresholding. It's possible to reduce the bridges to a certain extent, since they lie lower than most of the egg. I could increase the threshold to the point where are bridges are gone, but then I also lose significant parts of the eggs surface, especially for eggs that are smaller in diameter. That's why i would like to solve this issue at the root and not through image processing.
The gain setting helped a little bit. In combination with the DS second peak threshold, it is possible to make the bridges a bit narrower. However, the image is nowhere near as clean as the image from the paper.
If changing camera model is an option then using the D405 model may provide better results, as it is designed for high accuracy, high quality images at close range (7 cm to 50 cm).
If you need to use your current camera then the High Accuracy preset can create a thick black outline around objects.
Please sign in to leave a comment.