2 #ifndef vpgl_bundle_adjust_h_ 3 #define vpgl_bundle_adjust_h_ 22 # include <vcl_msvc_warnings.h> 90 const std::vector<std::vector<bool> >& mask);
93 static void write_vrml(
const std::string& filename,
101 double& nx,
double& ny,
double& ns);
139 #endif // vpgl_bundle_adjust_h_ void reflect_points(const vgl_plane_3d< double > &plane, std::vector< vgl_point_3d< double > > &points)
A class for the perspective camera model.
const vnl_vector< double > & cam_params() const
Return the raw camera parameters.
double m_estimator_scale_
Static functions for bundle adjustment.
void normalize_points(std::vector< vgl_point_2d< double > > &image_points, double &nx, double &ny, double &ns)
normalize image points to be mean centered with scale sqrt(2).
vpgl_bundle_adjust()
Constructor.
bool optimize(std::vector< vpgl_perspective_camera< double > > &cameras, std::vector< vgl_point_3d< double > > &world_points, const std::vector< vgl_point_2d< double > > &image_points, const std::vector< std::vector< bool > > &mask)
Bundle Adjust.
vnl_vector< double > a_
The last camera parameters.
static void write_vrml(const std::string &filename, const std::vector< vpgl_perspective_camera< double > > &cameras, const std::vector< vgl_point_3d< double > > &world_points)
Write cameras and points to a file in VRML 2.0 for debugging.
const vnl_vector< double > & point_params() const
Return the raw world point parameters.
void depth_reverse(std::vector< vpgl_perspective_camera< double > > &cameras, std::vector< vgl_point_3d< double > > &world_points)
Approximately depth invert the scene.
std::vector< double > weights_
The last estimated weights.
Bundle adjustment sparse least squares base class.
void set_g_tolerence(double gtol)
base class bundle adjustment sparse least squares function.
void set_x_tolerence(double xtol)
void set_self_calibrate(bool self_calibrate)
const std::vector< double > & final_weights() const
Return the weights a the end of the optimization.
vnl_vector< double > b_
The last point parameters.
~vpgl_bundle_adjust()
Destructor.
void set_use_m_estimator(bool use_m)
This class implements the perspective camera class as described in Hartley & Zisserman as a finite ca...
void rotate_cameras(const vgl_vector_3d< double > &axis, std::vector< vpgl_perspective_camera< double > > &cameras)
void set_verbose(bool verbose)
void set_max_iterations(unsigned maxitr)
void set_normalize_data(bool normalize)
unsigned int max_iterations_
vnl_vector< double > c_
The last global parameters.
void set_use_gradient(bool use_gradient)
void set_epsilon(double eps)
step size for finite differencing operations.
vpgl_bundle_adjust_lsqr * ba_func_
The bundle adjustment error function.
int num_iterations() const
Return the number of iterations.
double end_error() const
Return the ending error.
void set_m_estimator_scale(double scale)
double start_error() const
Return the starting error.