class cv::detail::BundleAdjusterReproj

Overview

Implementation of the camera parameters refinement algorithm which minimizes sum of the reprojection error squares. Moreā€¦

#include <motion_estimators.hpp>

class BundleAdjusterReproj: public cv::detail::BundleAdjusterBase
{
};

Inherited Members

public:
    // methods

    bool
    operator()(
        const std::vector<ImageFeatures>& features,
        const std::vector<MatchesInfo>& pairwise_matches,
        std::vector<CameraParams>& cameras
        );

    double
    confThresh() const;

    const Mat
    refinementMask() const;

    void
    setConfThresh(double conf_thresh);

    void
    setRefinementMask(const Mat& mask);

    void
    setTermCriteria(const TermCriteria& term_criteria);

    TermCriteria
    termCriteria();

protected:
    // fields

    Mat cam_params_;
    double conf_thresh_;
    std::vector<std::pair<int, int>> edges_;
    const ImageFeatures* features_;
    int num_errs_per_measurement_;
    int num_images_;
    int num_params_per_cam_;
    const MatchesInfo* pairwise_matches_;
    Mat refinement_mask_;
    TermCriteria term_criteria_;
    int total_num_matches_;

    // methods

    virtual
    bool
    estimate(
        const std::vector<ImageFeatures>& features,
        const std::vector<MatchesInfo>& pairwise_matches,
        std::vector<CameraParams>& cameras
        ) = 0;

    virtual
    void
    calcError(Mat& err) = 0;

    virtual
    void
    calcJacobian(Mat& jac) = 0;

    virtual
    bool
    estimate(
        const std::vector<ImageFeatures>& features,
        const std::vector<MatchesInfo>& pairwise_matches,
        std::vector<CameraParams>& cameras
        );

    virtual
    void
    obtainRefinedCameraParams(std::vector<CameraParams>& cameras) const = 0;

    virtual
    void
    setUpInitialCameraParams(const std::vector<CameraParams>& cameras) = 0;

Detailed Documentation

Implementation of the camera parameters refinement algorithm which minimizes sum of the reprojection error squares.

It can estimate focal length, aspect ratio, principal point. You can affect only on them via the refinement mask.