Sped up process_frame() by only finding the distance to the top keypoints and by computing all neighbors at once