Skip to content
This repository
Browse code

InterestPointMatching: Undo self, write message but do not throw

  • Loading branch information...
commit 6f79427f3901b9b66fd2dc493dd734fc42c0650e 1 parent d0b5084
Oleg Alexandrov oleg-alexandrov authored

Showing 1 changed file with 9 additions and 9 deletions. Show diff stats Hide diff stats

  1. +9 9 src/asp/Core/InterestPointMatching.h
18 src/asp/Core/InterestPointMatching.h
@@ -303,7 +303,7 @@ namespace asp {
303 303 detect_ip( ip1, ip2, image1, image2,
304 304 nodata1, nodata2 );
305 305 if ( ip1.size() == 0 || ip2.size() == 0 ){
306   - vw_throw( ArgumentErr() << "Unable to detect interest points." );
  306 + vw_out() << "Unable to detect interest points." << std::endl;
307 307 return false;
308 308 }
309 309
@@ -351,7 +351,7 @@ namespace asp {
351 351 std::list<size_t> good_indices;
352 352 if (!tri_and_alt_ip_filtering( matched_ip1, matched_ip2,
353 353 cam1, cam2, datum, good_indices, left_tx, right_tx ) ){
354   - vw_throw( ArgumentErr() << "No interest points left after filtering." );
  354 + vw_out() << "No interest points left after filtering." << std::endl;
355 355 return false;
356 356 }
357 357
@@ -411,7 +411,7 @@ namespace asp {
411 411 BBox2i box1 = bounding_box(image1), box2 = bounding_box(image2);
412 412
413 413 // Homography is defined in the original camera coordinates
414   - Matrix<double> homography =
  414 + Matrix<double> rough_homography =
415 415 rough_homography_fit( cam1, cam2, left_tx.reverse_bbox(box1),
416 416 right_tx.reverse_bbox(box2), datum );
417 417
@@ -419,19 +419,19 @@ namespace asp {
419 419 // image. If we used the translation from the solved homography with
420 420 // poorly position cameras, the right image might be moved out of
421 421 // frame.
422   - homography(0,2) = homography(1,2) = 0;
423   - VW_OUT( DebugMessage, "asp" ) << "Aligning right to left for IP capture using rough homography: " << homography << std::endl;
  422 + rough_homography(0,2) = rough_homography(1,2) = 0;
  423 + VW_OUT( DebugMessage, "asp" ) << "Aligning right to left for IP capture using rough homography: " << rough_homography << std::endl;
424 424
425 425 { // Check to see if this rough homography works
426   - HomographyTransform func( homography );
  426 + HomographyTransform func( rough_homography );
427 427 VW_ASSERT( box1.intersects( func.forward_bbox( box2 ) ),
428 428 LogicErr() << "The rough homography alignment based on datum and camera geometry shows that input images do not overlap at all. Unable to proceed.\n" );
429 429 }
430 430
431   - TransformRef tx( compose(right_tx, HomographyTransform(homography)) );
  431 + TransformRef tx( compose(right_tx, HomographyTransform(rough_homography)) );
432 432 BBox2i raster_box = tx.forward_bbox( right_tx.reverse_bbox(box2) );
433 433 tx = TransformRef(compose(TranslateTransform(-raster_box.min()),
434   - right_tx, HomographyTransform(homography)));
  434 + right_tx, HomographyTransform(rough_homography)));
435 435 raster_box -= Vector2i(raster_box.min());
436 436
437 437 // It is important that we use NearestPixelInterpolation in the
@@ -448,7 +448,7 @@ namespace asp {
448 448 ip::read_binary_match_file( output_name, ip1_copy, ip2_copy );
449 449 Matrix<double> post_fit =
450 450 homography_fit( ip2_copy, ip1_copy, raster_box );
451   - if ( sum(abs(submatrix(homography,0,0,2,2) - submatrix(post_fit,0,0,2,2))) > 4 ) {
  451 + if ( sum(abs(submatrix(rough_homography,0,0,2,2) - submatrix(post_fit,0,0,2,2))) > 4 ) {
452 452 VW_OUT( DebugMessage, "asp" ) << "Post homography has largely different scale and skew from rough fit. Post solution is " << post_fit << "\n";
453 453 return false;
454 454 }

0 comments on commit 6f79427

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