Fixed mingw build.

This commit is contained in:
Andrey Kamaev
2012-06-08 03:15:08 +00:00
parent bee982b492
commit f62028dc16
41 changed files with 624 additions and 585 deletions

View File

@@ -56,12 +56,12 @@ class CV_EXPORTS Estimator
public:
virtual ~Estimator() {}
void operator ()(const std::vector<ImageFeatures> &features, const std::vector<MatchesInfo> &pairwise_matches,
void operator ()(const std::vector<ImageFeatures> &features, const std::vector<MatchesInfo> &pairwise_matches,
std::vector<CameraParams> &cameras)
{ estimate(features, pairwise_matches, cameras); }
protected:
virtual void estimate(const std::vector<ImageFeatures> &features, const std::vector<MatchesInfo> &pairwise_matches,
virtual void estimate(const std::vector<ImageFeatures> &features, const std::vector<MatchesInfo> &pairwise_matches,
std::vector<CameraParams> &cameras) = 0;
};
@@ -72,8 +72,8 @@ public:
HomographyBasedEstimator(bool is_focals_estimated = false)
: is_focals_estimated_(is_focals_estimated) {}
private:
void estimate(const std::vector<ImageFeatures> &features, const std::vector<MatchesInfo> &pairwise_matches,
private:
void estimate(const std::vector<ImageFeatures> &features, const std::vector<MatchesInfo> &pairwise_matches,
std::vector<CameraParams> &cameras);
bool is_focals_estimated_;
@@ -84,10 +84,10 @@ class CV_EXPORTS BundleAdjusterBase : public Estimator
{
public:
const Mat refinementMask() const { return refinement_mask_.clone(); }
void setRefinementMask(const Mat &mask)
{
void setRefinementMask(const Mat &mask)
{
CV_Assert(mask.type() == CV_8U && mask.size() == Size(3, 3));
refinement_mask_ = mask.clone();
refinement_mask_ = mask.clone();
}
double confThresh() const { return conf_thresh_; }
@@ -97,17 +97,17 @@ public:
void setTermCriteria(const CvTermCriteria& term_criteria) { term_criteria_ = term_criteria; }
protected:
BundleAdjusterBase(int num_params_per_cam, int num_errs_per_measurement)
: num_params_per_cam_(num_params_per_cam),
num_errs_per_measurement_(num_errs_per_measurement)
{
BundleAdjusterBase(int num_params_per_cam, int num_errs_per_measurement)
: num_params_per_cam_(num_params_per_cam),
num_errs_per_measurement_(num_errs_per_measurement)
{
setRefinementMask(Mat::ones(3, 3, CV_8U));
setConfThresh(1.);
setConfThresh(1.);
setTermCriteria(cvTermCriteria(CV_TERMCRIT_EPS + CV_TERMCRIT_ITER, 1000, DBL_EPSILON));
}
// Runs bundle adjustment
virtual void estimate(const std::vector<ImageFeatures> &features,
virtual void estimate(const std::vector<ImageFeatures> &features,
const std::vector<MatchesInfo> &pairwise_matches,
std::vector<CameraParams> &cameras);
@@ -143,7 +143,7 @@ protected:
// Minimizes reprojection error.
// It can estimate focal length, aspect ratio, principal point.
// It can estimate focal length, aspect ratio, principal point.
// You can affect only on them via the refinement mask.
class CV_EXPORTS BundleAdjusterReproj : public BundleAdjusterBase
{
@@ -177,7 +177,7 @@ private:
};
enum CV_EXPORTS WaveCorrectKind
enum WaveCorrectKind
{
WAVE_CORRECT_HORIZ,
WAVE_CORRECT_VERT
@@ -193,10 +193,10 @@ void CV_EXPORTS waveCorrect(std::vector<Mat> &rmats, WaveCorrectKind kind);
std::string CV_EXPORTS matchesGraphAsString(std::vector<std::string> &pathes, std::vector<MatchesInfo> &pairwise_matches,
float conf_threshold);
std::vector<int> CV_EXPORTS leaveBiggestComponent(std::vector<ImageFeatures> &features, std::vector<MatchesInfo> &pairwise_matches,
std::vector<int> CV_EXPORTS leaveBiggestComponent(std::vector<ImageFeatures> &features, std::vector<MatchesInfo> &pairwise_matches,
float conf_threshold);
void CV_EXPORTS findMaxSpanningTree(int num_images, const std::vector<MatchesInfo> &pairwise_matches,
void CV_EXPORTS findMaxSpanningTree(int num_images, const std::vector<MatchesInfo> &pairwise_matches,
Graph &span_tree, std::vector<int> &centers);
} // namespace detail

View File

@@ -33,7 +33,6 @@ PERF_TEST_P(stitch, a123, TEST_DETECTORS)
imgs.push_back( imread( getDataPath("stitching/a2.jpg") ) );
imgs.push_back( imread( getDataPath("stitching/a3.jpg") ) );
Stitcher::Status status;
Ptr<detail::FeaturesFinder> featuresFinder = GetParam() == "orb"
? (detail::FeaturesFinder*)new detail::OrbFeaturesFinder()
: (detail::FeaturesFinder*)new detail::SurfFeaturesFinder();
@@ -53,7 +52,7 @@ PERF_TEST_P(stitch, a123, TEST_DETECTORS)
stitcher.setRegistrationResol(WORK_MEGAPIX);
startTimer();
status = stitcher.stitch(imgs, pano);
stitcher.stitch(imgs, pano);
stopTimer();
}
}
@@ -66,7 +65,6 @@ PERF_TEST_P(stitch, b12, TEST_DETECTORS)
imgs.push_back( imread( getDataPath("stitching/b1.jpg") ) );
imgs.push_back( imread( getDataPath("stitching/b2.jpg") ) );
Stitcher::Status status;
Ptr<detail::FeaturesFinder> featuresFinder = GetParam() == "orb"
? (detail::FeaturesFinder*)new detail::OrbFeaturesFinder()
: (detail::FeaturesFinder*)new detail::SurfFeaturesFinder();
@@ -86,7 +84,7 @@ PERF_TEST_P(stitch, b12, TEST_DETECTORS)
stitcher.setRegistrationResol(WORK_MEGAPIX);
startTimer();
status = stitcher.stitch(imgs, pano);
stitcher.stitch(imgs, pano);
stopTimer();
}
}

View File

@@ -82,7 +82,7 @@ void GainCompensator::feed(const vector<Point> &corners, const vector<Mat> &imag
Mat_<int> N(num_images, num_images); N.setTo(0);
Mat_<double> I(num_images, num_images); I.setTo(0);
Rect dst_roi = resultRoi(corners, images);
//Rect dst_roi = resultRoi(corners, images);
Mat subimg1, subimg2;
Mat_<uchar> submask1, submask2, intersect;
@@ -190,7 +190,7 @@ void BlocksGainCompensator::feed(const vector<Point> &corners, const vector<Mat>
block_corners.push_back(corners[img_idx] + bl_tl);
block_images.push_back(images[img_idx](Rect(bl_tl, bl_br)));
block_masks.push_back(make_pair(masks[img_idx].first(Rect(bl_tl, bl_br)),
block_masks.push_back(make_pair(masks[img_idx].first(Rect(bl_tl, bl_br)),
masks[img_idx].second));
}
}
@@ -201,7 +201,7 @@ void BlocksGainCompensator::feed(const vector<Point> &corners, const vector<Mat>
vector<double> gains = compensator.gains();
gain_maps_.resize(num_images);
Mat_<float> ker(1, 3);
Mat_<float> ker(1, 3);
ker(0,0) = 0.25; ker(0,1) = 0.5; ker(0,2) = 0.25;
int bl_idx = 0;
@@ -213,7 +213,7 @@ void BlocksGainCompensator::feed(const vector<Point> &corners, const vector<Mat>
for (int by = 0; by < bl_per_img.height; ++by)
for (int bx = 0; bx < bl_per_img.width; ++bx, ++bl_idx)
gain_maps_[img_idx](by, bx) = static_cast<float>(gains[bl_idx]);
sepFilter2D(gain_maps_[img_idx], gain_maps_[img_idx], CV_32F, ker, ker);
sepFilter2D(gain_maps_[img_idx], gain_maps_[img_idx], CV_32F, ker, ker);
}

View File

@@ -206,7 +206,7 @@ Stitcher::Status Stitcher::composePanorama(InputArray images, OutputArray pano)
Mat img_warped, img_warped_s;
Mat dilated_mask, seam_mask, mask, mask_warped;
double compose_seam_aspect = 1;
//double compose_seam_aspect = 1;
double compose_work_aspect = 1;
bool is_blender_prepared = false;
@@ -227,7 +227,7 @@ Stitcher::Status Stitcher::composePanorama(InputArray images, OutputArray pano)
is_compose_scale_set = true;
// Compute relative scales
compose_seam_aspect = compose_scale / seam_scale_;
//compose_seam_aspect = compose_scale / seam_scale_;
compose_work_aspect = compose_scale / work_scale_;
// Update warped image scale