add distance between point and rect ,add opencv