improved test build time
This commit is contained in:
parent
678f392569
commit
54ef68e7f4
@ -41,6 +41,8 @@
|
||||
|
||||
#include "cvtest.h"
|
||||
|
||||
#if 0
|
||||
|
||||
#if defined WIN32 || defined _WIN32
|
||||
#include "direct.h"
|
||||
#else
|
||||
@ -427,7 +429,7 @@ protected:
|
||||
|
||||
std::vector<Camera*> m_cameras;
|
||||
RigidBody* m_body;
|
||||
std::vector<CvPoint2D64d*> m_image_points;
|
||||
std::vector<CvPoint2D64f*> m_image_points;
|
||||
std::vector<int*> m_point_visibility;
|
||||
float noise;
|
||||
|
||||
@ -1157,15 +1159,15 @@ void CV_BundleAdjustmentTest::run( int start_from )
|
||||
int numImages;
|
||||
CvSize etalonSize;
|
||||
|
||||
CvPoint2D64d* imagePoints;
|
||||
CvPoint3D64d* objectPoints;
|
||||
CvPoint2D64d* reprojectPoints;
|
||||
CvPoint2D64f* imagePoints;
|
||||
CvPoint3D64f* objectPoints;
|
||||
CvPoint2D64f* reprojectPoints;
|
||||
|
||||
CvVect64d transVects;
|
||||
CvMatr64d rotMatrs;
|
||||
double* transVects;
|
||||
double* rotMatrs;
|
||||
|
||||
CvVect64d goodTransVects;
|
||||
CvMatr64d goodRotMatrs;
|
||||
double* goodTransVects;
|
||||
double* goodRotMatrs;
|
||||
|
||||
double cameraMatrix[3*3];
|
||||
double distortion[4];
|
||||
@ -1278,14 +1280,14 @@ void CV_BundleAdjustmentTest::run( int start_from )
|
||||
}
|
||||
|
||||
/* Need to allocate memory */
|
||||
imagePoints = (CvPoint2D64d*)cvAlloc( numPoints *
|
||||
numImages * sizeof(CvPoint2D64d));
|
||||
imagePoints = (CvPoint2D64f*)cvAlloc( numPoints *
|
||||
numImages * sizeof(CvPoint2D64f));
|
||||
|
||||
objectPoints = (CvPoint3D64d*)cvAlloc( numPoints *
|
||||
numImages * sizeof(CvPoint3D64d));
|
||||
objectPoints = (CvPoint3D64f*)cvAlloc( numPoints *
|
||||
numImages * sizeof(CvPoint3D64f));
|
||||
|
||||
reprojectPoints = (CvPoint2D64d*)cvAlloc( numPoints *
|
||||
numImages * sizeof(CvPoint2D64d));
|
||||
reprojectPoints = (CvPoint2D64f*)cvAlloc( numPoints *
|
||||
numImages * sizeof(CvPoint2D64f));
|
||||
|
||||
/* Alloc memory for numbers */
|
||||
numbers = (int*)cvAlloc( numImages * sizeof(int));
|
||||
@ -1297,11 +1299,11 @@ void CV_BundleAdjustmentTest::run( int start_from )
|
||||
}
|
||||
|
||||
/* Allocate memory for translate vectors and rotmatrixs*/
|
||||
transVects = (CvVect64d)cvAlloc(3 * 1 * numImages * sizeof(double));
|
||||
rotMatrs = (CvMatr64d)cvAlloc(3 * 3 * numImages * sizeof(double));
|
||||
transVects = (double*)cvAlloc(3 * 1 * numImages * sizeof(double));
|
||||
rotMatrs = (double*)cvAlloc(3 * 3 * numImages * sizeof(double));
|
||||
|
||||
goodTransVects = (CvVect64d)cvAlloc(3 * 1 * numImages * sizeof(double));
|
||||
goodRotMatrs = (CvMatr64d)cvAlloc(3 * 3 * numImages * sizeof(double));
|
||||
goodTransVects = (double*)cvAlloc(3 * 1 * numImages * sizeof(double));
|
||||
goodRotMatrs = (double*)cvAlloc(3 * 3 * numImages * sizeof(double));
|
||||
|
||||
/* Read object points */
|
||||
i = 0;/* shift for current point */
|
||||
@ -1379,7 +1381,7 @@ void CV_BundleAdjustmentTest::run( int start_from )
|
||||
cameraMatrix[8] = 1.;
|
||||
|
||||
/* Now we can calibrate camera */
|
||||
cvCalibrateCamera_64d( numImages,
|
||||
cvCalibrateCamera_64f( numImages,
|
||||
numbers,
|
||||
imageSize,
|
||||
imagePoints,
|
||||
@ -1528,3 +1530,6 @@ _exit_:
|
||||
}
|
||||
|
||||
//CV_BundleAdjustmentTest bundleadjustment_test;
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -299,15 +299,15 @@ void CV_CameraCalibrationTest::run( int start_from )
|
||||
CvSize etalonSize;
|
||||
int numImages;
|
||||
|
||||
CvPoint2D64d* imagePoints;
|
||||
CvPoint3D64d* objectPoints;
|
||||
CvPoint2D64d* reprojectPoints;
|
||||
CvPoint2D64f* imagePoints;
|
||||
CvPoint3D64f* objectPoints;
|
||||
CvPoint2D64f* reprojectPoints;
|
||||
|
||||
CvVect64d transVects;
|
||||
CvMatr64d rotMatrs;
|
||||
double* transVects;
|
||||
double* rotMatrs;
|
||||
|
||||
CvVect64d goodTransVects;
|
||||
CvMatr64d goodRotMatrs;
|
||||
double* goodTransVects;
|
||||
double* goodRotMatrs;
|
||||
|
||||
double cameraMatrix[3*3];
|
||||
double distortion[5]={0,0,0,0,0};
|
||||
@ -399,14 +399,14 @@ void CV_CameraCalibrationTest::run( int start_from )
|
||||
}
|
||||
|
||||
/* Need to allocate memory */
|
||||
imagePoints = (CvPoint2D64d*)cvAlloc( numPoints *
|
||||
numImages * sizeof(CvPoint2D64d));
|
||||
imagePoints = (CvPoint2D64f*)cvAlloc( numPoints *
|
||||
numImages * sizeof(CvPoint2D64f));
|
||||
|
||||
objectPoints = (CvPoint3D64d*)cvAlloc( numPoints *
|
||||
numImages * sizeof(CvPoint3D64d));
|
||||
objectPoints = (CvPoint3D64f*)cvAlloc( numPoints *
|
||||
numImages * sizeof(CvPoint3D64f));
|
||||
|
||||
reprojectPoints = (CvPoint2D64d*)cvAlloc( numPoints *
|
||||
numImages * sizeof(CvPoint2D64d));
|
||||
reprojectPoints = (CvPoint2D64f*)cvAlloc( numPoints *
|
||||
numImages * sizeof(CvPoint2D64f));
|
||||
|
||||
/* Alloc memory for numbers */
|
||||
numbers = (int*)cvAlloc( numImages * sizeof(int));
|
||||
@ -418,11 +418,11 @@ void CV_CameraCalibrationTest::run( int start_from )
|
||||
}
|
||||
|
||||
/* Allocate memory for translate vectors and rotmatrixs*/
|
||||
transVects = (CvVect64d)cvAlloc(3 * 1 * numImages * sizeof(double));
|
||||
rotMatrs = (CvMatr64d)cvAlloc(3 * 3 * numImages * sizeof(double));
|
||||
transVects = (double*)cvAlloc(3 * 1 * numImages * sizeof(double));
|
||||
rotMatrs = (double*)cvAlloc(3 * 3 * numImages * sizeof(double));
|
||||
|
||||
goodTransVects = (CvVect64d)cvAlloc(3 * 1 * numImages * sizeof(double));
|
||||
goodRotMatrs = (CvMatr64d)cvAlloc(3 * 3 * numImages * sizeof(double));
|
||||
goodTransVects = (double*)cvAlloc(3 * 1 * numImages * sizeof(double));
|
||||
goodRotMatrs = (double*)cvAlloc(3 * 3 * numImages * sizeof(double));
|
||||
|
||||
/* Read object points */
|
||||
i = 0;/* shift for current point */
|
||||
@ -673,7 +673,7 @@ void CV_CameraCalibrationTest_C::calibrate( int imageCount, int* pointCounts,
|
||||
double* distortionCoeffs, double* cameraMatrix, double* translationVectors,
|
||||
double* rotationMatrices, int flags )
|
||||
{
|
||||
cvCalibrateCamera_64d( imageCount,
|
||||
cvCalibrateCamera_64d( imageCount,
|
||||
pointCounts,
|
||||
imageSize,
|
||||
imagePoints,
|
||||
|
@ -327,7 +327,7 @@ protected:
|
||||
Mat camMat_est = Mat::eye(3, 3, CV_64F), distCoeffs_est = Mat::zeros(1, 5, CV_64F);
|
||||
vector<Mat> rvecs_est, tvecs_est;
|
||||
|
||||
int flags = 0; //CALIB_FIX_K3; //CALIB_FIX_ASPECT_RATIO | | CALIB_ZERO_TANGENT_DIST;
|
||||
int flags = /*CV_CALIB_FIX_K3|*/CV_CALIB_FIX_K4|CV_CALIB_FIX_K5|CV_CALIB_FIX_K6; //CALIB_FIX_K3; //CALIB_FIX_ASPECT_RATIO | | CALIB_ZERO_TANGENT_DIST;
|
||||
double rep_error = calibrateCamera(objectPoints, imagePoints, imgSize, camMat_est, distCoeffs_est, rvecs_est, tvecs_est, flags);
|
||||
rep_error /= brdsNum * cornersSize.area();
|
||||
|
||||
|
@ -161,8 +161,8 @@ void CV_POSITTest::run( int start_from )
|
||||
for ( i = 0; i < 8; i++ )
|
||||
{
|
||||
float vec[3];
|
||||
CvMat Vec = cvMat( 3, 1, CV_MAT32F, vec );
|
||||
CvMat Obj_point = cvMat( 3, 1, CV_MAT32F, &obj_points[i].x );
|
||||
CvMat Vec = cvMat( 3, 1, CV_32F, vec );
|
||||
CvMat Obj_point = cvMat( 3, 1, CV_32F, &obj_points[i].x );
|
||||
|
||||
cvMatMul( true_rotation, &Obj_point, &Vec );
|
||||
|
||||
|
@ -117,7 +117,7 @@ protected:
|
||||
{
|
||||
typedef Vec<OutT, 3> out3d_t;
|
||||
|
||||
bool handleMissingValues = (int)theRNG() % 2 == 0;
|
||||
bool handleMissingValues = (unsigned)theRNG() % 2 == 0;
|
||||
|
||||
Mat_<InT> disp(Size(320, 240));
|
||||
randu(disp, Scalar(min), Scalar(max));
|
||||
|
@ -46,11 +46,19 @@
|
||||
#pragma warning( disable: 4710 4711 4514 4996 )
|
||||
#endif
|
||||
|
||||
#include "cv.h"
|
||||
#include "cxmisc.h"
|
||||
#include "cvaux.h"
|
||||
#include "cxts.h"
|
||||
#include "highgui.h"
|
||||
#include "opencv2/legacy/legacy.hpp"
|
||||
#include "opencv2/legacy/compat.hpp"
|
||||
#include "opencv2/contrib/contrib.hpp"
|
||||
#include "opencv2/core/core_c.h"
|
||||
#include "opencv2/core/internal.hpp"
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/imgproc/imgproc_c.h"
|
||||
#include "opencv2/calib3d/calib3d.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/video/tracking.hpp"
|
||||
#include "opencv2/features2d/features2d.hpp"
|
||||
#include "opencv2/objdetect/objdetect.hpp"
|
||||
|
||||
#undef min
|
||||
#undef max
|
||||
|
@ -48,8 +48,8 @@
|
||||
#undef max
|
||||
#endif
|
||||
|
||||
#include "cxcore.h"
|
||||
#include "cxmisc.h"
|
||||
#include "opencv2/core/core.hpp"
|
||||
#include "opencv2/core/internal.hpp"
|
||||
#include "cxts.h"
|
||||
|
||||
/****************************************************************************************/
|
||||
|
@ -47,6 +47,7 @@
|
||||
#endif
|
||||
|
||||
#include "cxts.h"
|
||||
#include "opencv2/core/internal.hpp"
|
||||
#include <assert.h>
|
||||
#include <float.h>
|
||||
#include <limits.h>
|
||||
|
@ -42,8 +42,8 @@
|
||||
#ifndef __CXTS_H__
|
||||
#define __CXTS_H__
|
||||
|
||||
#include "cxcore.h"
|
||||
#include "cxmisc.h"
|
||||
#include "opencv2/core/core.hpp"
|
||||
#include "opencv2/core/core_c.h"
|
||||
#include <assert.h>
|
||||
#include <limits.h>
|
||||
#include <setjmp.h>
|
||||
|
Loading…
x
Reference in New Issue
Block a user