Added selction of BA cost function in stitching samples (and added other BA cost func into stitching module)

This commit is contained in:
Alexey Spizhevoy
2011-09-21 13:22:12 +00:00
parent dbce155874
commit 4ee462c961
5 changed files with 185 additions and 7 deletions

View File

@@ -138,6 +138,22 @@ private:
};
// Minimizes sun of ray-to-ray distances
class CV_EXPORTS BundleAdjusterRay : public BundleAdjusterBase
{
public:
BundleAdjusterRay() : BundleAdjusterBase(4, 3) {}
private:
void setUpInitialCameraParams(const std::vector<CameraParams> &cameras);
void obtainRefinedCameraParams(std::vector<CameraParams> &cameras) const;
void calcError(Mat &err);
void calcJacobian(Mat &jac);
Mat err1_, err2_;
};
void CV_EXPORTS waveCorrect(std::vector<Mat> &rmats);

View File

@@ -47,6 +47,7 @@
#include "opencv2/features2d/features2d.hpp"
#include "warpers.hpp"
#include "detail/matchers.hpp"
#include "detail/motion_estimators.hpp"
#include "detail/exposure_compensate.hpp"
#include "detail/seam_finders.hpp"
#include "detail/blenders.hpp"
@@ -90,6 +91,11 @@ public:
void setFeaturesMatcher(Ptr<detail::FeaturesMatcher> features_matcher)
{ features_matcher_ = features_matcher; }
Ptr<detail::BundleAdjusterBase> bundleAdjuster() { return bundle_adjuster_; }
const Ptr<detail::BundleAdjusterBase> bundleAdjuster() const { return bundle_adjuster_; }
void setBundleAdjuster(Ptr<detail::BundleAdjusterBase> bundle_adjuster)
{ bundle_adjuster_ = bundle_adjuster; }
Ptr<WarperCreator> warper() { return warper_; }
const Ptr<WarperCreator> warper() const { return warper_; }
void setWarper(Ptr<WarperCreator> warper) { warper_ = warper; }
@@ -117,6 +123,7 @@ private:
bool horiz_stright_;
Ptr<detail::FeaturesFinder> features_finder_;
Ptr<detail::FeaturesMatcher> features_matcher_;
Ptr<detail::BundleAdjusterBase> bundle_adjuster_;
Ptr<WarperCreator> warper_;
Ptr<detail::ExposureCompensator> exposure_comp_;
Ptr<detail::SeamFinder> seam_finder_;