mirror of
https://github.com/opencv/opencv.git
synced 2025-06-28 07:23:30 +08:00
fix calib3d changes in #6836 plus some others
This commit is contained in:
parent
df9120768d
commit
fa42a1cfc2
@ -1210,8 +1210,8 @@ CV_IMPL void cvInitIntrinsicParams2D( const CvMat* objectPoints,
|
|||||||
|
|
||||||
matA.reset(cvCreateMat( 2*nimages, 2, CV_64F ));
|
matA.reset(cvCreateMat( 2*nimages, 2, CV_64F ));
|
||||||
_b.reset(cvCreateMat( 2*nimages, 1, CV_64F ));
|
_b.reset(cvCreateMat( 2*nimages, 1, CV_64F ));
|
||||||
a[2] = (!imageSize.width) ? 0.5 : (imageSize.width - 1)*0.5;
|
a[2] = (!imageSize.width) ? 0.5 : (imageSize.width)*0.5;
|
||||||
a[5] = (!imageSize.height) ? 0.5 : (imageSize.height - 1)*0.5;
|
a[5] = (!imageSize.height) ? 0.5 : (imageSize.height)*0.5;
|
||||||
_allH.reset(cvCreateMat( nimages, 9, CV_64F ));
|
_allH.reset(cvCreateMat( nimages, 9, CV_64F ));
|
||||||
|
|
||||||
// extract vanishing points in order to obtain initial value for the focal length
|
// extract vanishing points in order to obtain initial value for the focal length
|
||||||
@ -2494,8 +2494,8 @@ void cvGetOptimalNewCameraMatrix( const CvMat* cameraMatrix, const CvMat* distCo
|
|||||||
{
|
{
|
||||||
double cx0 = M[0][2];
|
double cx0 = M[0][2];
|
||||||
double cy0 = M[1][2];
|
double cy0 = M[1][2];
|
||||||
double cx = (newImgSize.width-1)*0.5;
|
double cx = (newImgSize.width)*0.5;
|
||||||
double cy = (newImgSize.height-1)*0.5;
|
double cy = (newImgSize.height)*0.5;
|
||||||
|
|
||||||
icvGetRectangles( cameraMatrix, distCoeffs, 0, cameraMatrix, imgSize, inner, outer );
|
icvGetRectangles( cameraMatrix, distCoeffs, 0, cameraMatrix, imgSize, inner, outer );
|
||||||
double s0 = std::max(std::max(std::max((double)cx/(cx0 - inner.x), (double)cy/(cy0 - inner.y)),
|
double s0 = std::max(std::max(std::max((double)cx/(cx0 - inner.x), (double)cy/(cy0 - inner.y)),
|
||||||
@ -2529,14 +2529,14 @@ void cvGetOptimalNewCameraMatrix( const CvMat* cameraMatrix, const CvMat* distCo
|
|||||||
icvGetRectangles( cameraMatrix, distCoeffs, 0, 0, imgSize, inner, outer );
|
icvGetRectangles( cameraMatrix, distCoeffs, 0, 0, imgSize, inner, outer );
|
||||||
|
|
||||||
// Projection mapping inner rectangle to viewport
|
// Projection mapping inner rectangle to viewport
|
||||||
double fx0 = (newImgSize.width - 1) / inner.width;
|
double fx0 = (newImgSize.width) / inner.width;
|
||||||
double fy0 = (newImgSize.height - 1) / inner.height;
|
double fy0 = (newImgSize.height) / inner.height;
|
||||||
double cx0 = -fx0 * inner.x;
|
double cx0 = -fx0 * inner.x;
|
||||||
double cy0 = -fy0 * inner.y;
|
double cy0 = -fy0 * inner.y;
|
||||||
|
|
||||||
// Projection mapping outer rectangle to viewport
|
// Projection mapping outer rectangle to viewport
|
||||||
double fx1 = (newImgSize.width - 1) / outer.width;
|
double fx1 = (newImgSize.width) / outer.width;
|
||||||
double fy1 = (newImgSize.height - 1) / outer.height;
|
double fy1 = (newImgSize.height) / outer.height;
|
||||||
double cx1 = -fx1 * outer.x;
|
double cx1 = -fx1 * outer.x;
|
||||||
double cy1 = -fy1 * outer.y;
|
double cy1 = -fy1 * outer.y;
|
||||||
|
|
||||||
@ -2600,8 +2600,8 @@ CV_IMPL int cvStereoRectifyUncalibrated(
|
|||||||
cvGEMM( &U, &W, 1, 0, 0, &W, CV_GEMM_A_T );
|
cvGEMM( &U, &W, 1, 0, 0, &W, CV_GEMM_A_T );
|
||||||
cvMatMul( &W, &V, &F );
|
cvMatMul( &W, &V, &F );
|
||||||
|
|
||||||
cx = cvRound( (imgSize.width-1)*0.5 );
|
cx = cvRound( (imgSize.width)*0.5 );
|
||||||
cy = cvRound( (imgSize.height-1)*0.5 );
|
cy = cvRound( (imgSize.height)*0.5 );
|
||||||
|
|
||||||
cvZero( _H1 );
|
cvZero( _H1 );
|
||||||
cvZero( _H2 );
|
cvZero( _H2 );
|
||||||
|
Loading…
Reference in New Issue
Block a user