Commit 35972a1e authored by Alexander Alekhin's avatar Alexander Alekhin
Browse files

Merge remote-tracking branch 'upstream/3.4' into merge-3.4

parents 64961f37 d1fc1c64
Loading
Loading
Loading
Loading
+5 −31
Original line number Diff line number Diff line
@@ -100,19 +100,7 @@ class CV_BD_DescriptorsTest : public cvtest::BaseTest
        curMaxDist = dist;
    }

    std::stringstream ss;
    ss << "Max distance between valid and computed descriptors " << curMaxDist;

    if( curMaxDist < maxDist )
      ss << "." << std::endl;

    else
    {
      ss << ">" << maxDist << " - bad accuracy!" << "\n";
      ts->set_failed_test_info( cvtest::TS::FAIL_BAD_ACCURACY );
    }

    ts->printf( cvtest::TS::LOG, ss.str().c_str() );
    EXPECT_LT(curMaxDist, maxDist) << "Max distance between valid and computed descriptors";
  }

  Mat readDescriptors()
@@ -286,25 +274,11 @@ class CV_BD_DescriptorsTest : public cvtest::BaseTest
      ts->printf( cvtest::TS::LOG, "\nAverage time of computing one descriptor = %g ms.\n",
                  t / ( (double) getTickFrequency() * 1000. ) / calcDescriptors.rows );

      if( calcDescriptors.rows != (int) keylines.size() )
      {
        ts->printf( cvtest::TS::LOG, "Count of computed descriptors and keylines count must be equal.\n" );
        ts->printf( cvtest::TS::LOG, "Count of keylines is            %d.\n", (int) keylines.size() );
        ts->printf( cvtest::TS::LOG, "Count of computed descriptors is %d.\n", calcDescriptors.rows );
        ts->set_failed_test_info( cvtest::TS::FAIL_INVALID_OUTPUT );
        return;
      }
      ASSERT_EQ((int)keylines.size(), calcDescriptors.rows)
          << "Count of computed descriptors and keylines count must be equal";

      if( calcDescriptors.cols != bd->descriptorSize() / 8 || calcDescriptors.type() != bd->descriptorType() )
      {
        ts->printf( cvtest::TS::LOG, "Incorrect descriptor size or descriptor type.\n" );
        ts->printf( cvtest::TS::LOG, "Expected size is   %d.\n", bd->descriptorSize() );
        ts->printf( cvtest::TS::LOG, "Calculated size is %d.\n", calcDescriptors.cols );
        ts->printf( cvtest::TS::LOG, "Expected type is   %d.\n", bd->descriptorType() );
        ts->printf( cvtest::TS::LOG, "Calculated type is %d.\n", calcDescriptors.type() );
        ts->set_failed_test_info( cvtest::TS::FAIL_INVALID_OUTPUT );
        return;
      }
      ASSERT_EQ(bd->descriptorSize() / 8, calcDescriptors.cols);
      ASSERT_EQ(bd->descriptorType(), calcDescriptors.type());

      // TODO read and write descriptor extractor parameters and check them
      Mat validDescriptors = readDescriptors();
+0 −7
Original line number Diff line number Diff line
@@ -135,13 +135,6 @@ struct GPCTrainingParams
    CV_Assert( check() );
  }

  GPCTrainingParams( const GPCTrainingParams &params )
      : maxTreeDepth( params.maxTreeDepth ), minNumberOfSamples( params.minNumberOfSamples ), descriptorType( params.descriptorType ),
        printProgress( params.printProgress )
  {
    CV_Assert( check() );
  }

  bool check() const { return maxTreeDepth > 1 && minNumberOfSamples > 1; }
};

+3 −0
Original line number Diff line number Diff line
@@ -7,5 +7,8 @@ ocv_warnings_disable(CMAKE_CXX_FLAGS -Winconsistent-missing-override -Wsuggest-o
if(CV_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 8.0)
  ocv_warnings_disable(CMAKE_CXX_FLAGS -Wclass-memaccess)
endif()
if(CV_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 9.0)
  ocv_warnings_disable(CMAKE_CXX_FLAGS -Wdeprecated-copy)
endif()

add_subdirectory(libmv)
 No newline at end of file
+3 −3
Original line number Diff line number Diff line
@@ -82,10 +82,10 @@ static KeyType hashPPF(const Vec4d& f, const double AngleStep, const double Dist
      (int)(f[1] / AngleStep),
      (int)(f[2] / AngleStep),
      (int)(f[3] / DistanceStep));
  KeyType hashKey = 0;
  KeyType hashKey[2] = {0, 0};  // hashMurmurx64() fills two values

  murmurHash(key.val, 4*sizeof(int), 42, &hashKey);
  return hashKey;
  murmurHash(key.val, 4*sizeof(int), 42, &hashKey[0]);
  return hashKey[0];
}

/*static size_t hashMurmur(uint key)
+4 −4
Original line number Diff line number Diff line
@@ -37,10 +37,10 @@ CV_GMSMatcherTest::CV_GMSMatcherTest()
    eps[1][2] = 0.80;
    eps[1][3] = 0.78;

    eps[2][0] = 0.70;
    eps[2][1] = 0.66;
    eps[2][2] = 0.68;
    eps[2][3] = 0.63;
    eps[2][0] = 0.6;
    eps[2][1] = 0.6;
    eps[2][2] = 0.6;
    eps[2][3] = 0.6;

    correctMatchDistThreshold = 5.0;
}
Loading