Commit b8304ce7 authored by Alexey Spizhevoy's avatar Alexey Spizhevoy

Updated stitcher a little bit

parent 4685f0e9
...@@ -64,9 +64,14 @@ public: ...@@ -64,9 +64,14 @@ public:
// Creates stitcher with default parameters // Creates stitcher with default parameters
static Stitcher createDefault(bool try_use_gpu = false); static Stitcher createDefault(bool try_use_gpu = false);
// Stitches the biggest found pano. Returns status code. Status estimateTransform(InputArray images);
Status stitch(InputArray imgs, OutputArray pano); Status estimateTransform(InputArray images, const std::vector<std::vector<Rect> > &rois);
Status stitch(InputArray imgs, const std::vector<std::vector<cv::Rect> > &rois, OutputArray pano);
Status composePanorama(OutputArray pano);
Status composePanorama(InputArray images, OutputArray pano);
Status stitch(InputArray images, OutputArray pano);
Status stitch(InputArray images, const std::vector<std::vector<Rect> > &rois, OutputArray pano);
double registrationResol() const { return registr_resol_; } double registrationResol() const { return registr_resol_; }
void setRegistrationResol(double resol_mpx) { registr_resol_ = resol_mpx; } void setRegistrationResol(double resol_mpx) { registr_resol_ = resol_mpx; }
...@@ -130,7 +135,6 @@ private: ...@@ -130,7 +135,6 @@ private:
Status matchImages(); Status matchImages();
void estimateCameraParams(); void estimateCameraParams();
Status composePanorama(cv::Mat &pano);
double registr_resol_; double registr_resol_;
double seam_est_resol_; double seam_est_resol_;
......
...@@ -132,7 +132,7 @@ void HomographyBasedEstimator::estimate(const vector<ImageFeatures> &features, c ...@@ -132,7 +132,7 @@ void HomographyBasedEstimator::estimate(const vector<ImageFeatures> &features, c
// Estimate focal length and set it for all cameras // Estimate focal length and set it for all cameras
vector<double> focals; vector<double> focals;
estimateFocal(features, pairwise_matches, focals); estimateFocal(features, pairwise_matches, focals);
cameras.resize(num_images); cameras.assign(num_images, CameraParams());
for (int i = 0; i < num_images; ++i) for (int i = 0; i < num_images; ++i)
cameras[i].focal = focals[i]; cameras[i].focal = focals[i];
...@@ -612,7 +612,6 @@ void waveCorrect(vector<Mat> &rmats, WaveCorrectKind kind) ...@@ -612,7 +612,6 @@ void waveCorrect(vector<Mat> &rmats, WaveCorrectKind kind)
{ {
for (size_t i = 0; i < rmats.size(); ++i) for (size_t i = 0; i < rmats.size(); ++i)
conf -= rg1.dot(rmats[i].col(0)); conf -= rg1.dot(rmats[i].col(0));
cout << conf << endl;
if (conf < 0) if (conf < 0)
{ {
rg0 *= -1; rg0 *= -1;
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment