ToF giving false value for some objects far than 2 meter

screenshot-2023-12-27_00:54:31
This one shows that the wall is near, but it is far, as you can see in the RGB image.
screenshot-2023-12-27_00:54:42
But when ToF is moved a bit near the wall, the distance value for the wall becomes correct.

So, is there any way to apply any filter on this kind of outlier behaviour? How can we avoid this kind of thing?
I tested it on Xavier NX with arducam-tof-sdk 0.1.2.

Hi @hector

May I know how far between the camera and the wall? Is it over 2/4m?

In the first photo, the distance is around 3 meters, and in the second photo, the distance is approximately 2 meters.

Hi
Please uncomment the sentence below in the code.

    // tof.setControl(CameraCtrl::RANGE,MAX_DISTANCE);

image

Then rebuild the project to update the status. This modification will change to 4m mode.

This data was obtained in 4 meter mode … it does not happen all the time. I tried the same test with other objects it works okay with them … but with the wall, it is behaving in this way. Anyways I will recheck and let you know.

Beyond 3.5 meters, this noise comes up, as shown in photo 1 in the original post. What is a possible way to remove those outliers since that outlier shows a distance value of around 1 meter?

@Dion Please let us know if there is anything that can be done.

Hi
For 4m mode, the maximum measurement range is up to 3.5m instead of 4m. The test result is in line with expectations. We need to control the measuring distance within 3.5m.

I understand that part; if I am pointing at an object not far from 3.5m, the values provided by ToF are good. But if I mount this ToF on a mobile robot, I have no control over where to point, and since it gives false values beyond 3.5 meters … the robot thinks that the obstacle is nearby and the robot goes crazy. If possible, how can we filter out those false values?

Hi @hector
You can add two sentences below on the code to filter out those false values. If the false values can not be filtered throughly, you should increse the value 30, ie. 40(you need to debug on your side).

 if(mask == 0)
            *(phase_image_ptr + i) = MAX_DISTANCE;

1 Like

Thanks for the reply; I quickly tested the changes you mentioned. It produces a less noisy image.
I will test it thoroughly and will let you know.