mirror of
https://github.com/opencv/opencv.git
synced 2025-06-13 04:52:53 +08:00
clean up unused #if
This commit is contained in:
parent
be0865406f
commit
f1aae52daf
@ -313,11 +313,7 @@ void CvLevMarq::step()
|
|||||||
if( !err )
|
if( !err )
|
||||||
completeSymm( _JtJN, completeSymmFlag );
|
completeSymm( _JtJN, completeSymmFlag );
|
||||||
|
|
||||||
#if 1
|
|
||||||
_JtJN.diag() *= 1. + lambda;
|
_JtJN.diag() *= 1. + lambda;
|
||||||
#else
|
|
||||||
_JtJN.diag() += lambda;
|
|
||||||
#endif
|
|
||||||
solve(_JtJN, _JtErr, nonzero_param, solveMethod);
|
solve(_JtJN, _JtErr, nonzero_param, solveMethod);
|
||||||
|
|
||||||
int j = 0;
|
int j = 0;
|
||||||
|
@ -542,19 +542,6 @@ void cv::fisheye::estimateNewCameraMatrixForUndistortRectify(InputArray K, Input
|
|||||||
pptr[6] = Vec2d(0, h);
|
pptr[6] = Vec2d(0, h);
|
||||||
pptr[7] = Vec2d(0, h/2);
|
pptr[7] = Vec2d(0, h/2);
|
||||||
|
|
||||||
#if 0
|
|
||||||
const int N = 10;
|
|
||||||
cv::Mat points(1, N * 4, CV_64FC2);
|
|
||||||
Vec2d* pptr = points.ptr<Vec2d>();
|
|
||||||
for(int i = 0, k = 0; i < 10; ++i)
|
|
||||||
{
|
|
||||||
pptr[k++] = Vec2d(w/2, 0) - Vec2d(w/8, 0) + Vec2d(w/4/N*i, 0);
|
|
||||||
pptr[k++] = Vec2d(w/2, h-1) - Vec2d(w/8, h-1) + Vec2d(w/4/N*i, h-1);
|
|
||||||
pptr[k++] = Vec2d(0, h/2) - Vec2d(0, h/8) + Vec2d(0, h/4/N*i);
|
|
||||||
pptr[k++] = Vec2d(w-1, h/2) - Vec2d(w-1, h/8) + Vec2d(w-1, h/4/N*i);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
fisheye::undistortPoints(points, points, K, D, R);
|
fisheye::undistortPoints(points, points, K, D, R);
|
||||||
cv::Scalar center_mass = mean(points);
|
cv::Scalar center_mass = mean(points);
|
||||||
cv::Vec2d cn(center_mass.val);
|
cv::Vec2d cn(center_mass.val);
|
||||||
@ -580,17 +567,6 @@ void cv::fisheye::estimateNewCameraMatrixForUndistortRectify(InputArray K, Input
|
|||||||
maxx = std::max(maxx, std::abs(pptr[i][0]-cn[0]));
|
maxx = std::max(maxx, std::abs(pptr[i][0]-cn[0]));
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
double minx = -DBL_MAX, miny = -DBL_MAX, maxx = DBL_MAX, maxy = DBL_MAX;
|
|
||||||
for(size_t i = 0; i < points.total(); ++i)
|
|
||||||
{
|
|
||||||
if (i % 4 == 0) miny = std::max(miny, pptr[i][1]);
|
|
||||||
if (i % 4 == 1) maxy = std::min(maxy, pptr[i][1]);
|
|
||||||
if (i % 4 == 2) minx = std::max(minx, pptr[i][0]);
|
|
||||||
if (i % 4 == 3) maxx = std::min(maxx, pptr[i][0]);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
double f1 = w * 0.5/(minx);
|
double f1 = w * 0.5/(minx);
|
||||||
double f2 = w * 0.5/(maxx);
|
double f2 = w * 0.5/(maxx);
|
||||||
double f3 = h * 0.5 * aspect_ratio/(miny);
|
double f3 = h * 0.5 * aspect_ratio/(miny);
|
||||||
|
@ -114,52 +114,6 @@ cvTriangulatePoints(CvMat* projMatr1, CvMat* projMatr2, CvMat* projPoints1, CvMa
|
|||||||
cvmSet(points4D,2,i,matrV(3,2));/* Z */
|
cvmSet(points4D,2,i,matrV(3,2));/* Z */
|
||||||
cvmSet(points4D,3,i,matrV(3,3));/* W */
|
cvmSet(points4D,3,i,matrV(3,3));/* W */
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
double err = 0;
|
|
||||||
/* Points was reconstructed. Try to reproject points */
|
|
||||||
/* We can compute reprojection error if need */
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
CvMat point3D;
|
|
||||||
double point3D_dat[4];
|
|
||||||
point3D = cvMat(4,1,CV_64F,point3D_dat);
|
|
||||||
|
|
||||||
CvMat point2D;
|
|
||||||
double point2D_dat[3];
|
|
||||||
point2D = cvMat(3,1,CV_64F,point2D_dat);
|
|
||||||
|
|
||||||
for( i = 0; i < numPoints; i++ )
|
|
||||||
{
|
|
||||||
double W = cvmGet(points4D,3,i);
|
|
||||||
|
|
||||||
point3D_dat[0] = cvmGet(points4D,0,i)/W;
|
|
||||||
point3D_dat[1] = cvmGet(points4D,1,i)/W;
|
|
||||||
point3D_dat[2] = cvmGet(points4D,2,i)/W;
|
|
||||||
point3D_dat[3] = 1;
|
|
||||||
|
|
||||||
/* !!! Project this point for each camera */
|
|
||||||
for( int currCamera = 0; currCamera < 2; currCamera++ )
|
|
||||||
{
|
|
||||||
cvMatMul(projMatrs[currCamera], &point3D, &point2D);
|
|
||||||
|
|
||||||
float x,y;
|
|
||||||
float xr,yr,wr;
|
|
||||||
x = (float)cvmGet(projPoints[currCamera],0,i);
|
|
||||||
y = (float)cvmGet(projPoints[currCamera],1,i);
|
|
||||||
|
|
||||||
wr = (float)point2D_dat[2];
|
|
||||||
xr = (float)(point2D_dat[0]/wr);
|
|
||||||
yr = (float)(point2D_dat[1]/wr);
|
|
||||||
|
|
||||||
float deltaX,deltaY;
|
|
||||||
deltaX = (float)fabs(x-xr);
|
|
||||||
deltaY = (float)fabs(y-yr);
|
|
||||||
err += deltaX*deltaX + deltaY*deltaY;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -268,14 +268,6 @@ void CV_ChessboardDetectorTest::run_batch( const string& filename )
|
|||||||
|
|
||||||
#ifndef WRITE_POINTS
|
#ifndef WRITE_POINTS
|
||||||
double err = calcError(v, expected);
|
double err = calcError(v, expected);
|
||||||
#if 0
|
|
||||||
if( err > rough_success_error_level )
|
|
||||||
{
|
|
||||||
ts.printf( cvtest::TS::LOG, "bad accuracy of corner guesses\n" );
|
|
||||||
ts.set_failed_test_info( cvtest::TS::FAIL_BAD_ACCURACY );
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
max_rough_error = MAX( max_rough_error, err );
|
max_rough_error = MAX( max_rough_error, err );
|
||||||
#endif
|
#endif
|
||||||
if( pattern == CHESSBOARD )
|
if( pattern == CHESSBOARD )
|
||||||
@ -287,14 +279,12 @@ void CV_ChessboardDetectorTest::run_batch( const string& filename )
|
|||||||
err = calcError(v, expected);
|
err = calcError(v, expected);
|
||||||
sum_error += err;
|
sum_error += err;
|
||||||
count++;
|
count++;
|
||||||
#if 1
|
|
||||||
if( err > precise_success_error_level )
|
if( err > precise_success_error_level )
|
||||||
{
|
{
|
||||||
ts->printf( cvtest::TS::LOG, "Image %s: bad accuracy of adjusted corners %f\n", img_file.c_str(), err );
|
ts->printf( cvtest::TS::LOG, "Image %s: bad accuracy of adjusted corners %f\n", img_file.c_str(), err );
|
||||||
ts->set_failed_test_info( cvtest::TS::FAIL_BAD_ACCURACY );
|
ts->set_failed_test_info( cvtest::TS::FAIL_BAD_ACCURACY );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
ts->printf(cvtest::TS::LOG, "Error on %s is %f\n", img_file.c_str(), err);
|
ts->printf(cvtest::TS::LOG, "Error on %s is %f\n", img_file.c_str(), err);
|
||||||
max_precise_error = MAX( max_precise_error, err );
|
max_precise_error = MAX( max_precise_error, err );
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user