features2d(test): enable debug messages

This commit is contained in:
Alexander Alekhin 2017-08-03 15:22:43 +03:00
parent 43e0912516
commit 63ae5f00b1
2 changed files with 6 additions and 4 deletions

View File

@ -11,7 +11,7 @@ using std::tr1::make_tuple;
using std::tr1::get;
using namespace testing;
#define SHOW_DEBUG_LOG 0
#define SHOW_DEBUG_LOG 1
typedef std::tr1::tuple<std::string, Ptr<FeatureDetector>, Ptr<DescriptorExtractor>, float>
String_FeatureDetector_DescriptorExtractor_Float_t;
@ -72,7 +72,7 @@ TEST_P(DescriptorRotationInvariance, rotation)
vector<KeyPoint> keypoints0;
Mat descriptors0;
featureDetector->detect(image0, keypoints0, mask0);
std::cout << "Intial keypoints: " << keypoints0.size() << std::endl;
std::cout << "Keypoints: " << keypoints0.size() << std::endl;
EXPECT_GE(keypoints0.size(), 15u);
descriptorExtractor->compute(image0, keypoints0, descriptors0);
@ -109,7 +109,7 @@ TEST_P(DescriptorRotationInvariance, rotation)
#if SHOW_DEBUG_LOG
std::cout
<< "angle = " << angle
<< ", keypoints = " << keypoints1.size()
<< ", inliers = " << descInliersCount
<< ", descInliersRatio = " << static_cast<float>(descInliersCount) / keypoints0.size()
<< std::endl;
#endif
@ -121,6 +121,7 @@ TEST_P(DescriptorScaleInvariance, scale)
{
vector<KeyPoint> keypoints0;
featureDetector->detect(image0, keypoints0);
std::cout << "Keypoints: " << keypoints0.size() << std::endl;
EXPECT_GE(keypoints0.size(), 15u);
Mat descriptors0;
descriptorExtractor->compute(image0, keypoints0, descriptors0);
@ -159,6 +160,7 @@ TEST_P(DescriptorScaleInvariance, scale)
#if SHOW_DEBUG_LOG
std::cout
<< "scale = " << scale
<< ", inliers = " << descInliersCount
<< ", descInliersRatio = " << static_cast<float>(descInliersCount) / keypoints0.size()
<< std::endl;
#endif

View File

@ -11,7 +11,7 @@ using std::tr1::make_tuple;
using std::tr1::get;
using namespace testing;
#define SHOW_DEBUG_LOG 0
#define SHOW_DEBUG_LOG 1
typedef std::tr1::tuple<std::string, Ptr<FeatureDetector>, float, float> String_FeatureDetector_Float_Float_t;
const static std::string IMAGE_TSUKUBA = "features2d/tsukuba.png";