From d8a42e155900a62558722bc8d8477bb17cf31039 Mon Sep 17 00:00:00 2001 From: Laurent Saboret Date: Tue, 27 Jan 2009 08:38:26 +0000 Subject: [PATCH] surface_reconstruction_read_g23() skips 2D points not reconstructed in 3D (required by Boujou) --- .../include/surface_reconstruction_read_g23.h | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/Surface_reconstruction_3/demo/Surface_reconstruction_3/poisson/include/surface_reconstruction_read_g23.h b/Surface_reconstruction_3/demo/Surface_reconstruction_3/poisson/include/surface_reconstruction_read_g23.h index ed4c37b041e..b64fa05ba63 100644 --- a/Surface_reconstruction_3/demo/Surface_reconstruction_3/poisson/include/surface_reconstruction_read_g23.h +++ b/Surface_reconstruction_3/demo/Surface_reconstruction_3/poisson/include/surface_reconstruction_read_g23.h @@ -199,15 +199,22 @@ bool surface_reconstruction_read_g23( char point_3D_label[512]; double x,y; if (sscanf(pLine, "%d \"%[^\"]\" %lg %lg", &camera_index, point_3D_label, &x,&y) != 4 || - cameras->find(camera_index) == cameras->end() || - gyroviz_points.find(point_3D_label) == gyroviz_points.end()) + cameras->find(camera_index) == cameras->end()) { std::cerr << "Error line " << lineNumber << " of " << pFilename << std::endl; return false; } - Point_3 camera = (*cameras)[camera_index]; - Point_2 position_2D(x, y); - gyroviz_points[point_3D_label].add_camera_point2_pair( std::make_pair(camera, position_2D) ); + // TEMPORARY? Skip 2D points not reconstructed in 3D. + if (gyroviz_points.find(point_3D_label) == gyroviz_points.end()) + { + //std::cerr << "Skip incorrect 2D point on line " << lineNumber << " of " << pFilename << std::endl; + } + else + { + Point_3 camera = (*cameras)[camera_index]; + Point_2 position_2D(x, y); + gyroviz_points[point_3D_label].add_camera_point2_pair( std::make_pair(camera, position_2D) ); + } } }