1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 15:53:03 +04:00

don't use constructors for C API structures

This commit is contained in:
Alexander Alekhin
2018-09-06 14:34:16 +03:00
parent ad146e5a6b
commit 8a3c394d6a
70 changed files with 547 additions and 578 deletions
+17 -17
View File
@@ -410,7 +410,7 @@ void CV_UndistortPointsTest::prepare_to_validation(int /*test_case_idx*/)
{
if (useDstMat)
{
CvMat temp = dst_points_mat;
CvMat temp = cvMat(dst_points_mat);
for (int i=0;i<N_POINTS*2;i++)
{
points[i] = temp.data.fl[i];
@@ -469,14 +469,14 @@ void CV_UndistortPointsTest::run_func()
}
else
{
CvMat _input0 = test_mat[INPUT][0], _input1 = test_mat[INPUT][1], _input2, _input3, _input4;
CvMat _output = test_mat[TEMP][0];
CvMat _input0 = cvMat(test_mat[INPUT][0]), _input1 = cvMat(test_mat[INPUT][1]), _input2, _input3, _input4;
CvMat _output = cvMat(test_mat[TEMP][0]);
if(!zero_distortion)
_input2 = test_mat[INPUT][2];
_input2 = cvMat(test_mat[INPUT][2]);
if(!zero_R)
_input3 = test_mat[INPUT][3];
_input3 = cvMat(test_mat[INPUT][3]);
if(!zero_new_cam)
_input4 = test_mat[INPUT][4];
_input4 = cvMat(test_mat[INPUT][4]);
cvUndistortPoints(&_input0, &_output, &_input1,
zero_distortion ? 0 : &_input2,
zero_R ? 0 : &_input3,
@@ -853,10 +853,10 @@ void CV_InitUndistortRectifyMapTest::prepare_to_validation(int/* test_case_idx*/
CvMat _new_cam = cvMat(test_mat[INPUT][4].rows,test_mat[INPUT][4].cols,CV_64F,new_cam);
CvMat _points= cvMat(test_mat[INPUT][0].rows,test_mat[INPUT][0].cols,CV_64FC2,points);
CvMat _input1 = test_mat[INPUT][1];
CvMat _input2 = test_mat[INPUT][2];
CvMat _input3 = test_mat[INPUT][3];
CvMat _input4 = test_mat[INPUT][4];
CvMat _input1 = cvMat(test_mat[INPUT][1]);
CvMat _input2 = cvMat(test_mat[INPUT][2]);
CvMat _input3 = cvMat(test_mat[INPUT][3]);
CvMat _input4 = cvMat(test_mat[INPUT][4]);
cvtest::convert(cvarrToMat(&_input1), cvarrToMat(&_camera), -1);
cvtest::convert(cvarrToMat(&_input2), cvarrToMat(&_distort), -1);
@@ -871,8 +871,8 @@ void CV_InitUndistortRectifyMapTest::prepare_to_validation(int/* test_case_idx*/
}
cv::Mat map1,map2;
cv::convertMaps(mapx,mapy,map1,map2,CV_32FC1);
CvMat _map1 = map1;
CvMat _map2 = map2;
CvMat _map1 = cvMat(map1);
CvMat _map2 = cvMat(map2);
for (int i=0;i<N_POINTS;i++)
{
double u = test_mat[INPUT][0].ptr<double>()[2*i];
@@ -886,7 +886,7 @@ void CV_InitUndistortRectifyMapTest::prepare_to_validation(int/* test_case_idx*/
cvUndistortPoints(&_points,&ref_points,&_camera,
zero_distortion ? 0 : &_distort, zero_R ? 0 : &_rot, zero_new_cam ? &_camera : &_new_cam);
//cvTsDistortPoints(&_points,&ref_points,&_camera,&_distort,&_rot,&_new_cam);
CvMat dst = test_mat[REF_OUTPUT][0];
CvMat dst = cvMat(test_mat[REF_OUTPUT][0]);
cvtest::convert(cvarrToMat(&ref_points), cvarrToMat(&dst), -1);
cvtest::copy(test_mat[INPUT][0],test_mat[OUTPUT][0]);
@@ -912,13 +912,13 @@ void CV_InitUndistortRectifyMapTest::run_func()
}
else
{
CvMat input1 = test_mat[INPUT][1], input2, input3, input4;
CvMat input1 = cvMat(test_mat[INPUT][1]), input2, input3, input4;
if( !zero_distortion )
input2 = test_mat[INPUT][2];
input2 = cvMat(test_mat[INPUT][2]);
if( !zero_R )
input3 = test_mat[INPUT][3];
input3 = cvMat(test_mat[INPUT][3]);
if( !zero_new_cam )
input4 = test_mat[INPUT][4];
input4 = cvMat(test_mat[INPUT][4]);
cvInitUndistortRectifyMap(&input1,
zero_distortion ? 0 : &input2,
zero_R ? 0 : &input3,