@@ -352,6 +352,8 @@ class DescriptorRotationInvarianceTest : public cvtest::BaseTest
352
352
const int maxAngle = 360 , angleStep = 15 ;
353
353
for (int angle = 0 ; angle < maxAngle; angle += angleStep)
354
354
{
355
+ SCOPED_TRACE (cv::format (" angle=%d" , angle));
356
+
355
357
Mat H = rotateImage (image0, static_cast <float >(angle), image1, mask1);
356
358
357
359
vector<KeyPoint> keypoints1;
@@ -374,16 +376,10 @@ class DescriptorRotationInvarianceTest : public cvtest::BaseTest
374
376
}
375
377
}
376
378
377
- float descInliersRatio = static_cast <float >(descInliersCount) / keypoints0.size ();
378
- if (descInliersRatio < minDescInliersRatio)
379
- {
380
- ts->printf (cvtest::TS::LOG, " Incorrect descInliersRatio: curr = %f, min = %f.\n " ,
381
- descInliersRatio, minDescInliersRatio);
382
- ts->set_failed_test_info (cvtest::TS::FAIL_BAD_ACCURACY);
383
- return ;
384
- }
379
+ EXPECT_GE (descInliersCount, keypoints0.size () * minDescInliersRatio)
380
+ << " minDescInliersRatio=" << minDescInliersRatio << " keypoints0.size()=" << keypoints0.size ();
385
381
#if SHOW_DEBUG_LOG
386
- std::cout << " descInliersRatio " << static_cast <float >(descInliersCount) / keypoints0.size () << std::endl;
382
+ std::cout << " angle= " << angle << " descInliersRatio= " << static_cast <float >(descInliersCount) / keypoints0.size () << std::endl;
387
383
#endif
388
384
}
389
385
ts->set_failed_test_info ( cvtest::TS::OK );
@@ -558,6 +554,7 @@ class DescriptorScaleInvarianceTest : public cvtest::BaseTest
558
554
for (int scaleIdx = 1 ; scaleIdx <= 3 ; scaleIdx++)
559
555
{
560
556
float scale = 1 .f + scaleIdx * 0 .5f ;
557
+ SCOPED_TRACE (cv::format (" scale=%g" , scale));
561
558
562
559
Mat image1;
563
560
resize (image0, image1, Size (), 1 ./scale, 1 ./scale, INTER_LINEAR_EXACT);
@@ -583,16 +580,10 @@ class DescriptorScaleInvarianceTest : public cvtest::BaseTest
583
580
}
584
581
}
585
582
586
- float descInliersRatio = static_cast <float >(descInliersCount) / keypoints0.size ();
587
- if (descInliersRatio < minDescInliersRatio)
588
- {
589
- ts->printf (cvtest::TS::LOG, " Incorrect descInliersRatio: curr = %f, min = %f.\n " ,
590
- descInliersRatio, minDescInliersRatio);
591
- ts->set_failed_test_info (cvtest::TS::FAIL_BAD_ACCURACY);
592
- return ;
593
- }
583
+ EXPECT_GE (descInliersCount, keypoints0.size () * minDescInliersRatio)
584
+ << " minDescInliersRatio=" << minDescInliersRatio << " keypoints0.size()=" << keypoints0.size ();
594
585
#if SHOW_DEBUG_LOG
595
- std::cout << " descInliersRatio " << static_cast <float >(descInliersCount) / keypoints0.size () << std::endl;
586
+ std::cout << " scale= " << scale << " descInliersRatio= " << static_cast <float >(descInliersCount) / keypoints0.size () << std::endl;
596
587
#endif
597
588
}
598
589
ts->set_failed_test_info ( cvtest::TS::OK );
@@ -653,7 +644,7 @@ TEST(Features2d_RotationInvariance_Descriptor_LATCH, regression)
653
644
DescriptorRotationInvarianceTest test (SIFT::create (),
654
645
LATCH::create (),
655
646
NORM_HAMMING,
656
- 0 .9999f );
647
+ 0 .98f );
657
648
test.safe_run ();
658
649
}
659
650
#endif // NONFREE
@@ -672,7 +663,7 @@ TEST(Features2d_RotationInvariance_Descriptor_VGG120, regression)
672
663
DescriptorRotationInvarianceTest test (KAZE::create (),
673
664
VGG::create (VGG::VGG_120, 1 .4f , true , true , 48 .0f , false ),
674
665
NORM_L1,
675
- 1 . 00f );
666
+ 0 . 98f );
676
667
test.safe_run ();
677
668
}
678
669
@@ -681,7 +672,7 @@ TEST(Features2d_RotationInvariance_Descriptor_VGG80, regression)
681
672
DescriptorRotationInvarianceTest test (KAZE::create (),
682
673
VGG::create (VGG::VGG_80, 1 .4f , true , true , 48 .0f , false ),
683
674
NORM_L1,
684
- 1 . 00f );
675
+ 0 . 98f );
685
676
test.safe_run ();
686
677
}
687
678
@@ -690,7 +681,7 @@ TEST(Features2d_RotationInvariance_Descriptor_VGG64, regression)
690
681
DescriptorRotationInvarianceTest test (KAZE::create (),
691
682
VGG::create (VGG::VGG_64, 1 .4f , true , true , 48 .0f , false ),
692
683
NORM_L1,
693
- 1 . 00f );
684
+ 0 . 98f );
694
685
test.safe_run ();
695
686
}
696
687
@@ -699,7 +690,7 @@ TEST(Features2d_RotationInvariance_Descriptor_VGG48, regression)
699
690
DescriptorRotationInvarianceTest test (KAZE::create (),
700
691
VGG::create (VGG::VGG_48, 1 .4f , true , true , 48 .0f , false ),
701
692
NORM_L1,
702
- 1 . 00f );
693
+ 0 . 98f );
703
694
test.safe_run ();
704
695
}
705
696
@@ -746,7 +737,7 @@ TEST(Features2d_RotationInvariance_Descriptor_BoostDesc_BGM, regression)
746
737
DescriptorRotationInvarianceTest test (SURF::create (),
747
738
BoostDesc::create (BoostDesc::BGM,true ,6 .25f ),
748
739
NORM_HAMMING,
749
- 0 .999f );
740
+ 0 .98f );
750
741
test.safe_run ();
751
742
}
752
743
@@ -773,7 +764,7 @@ TEST(Features2d_RotationInvariance_Descriptor_BoostDesc_LBGM, regression)
773
764
DescriptorRotationInvarianceTest test (SURF::create (),
774
765
BoostDesc::create (BoostDesc::LBGM,true ,6 .25f ),
775
766
NORM_L1,
776
- 0 .999f );
767
+ 0 .98f );
777
768
test.safe_run ();
778
769
}
779
770
@@ -800,7 +791,7 @@ TEST(Features2d_RotationInvariance_Descriptor_BoostDesc_BINBOOST_256, regression
800
791
DescriptorRotationInvarianceTest test (SURF::create (),
801
792
BoostDesc::create (BoostDesc::BINBOOST_256,true ,6 .25f ),
802
793
NORM_HAMMING,
803
- 0 .999f );
794
+ 0 .98f );
804
795
test.safe_run ();
805
796
}
806
797
@@ -819,7 +810,7 @@ TEST(Features2d_ScaleInvariance_Detector_SIFT, regression)
819
810
{
820
811
DetectorScaleInvarianceTest test (SIFT::create (),
821
812
0 .69f ,
822
- 0 .99f );
813
+ 0 .98f );
823
814
test.safe_run ();
824
815
}
825
816
@@ -889,7 +880,7 @@ TEST(Features2d_ScaleInvariance_Descriptor_VGG120, regression)
889
880
DescriptorScaleInvarianceTest test (KAZE::create (),
890
881
VGG::create (VGG::VGG_120, 1 .4f , true , true , 48 .0f , false ),
891
882
NORM_L1,
892
- 0 .99f );
883
+ 0 .98f );
893
884
test.safe_run ();
894
885
}
895
886
0 commit comments