Mercurial Hosting > traffic-intelligence
view c/test_feature.cpp @ 251:4978b5baf8f1
Win32 version for traffic intelligence. Use the README-Win32.txt to know how to
fetch the dependencies. A batch file is included to automate most of the process
author | Jeep-Tour@Jeep-Tour-PC |
---|---|
date | Mon, 23 Jul 2012 12:27:50 -0400 |
parents | f0f800b95765 |
children | b6ad86ee7033 |
line wrap: on
line source
#define CATCH_CONFIG_MAIN #include "Motion.hpp" #include "testutils.hpp" #include "opencv2/core/core.hpp" #include "catch.hpp" using namespace std; using namespace cv; TEST_CASE("features/similarity", "test feature similarity measure") { FeatureTrajectoryPtr ft1 = createFeatureTrajectory(1, 10, 20, Point2f(1,1), Point2f(0, 1)); FeatureTrajectoryPtr ft2 = createFeatureTrajectory(2, 10, 20, Point2f(2,1), Point2f(0, 1)); REQUIRE_FALSE(ft1->minMaxSimilarity(*ft2, 10, 20, 0.5, 0.1)); REQUIRE(ft1->minMaxSimilarity(*ft2, 10, 20, 1, 0.1)); ft2 = createFeatureTrajectory(2, 10, 19, Point2f(1,1), Point2f(0, 1)); Mat homography; ft2->addPoint(20, Point2f(1,11.5), homography); REQUIRE_FALSE(ft1->minMaxSimilarity(*ft2, 10, 20, 0, 0.4)); REQUIRE(ft1->minMaxSimilarity(*ft2, 10, 20, 0, 0.5)); }