Skip to content
Browse files

InterestPointMatching: Let the user know when failing

  • Loading branch information...
1 parent 1c5e6d5 commit d272c23d1aeaa9e67b1b91e4d4d57725a455bd0c @oleg-alexandrov oleg-alexandrov committed Feb 27, 2013
Showing with 9 additions and 5 deletions.
  1. +2 −2 src/asp/Core/InterestPointMatching.cc
  2. +7 −3 src/asp/Core/InterestPointMatching.h
View
4 src/asp/Core/InterestPointMatching.cc
@@ -287,8 +287,8 @@ namespace asp {
alt_clusters.back().second[0] != 0 )
std::swap( alt_clusters[0], alt_clusters[1] );
- // Determine if we just wrote nothing but outliers
- // If the variance on triangulation is ungodly highy
+ // Determine if we just wrote nothing but outliers (the variance
+ // on triangulation is too high).
if ( error_clusters.front().second[0] > 1e6 )
return false;
View
10 src/asp/Core/InterestPointMatching.h
@@ -302,8 +302,10 @@ namespace asp {
ip::InterestPointList ip1, ip2;
detect_ip( ip1, ip2, image1, image2,
nodata1, nodata2 );
- if ( ip1.size() == 0 || ip2.size() == 0 )
+ if ( ip1.size() == 0 || ip2.size() == 0 ){
+ vw_throw( ArgumentErr() << "Unable to detect interest points." );
return false;
+ }
// Match interest points forward/backward .. constraining on epipolar line
std::vector<size_t> forward_match, backward_match;
@@ -348,8 +350,10 @@ namespace asp {
// Apply filtering of triangulation error and altitude
std::list<size_t> good_indices;
if (!tri_and_alt_ip_filtering( matched_ip1, matched_ip2,
- cam1, cam2, datum, good_indices, left_tx, right_tx ) )
+ cam1, cam2, datum, good_indices, left_tx, right_tx ) ){
+ vw_throw( ArgumentErr() << "No interest points left after filtering." );
return false;
+ }
// Record new list that contains only the inliers.
vw_out() << "\t Reduced matches to " << good_indices.size() << "\n";
@@ -368,7 +372,6 @@ namespace asp {
}
matched_ip1 = buffer;
-
// Subselect, Transform, Copy, Matched ip2
w_index = 0;
BOOST_FOREACH( size_t index, good_indices ) {
@@ -401,6 +404,7 @@ namespace asp {
double nodata2 = std::numeric_limits<double>::quiet_NaN(),
vw::TransformRef const& left_tx = vw::TransformRef(vw::TranslateTransform(0,0)),
vw::TransformRef const& right_tx = vw::TransformRef(vw::TranslateTransform(0,0)) ) {
+
using namespace vw;
Image1T image1 = image1_base.impl();
Image2T image2 = image2_base.impl();

0 comments on commit d272c23

Please sign in to comment.
Something went wrong with that request. Please try again.