mirror of
https://github.com/opencv/opencv.git
synced 2026-07-31 00:03:03 +04:00
Merge pull request #7854 from alalek:backports_2016
(2.4) Backports from master branch (#7854)
This commit is contained in:
committed by
GitHub
parent
49e6bb2993
commit
cc09f5a7de
@@ -1014,7 +1014,7 @@ CV_IMPL void cvProjectPoints2( const CvMat* objectPoints,
|
||||
{
|
||||
if( dpdc_p )
|
||||
{
|
||||
dpdc_p[0] = 1; dpdc_p[1] = 0;
|
||||
dpdc_p[0] = 1; dpdc_p[1] = 0; // dp_xdc_x; dp_xdc_y
|
||||
dpdc_p[dpdc_step] = 0;
|
||||
dpdc_p[dpdc_step+1] = 1;
|
||||
dpdc_p += dpdc_step*2;
|
||||
@@ -1024,7 +1024,7 @@ CV_IMPL void cvProjectPoints2( const CvMat* objectPoints,
|
||||
{
|
||||
if( fixedAspectRatio )
|
||||
{
|
||||
dpdf_p[0] = 0; dpdf_p[1] = xd*aspectRatio;
|
||||
dpdf_p[0] = 0; dpdf_p[1] = xd*aspectRatio; // dp_xdf_x; dp_xdf_y
|
||||
dpdf_p[dpdf_step] = 0;
|
||||
dpdf_p[dpdf_step+1] = yd;
|
||||
}
|
||||
@@ -1614,6 +1614,8 @@ CV_IMPL double cvCalibrateCamera2( const CvMat* objectPoints,
|
||||
param[4] = k[0]; param[5] = k[1]; param[6] = k[2]; param[7] = k[3];
|
||||
param[8] = k[4]; param[9] = k[5]; param[10] = k[6]; param[11] = k[7];
|
||||
|
||||
if(flags & CALIB_FIX_ASPECT_RATIO)
|
||||
mask[0] = 0;
|
||||
if( flags & CV_CALIB_FIX_FOCAL_LENGTH )
|
||||
mask[0] = mask[1] = 0;
|
||||
if( flags & CV_CALIB_FIX_PRINCIPAL_POINT )
|
||||
|
||||
@@ -369,6 +369,12 @@ void cv::fisheye::undistortPoints( InputArray distorted, OutputArray undistorted
|
||||
double scale = 1.0;
|
||||
|
||||
double theta_d = sqrt(pw[0]*pw[0] + pw[1]*pw[1]);
|
||||
|
||||
// the current camera model is only valid up to 180° FOV
|
||||
// for larger FOV the loop below does not converge
|
||||
// clip values so we still get plausible results for super fisheye images > 180°
|
||||
theta_d = min(max(-CV_PI/2., theta_d), CV_PI/2.);
|
||||
|
||||
if (theta_d > 1e-8)
|
||||
{
|
||||
// compensate distortion iteratively
|
||||
|
||||
Reference in New Issue
Block a user