22 #include "../Config.h" 26 #define testDirectMapping( transfPtr, pt1, pt2, maxError ) \ 28 te::gm::Coord2D mappedCoord; \ 29 transfPtr->directMap( pt1, mappedCoord ); \ 30 const double diffx = mappedCoord.x - pt2.x; \ 31 const double diffy = mappedCoord.y - pt2.y; \ 32 const double error = sqrt( ( diffx * diffx ) + ( diffy * diffy ) ); \ 33 CPPUNIT_ASSERT_DOUBLES_EQUAL( 0, error, maxError ); \ 36 #define testInverseMapping( transfPtr, pt1, pt2, maxError ) \ 38 te::gm::Coord2D mappedCoord; \ 39 transfPtr->inverseMap( pt2, mappedCoord ); \ 40 const double diffx = mappedCoord.x - pt1.x; \ 41 const double diffy = mappedCoord.y - pt1.y; \ 42 const double error = sqrt( ( diffx * diffx ) + ( diffy * diffy ) ); \ 43 CPPUNIT_ASSERT_DOUBLES_EQUAL( 0, error, maxError ); \ 57 std::vector< te::gm::GTParameters::TiePoint >& tiePoints )
211 std::vector< te::gm::GTParameters::TiePoint >& tiePoints )
1663 std::vector< double > tiePointsWeights;
1664 tiePointsWeights.resize( transfParams.
m_tiePoints.size(), 1.0 );
1666 std::unique_ptr< te::gm::GeometricTransformation > transfPtr;
1667 std::vector< te::gm::GTParameters::TiePoint > tiePoints;
1671 CPPUNIT_ASSERT( transfPtr->getName() ==
"Affine" );
1695 CPPUNIT_ASSERT(filter.
applyRansac(
"Affine", transfParams, 0.01,
1696 0.01, 0, 0.5,
false, tiePointsWeights, tiePoints, std::move(transfPtr)));
1704 std::vector< double > tiePointsWeights;
1705 tiePointsWeights.resize( transfParams.
m_tiePoints.size(), 1.0 );
1707 std::unique_ptr< te::gm::GeometricTransformation > transfPtr;
1708 std::vector< te::gm::GTParameters::TiePoint > tiePoints;
1712 CPPUNIT_ASSERT( transfPtr->getName() ==
"Affine" );
1713 CPPUNIT_ASSERT( tiePoints.size() >
1714 transfPtr->getMinRequiredTiePoints() );
1716 CPPUNIT_ASSERT(filter.
applyRansac(
"Affine", transfParams, 1,
1717 1, 0, 0.5,
false, tiePointsWeights, tiePoints, std::move(transfPtr)));
1734 std::vector< double > tiePointsWeights;
1735 tiePointsWeights.resize( transfParams.
m_tiePoints.size(), 1.0 );
1737 std::unique_ptr< te::gm::GeometricTransformation > transfPtr;
1738 std::vector< te::gm::GTParameters::TiePoint > tiePoints;
1742 CPPUNIT_ASSERT( filter.
applyRansac(
"Affine", transfParams, 0.01,
1743 0.01, 0, 0.5,
true, tiePointsWeights, tiePoints, transfPtr ) );
1745 CPPUNIT_ASSERT( transfPtr->getName() ==
"Affine" );
Test suite for Geometric Transformations Filter.
std::vector< TiePoint > m_tiePoints
Tie points.
void generateTestTPSet1(std::vector< te::gm::GTParameters::TiePoint > &tiePoints)
Generate a tie-points set 1.
An utility struct for representing 2D coordinates.
std::pair< Coord2D, Coord2D > TiePoint
Tie point type definition.
void tcApplyRansacWithTPSet2()
Test Case: ApplyRansac.
2D Geometric transformation tie-points filter (outliers remotion).
CPPUNIT_TEST_SUITE_REGISTRATION(TsGTFilter)
void tcApplyRansacMultiThread()
Test Case: tcApplyRansacMultiThread.
void generateTestTPSet2(std::vector< te::gm::GTParameters::TiePoint > &tiePoints)
Generate a tie-points set 2.
void tcApplyRansacWithTPSet1()
Test Case: ApplyRansac.
2D Geometric transformation parameters.
bool applyRansac(const std::string &transfName, const GTParameters &inputParams, const double maxDirectMapError, const double maxInverseMapError, const RansacIntegerCounterT &maxIterations, const double &assurance, const bool enableMultiThread, const std::vector< double > &tiePointsWeights, std::vector< te::gm::GTParameters::TiePoint > &outTiePoints, std::unique_ptr< GeometricTransformation > &outTransf)
Apply a RANSAC based outliers remotion strategy.
#define testInverseMapping(transfPtr, pt1, pt2, maxError)
Test suite for Geometric Transformations Filter.
#define testDirectMapping(transfPtr, pt1, pt2, maxError)