Peak detection
noises
In order to count peaks, we need to put the original plots into a matrix. Because the pixel of the picture captured by the depth camera is too low, we cannot get a picture without any noise. So we need to cancel these noises.
We have used two filters to cancel noise:
The first one is a matlab function called wden, which performs an automatic de-noising process of a one-dimensional signal using wavelets.
The second one is designed by ourselves. If a point is higher than the point before it and is also higher than the point after it, or if a point is lower than the point before it and is also lower than the point after it, then take the average of the y values of the former and later points. And change the y value of the original point to this value. And we use this filter for five times to cancel more noise.
Finally, we defined our peak as a point which is higher than the six points before it and is also higher than the six points after it. This is also to cancel noise.