K-nearest Neighbor based Algorithm for Adaptive Bilateral Filtering