笔者经验不足,把cv::fisheye::calibrate直接改为cv::calibrateCamera后,遇到的几个问题,当时走了很多弯路,为了减少同行们在查阅相关资料时浪费的时间,笔者做了如下整理。
1、 参数的定义问题。
需要注意的是distortion_coeffs需要定义为mat类型,否则会报错。
以下代码展示了主要的参数定义类型
在fisheye::calibrate中:
vector<vector<Point3f>> object_Points;
vector<vector<Point2f>> corners_Seq;
Size image_size;
cv::Matx33d intrinsic_matrix;
cv::Vec4d distortion_coeffs;
std::vector<cv::Vec3d> rotation_vectors;
std::vector<cv::Vec3d> translation_vectors;
……
fisheye::calibrate