Improve the stability of detection

Hello guys,

I try to find the most closet pixel(in special area) to my camera by searching the lowest value of depth data I got from kinectV2.

But the pixel I got was very unstable,it’s change every update in sometimes.

How can I improve this kind of problem?

Thank you all!

Hey @BigOplO , some basic statistics can be helpful with “noisy data”.

You could try using a moving average of values. Values from a finite period could be stored in a container (std::deque or std::vector) and averaged. The program could do something when a new value exceeds the average by a certain threshold before it replaces the oldest value in the container. The average itself can also be used in the program, and it will stay somewhat constant for values that all fall within the same distribution.

A similar approach could compare 2 (or more) moving averages, which is sometimes helpful to determine a change in trend (say the gradual lightening of a pixel).

You could also compute a standard deviation of an average of values, which gives you an idea of how those values are distributed, and if any particular value lies outside of that distribution.


Hi @BigOplO,

I often blur the depth frame a little bit or I draw it into a frame buffer to play with dissipation. In both cases I decrease the accurancy of the contours bit I get more stable depth values in to the areas.

Hope it can help you