diff --git a/tests/cv/src/abundleadjustment.cpp b/tests/cv/src/abundleadjustment.cpp index 5771858de..85e2edb78 100755 --- a/tests/cv/src/abundleadjustment.cpp +++ b/tests/cv/src/abundleadjustment.cpp @@ -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 m_cameras; RigidBody* m_body; - std::vector m_image_points; + std::vector m_image_points; std::vector 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 + diff --git a/tests/cv/src/acameracalibration.cpp b/tests/cv/src/acameracalibration.cpp index bac5d4d08..b0eb16022 100644 --- a/tests/cv/src/acameracalibration.cpp +++ b/tests/cv/src/acameracalibration.cpp @@ -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, diff --git a/tests/cv/src/acameracalibration_artificial.cpp b/tests/cv/src/acameracalibration_artificial.cpp index e5f3abc05..62b4b8eb7 100644 --- a/tests/cv/src/acameracalibration_artificial.cpp +++ b/tests/cv/src/acameracalibration_artificial.cpp @@ -327,7 +327,7 @@ protected: Mat camMat_est = Mat::eye(3, 3, CV_64F), distCoeffs_est = Mat::zeros(1, 5, CV_64F); vector 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(); diff --git a/tests/cv/src/aposit.cpp b/tests/cv/src/aposit.cpp index d2d4621ab..de45f829b 100644 --- a/tests/cv/src/aposit.cpp +++ b/tests/cv/src/aposit.cpp @@ -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 ); diff --git a/tests/cv/src/areprojectImageTo3D.cpp b/tests/cv/src/areprojectImageTo3D.cpp index 646f8e60f..e61577a11 100644 --- a/tests/cv/src/areprojectImageTo3D.cpp +++ b/tests/cv/src/areprojectImageTo3D.cpp @@ -117,7 +117,7 @@ protected: { typedef Vec out3d_t; - bool handleMissingValues = (int)theRNG() % 2 == 0; + bool handleMissingValues = (unsigned)theRNG() % 2 == 0; Mat_ disp(Size(320, 240)); randu(disp, Scalar(min), Scalar(max)); diff --git a/tests/cv/src/cvtest.h b/tests/cv/src/cvtest.h index 4880ded31..2cc7b198e 100644 --- a/tests/cv/src/cvtest.h +++ b/tests/cv/src/cvtest.h @@ -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 diff --git a/tests/cxcore/src/cxcoretest.h b/tests/cxcore/src/cxcoretest.h index 84858c627..a526ef7d7 100644 --- a/tests/cxcore/src/cxcoretest.h +++ b/tests/cxcore/src/cxcoretest.h @@ -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" /****************************************************************************************/ diff --git a/tests/cxts/_cxts.h b/tests/cxts/_cxts.h index e2a53cf4b..57356648a 100644 --- a/tests/cxts/_cxts.h +++ b/tests/cxts/_cxts.h @@ -47,6 +47,7 @@ #endif #include "cxts.h" +#include "opencv2/core/internal.hpp" #include #include #include diff --git a/tests/cxts/cxts.h b/tests/cxts/cxts.h index cc2cebce2..6e2470425 100644 --- a/tests/cxts/cxts.h +++ b/tests/cxts/cxts.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 #include #include