Adaptive Spatio-temporal KNN Filter
Motion Detection
If two pixel’s absolute difference is smaller than THRM, regarding it as no motion. Extended test is that if least two neighbors of current pixel, considering it as motion. First check frame t and frame (t-1), if no motion, check frame (t-1) and frame (t-2).
Spatial Detail Detection
If more than THRS, regarding it as edge.
Else if satisfy:
Noise Estimation
noise:
max is the value of highest value of edge histogram.