add knn algo for digital recognize.