Modify neighborhood function in order to work with cv::Point.