opencv相机标定

梧桐栖鸦
博客专家认证
2016-06-12 09:07:56
已知像点的世界坐标和图像坐标怎么对相机内参和外参进行标定?怎么求M矩阵?findFundamentalMat()出错,
...全文
201 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
shiter 2016-06-15
  • 打赏
  • 举报
回复
http://docs.opencv.org/2.4/modules/calib3d/doc/camera_calibration_and_3d_reconstruction.html?highlight=findfundamentalmat#cv.FindFundamentalMat

// Example. Estimation of fundamental matrix using the RANSAC algorithm
int point_count = 100;
vector<Point2f> points1(point_count);
vector<Point2f> points2(point_count);

// initialize the points here ... */
for( int i = 0; i < point_count; i++ )
{
    points1[i] = ...;
    points2[i] = ...;
}

Mat fundamental_matrix =
 findFundamentalMat(points1, points2, FM_RANSAC, 3, 0.99);

shiter 2016-06-15
  • 打赏
  • 举报
回复
Calculates a fundamental matrix from the corresponding points in two images. C++: Mat findFundamentalMat(InputArray points1, InputArray points2, int method=FM_RANSAC, double param1=3., double param2=0.99, OutputArray mask=noArray() ) Python: cv2.findFundamentalMat(points1, points2[, method[, param1[, param2[, mask]]]]) → retval, mask C: int cvFindFundamentalMat(const CvMat* points1, const CvMat* points2, CvMat* fundamental_matrix, int method=CV_FM_RANSAC, double param1=3., double param2=0.99, CvMat* status=NULL ) Python: cv.FindFundamentalMat(points1, points2, fundamentalMatrix, method=CV_FM_RANSAC, param1=1., param2=0.99, status=None) → retval Parameters: points1 – Array of N points from the first image. The point coordinates should be floating-point (single or double precision). points2 – Array of the second image points of the same size and format as points1 . method – Method for computing a fundamental matrix. CV_FM_7POINT for a 7-point algorithm. N = 7 CV_FM_8POINT for an 8-point algorithm. N \ge 8 CV_FM_RANSAC for the RANSAC algorithm. N \ge 8 CV_FM_LMEDS for the LMedS algorithm. N \ge 8 param1 – Parameter used for RANSAC. It is the maximum distance from a point to an epipolar line in pixels, beyond which the point is considered an outlier and is not used for computing the final fundamental matrix. It can be set to something like 1-3, depending on the accuracy of the point localization, image resolution, and the image noise. param2 – Parameter used for the RANSAC or LMedS methods only. It specifies a desirable level of confidence (probability) that the estimated matrix is correct. mask – Output array of N elements, every element of which is set to 0 for outliers and to 1 for the other points. The array is computed only in the RANSAC and LMedS methods. For other methods, it is set to all 1’s. The epipolar geometry is described by the following equation: [p_2; 1]^T F [p_1; 1] = 0 where F is a fundamental matrix, p_1 and p_2 are corresponding points in the first and the second images, respectively. The function calculates the fundamental matrix using one of four methods listed above and returns the found fundamental matrix. Normally just one matrix is found. But in case of the 7-point algorithm, the function may return up to 3 solutions ( 9 \times 3 matrix that stores all 3 matrices sequentially). The calculated fundamental matrix may be passed further to computeCorrespondEpilines() that finds the epipolar lines corresponding to the specified points. It can also be passed to stereoRectifyUncalibrated() to compute the rectification transformation.
赵4老师 2016-06-13
  • 打赏
  • 举报
回复
建议楼主先编译链接调试OpenCV自带的相关例子代码。

19,469

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 图形处理/算法
社区管理员
  • 图形处理/算法社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧