refactored opencv_stitching, added possibility to turn off BA

This commit is contained in:
Alexey Spizhevoy
2011-08-15 12:20:27 +00:00
parent 6e3a1f7b49
commit b97ecdff0d
6 changed files with 44 additions and 29 deletions

View File

@@ -50,13 +50,13 @@ using namespace cv::gpu;
Ptr<ExposureCompensator> ExposureCompensator::createDefault(int type)
{
if (type == NO)
return new NoExposureCompensator();
if (type == GAIN)
return new GainCompensator();
if (type == GAIN_BLOCKS)
return new BlocksGainCompensator();
CV_Error(CV_StsBadArg, "unsupported exposure compensation method");
if (type == NO)
return new NoExposureCompensator();
if (type == GAIN)
return new GainCompensator();
if (type == GAIN_BLOCKS)
return new BlocksGainCompensator();
CV_Error(CV_StsBadArg, "unsupported exposure compensation method");
return NULL;
}
@@ -74,6 +74,9 @@ void ExposureCompensator::feed(const vector<Point> &corners, const vector<Mat> &
void GainCompensator::feed(const vector<Point> &corners, const vector<Mat> &images,
const vector<pair<Mat,uchar> > &masks)
{
LOGLN("Exposure compensation...");
int64 t = getTickCount();
CV_Assert(corners.size() == images.size() && images.size() == masks.size());
const int num_images = static_cast<int>(images.size());
@@ -138,6 +141,8 @@ void GainCompensator::feed(const vector<Point> &corners, const vector<Mat> &imag
}
solve(A, b, gains_);
LOGLN("Exposure compensation, time: " << ((getTickCount() - t) / getTickFrequency()) << " sec");
}
@@ -237,4 +242,4 @@ void BlocksGainCompensator::apply(int index, Point /*corner*/, Mat &image, const
row[x].z = saturate_cast<uchar>(row[x].z * gain_row[x]);
}
}
}
}