@@ -613,6 +613,8 @@ class CV_WarpPerspectiveTest : public CV_ImgWarpBaseTest
613
613
int prepare_test_case ( int test_case_idx );
614
614
void prepare_to_validation ( int /* test_case_idx*/ );
615
615
double get_success_error_level ( int test_case_idx, int i, int j );
616
+
617
+ int borderType;
616
618
};
617
619
618
620
@@ -636,21 +638,24 @@ void CV_WarpPerspectiveTest::get_test_array_types_and_sizes( int test_case_idx,
636
638
637
639
void CV_WarpPerspectiveTest::run_func ()
638
640
{
639
- CvMat mtx = cvMat ( test_mat[INPUT][ 1 ]) ;
640
- cvWarpPerspective ( test_array [INPUT][0 ], test_array[INPUT_OUTPUT][ 0 ], &mtx , interpolation );
641
+ Mat& dst = test_mat[INPUT_OUTPUT][ 0 ] ;
642
+ cv::warpPerspective (test_mat [INPUT][0 ], dst, test_mat[INPUT][ 1 ], dst. size () , interpolation, borderType, Scalar::all ( 0 ) );
641
643
}
642
644
643
645
644
646
double CV_WarpPerspectiveTest::get_success_error_level ( int /* test_case_idx*/ , int /* i*/ , int /* j*/ )
645
647
{
646
648
int depth = test_mat[INPUT][0 ].depth ();
647
- return depth == CV_8U ? 16 : depth == CV_16U ? 1024 : 5e-2 ;
649
+ return depth == CV_8U ? 16 : depth == CV_16U ? 1024 : 0.13 ;
648
650
}
649
651
650
652
651
653
int CV_WarpPerspectiveTest::prepare_test_case ( int test_case_idx )
652
654
{
653
655
RNG& rng = ts->get_rng ();
656
+
657
+ // only these two borders are declared as supported
658
+ borderType = rng () % 2 ? BORDER_REPLICATE : BORDER_CONSTANT;
654
659
int code = CV_ImgWarpBaseTest::prepare_test_case ( test_case_idx );
655
660
const CvMat src = cvMat (test_mat[INPUT][0 ]);
656
661
const CvMat dst = cvMat (test_mat[INPUT_OUTPUT][0 ]);
@@ -720,7 +725,7 @@ void CV_WarpPerspectiveTest::prepare_to_validation( int /*test_case_idx*/ )
720
725
}
721
726
722
727
Mat mask ( dst.size (), CV_8U );
723
- test_remap ( src, dst, mapx, mapy, &mask );
728
+ test_remap ( src, dst, mapx, mapy, &mask, interpolation );
724
729
dst.setTo (Scalar::all (0 ), mask);
725
730
dst0.setTo (Scalar::all (0 ), mask);
726
731
}
0 commit comments