class ReprojectionError { public: ReprojectionError( const Eigen::Matrix<double, 3, 4>& projection_matrix, const Eigen::Vector2d& feature) : projection_matrix_(projection_matrix), feature_(feature) {}
template <typename T> bool operator()(const T* input_point, T* reprojection_error) const { Eigen::Map<const Eigen::Matrix<T, 4, 1> > point(input_point);
// Multiply the point with the projection matrix, then perform homogeneous // normalization to obtain the 2D pixel location of the reprojection. const Eigen::Matrix<T, 2, 1> reprojected_pixel = (projection_matrix_.cast<T>() * input_point).hnormalized();
// Reprojection error is the distance from the reprojection to the observed // feature location. reprojection_error[0] = feature_[0] - reprojected_pixel[0]; reprojection_error[1] = feature_[1] - reprojected_pixel[1]; return true; }
private: const Eigen::Matrix<double, 3, 4>& projection_matrix_; const Eigen::Vector2d& feature_;};const Eigen::Matrix<T, 2, 1> reprojected_pixel = (projection_matrix_ * input_point).hnormalized();--
You received this message because you are subscribed to the Google Groups "Ceres Solver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceres-solver...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceres-solver/ca9f2230-732a-43cb-997a-9d200e4c0095%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceres-solver/CAB_h4O7XT-GkkXH69yMOdi3MyEj%3DymE5AyS45fg5udhBj%3D_GKg%40mail.gmail.com.
Hi everyone,If you use Eigen matrices or arrays inside your templated autodiff cost functions, then this email is for you.
--
You received this message because you are subscribed to the Google Groups "Ceres Solver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceres-solver...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceres-solver/6f7e5d30-9403-4c0f-8dde-1c942c6ce03f%40googlegroups.com.