Optimize keypoints_to_vector for multicores.