Skip to content

Commit

Permalink
Make number of iterations of robust estimation a parameter.
Browse files Browse the repository at this point in the history
  • Loading branch information
pmoulon authored and simogasp committed Oct 2, 2015
1 parent d48bef4 commit c6f5a43
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/openMVG/matching_image_collection/E_ACRobust.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
namespace openMVG {
namespace matching_image_collection {

//-- A contrario essential matrix estimation template functor used for filter pair of putative correspondences
//-- A contrario essential matrix estimation template functor used for filter pair of putative correspondences
struct GeometricFilter_EMatrix_AC
{
GeometricFilter_EMatrix_AC(
double dPrecision = std::numeric_limits<double>::infinity(),
size_t iteration = 4096)
size_t iteration = 1024)
: m_dPrecision(dPrecision), m_stIteration(iteration), m_E(Mat3::Identity()),
m_dPrecision_robust(std::numeric_limits<double>::infinity()){};

Expand Down
2 changes: 1 addition & 1 deletion src/openMVG/matching_image_collection/F_ACRobust.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ struct GeometricFilter_FMatrix_AC
{
GeometricFilter_FMatrix_AC(
double dPrecision = std::numeric_limits<double>::infinity(),
size_t iteration = 4096)
size_t iteration = 1024)
: m_dPrecision(dPrecision), m_stIteration(iteration), m_F(Mat3::Identity()),
m_dPrecision_robust(std::numeric_limits<double>::infinity()){};

Expand Down
2 changes: 1 addition & 1 deletion src/openMVG/matching_image_collection/H_ACRobust.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ struct GeometricFilter_HMatrix_AC
{
GeometricFilter_HMatrix_AC(
double dPrecision = std::numeric_limits<double>::infinity(),
size_t iteration = 4096)
size_t iteration = 1024)
: m_dPrecision(dPrecision), m_stIteration(iteration), m_H(Mat3::Identity()),
m_dPrecision_robust(std::numeric_limits<double>::infinity()){};

Expand Down
11 changes: 8 additions & 3 deletions src/software/SfM/main_ComputeMatches.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ int main(int argc, char **argv)
std::string sNearestMatchingMethod = "AUTO";
bool bForce = false;
bool bGuided_matching = false;
int imax_iteration = 1024;

//required
cmd.add( make_option('i', sSfM_Data_Filename, "input_file") );
Expand All @@ -83,6 +84,7 @@ int main(int argc, char **argv)
cmd.add( make_option('n', sNearestMatchingMethod, "nearest_matching_method") );
cmd.add( make_option('f', bForce, "force") );
cmd.add( make_option('m', bGuided_matching, "guided_matching") );
cmd.add( make_option('I', imax_iteration, "max_iteration") );

try {
if (argc == 1) throw std::string("Invalid command line parameter.");
Expand Down Expand Up @@ -369,20 +371,23 @@ int main(int argc, char **argv)
case HOMOGRAPHY_MATRIX:
{
const bool bGeometric_only_guided_matching = true;
filter_ptr->Robust_model_estimation(GeometricFilter_HMatrix_AC(4.0), map_PutativesMatches, bGuided_matching,
filter_ptr->Robust_model_estimation(GeometricFilter_HMatrix_AC(4.0, imax_iteration),
map_PutativesMatches, bGuided_matching,
bGeometric_only_guided_matching ? -1.0 : 0.6);
map_GeometricMatches = filter_ptr->Get_geometric_matches();
}
break;
case FUNDAMENTAL_MATRIX:
{
filter_ptr->Robust_model_estimation(GeometricFilter_FMatrix_AC(4.0), map_PutativesMatches, bGuided_matching);
filter_ptr->Robust_model_estimation(GeometricFilter_FMatrix_AC(4.0, imax_iteration),
map_PutativesMatches, bGuided_matching);
map_GeometricMatches = filter_ptr->Get_geometric_matches();
}
break;
case ESSENTIAL_MATRIX:
{
filter_ptr->Robust_model_estimation(GeometricFilter_EMatrix_AC(4.0), map_PutativesMatches, bGuided_matching);
filter_ptr->Robust_model_estimation(GeometricFilter_EMatrix_AC(4.0, imax_iteration),
map_PutativesMatches, bGuided_matching);
map_GeometricMatches = filter_ptr->Get_geometric_matches();

//-- Perform an additional check to remove pairs with poor overlap
Expand Down

0 comments on commit c6f5a43

Please sign in to comment.