Added WITH_CLP flag support into cmake scripts.

This commit is contained in:
Alexey Spizhevoy
2012-04-11 12:34:30 +00:00
parent b5a1bad7a4
commit ae839df55d
5 changed files with 65 additions and 1 deletions

View File

@@ -46,6 +46,7 @@
#include <vector>
#include <utility>
#include "opencv2/core/core.hpp"
#include "opencv2/videostab/global_motion.hpp"
namespace cv
{
@@ -108,6 +109,22 @@ private:
std::vector<float> weight_;
};
class CV_EXPORTS LpMotionStabilizer : public IMotionStabilizer
{
public:
LpMotionStabilizer(MotionModel model = LINEAR_SIMILARITY);
void setMotionModel(MotionModel val) { model_ = val; }
MotionModel motionModel() const { return model_; }
virtual void stabilize(
int size, const std::vector<Mat> &motions, std::pair<int,int> range,
Mat *stabilizationMotions) const;
private:
MotionModel model_;
};
CV_EXPORTS Mat ensureInclusionConstraint(const Mat &M, Size size, float trimRatio);
CV_EXPORTS float estimateOptimalTrimRatio(const Mat &M, Size size);

View File

@@ -47,7 +47,7 @@
#include "opencv2/opencv_modules.hpp"
#if HAVE_OPENCV_GPU
# include "opencv2/gpu/gpu.hpp"
#include "opencv2/gpu/gpu.hpp"
#endif
namespace cv

View File

@@ -45,6 +45,10 @@
#include "opencv2/videostab/global_motion.hpp"
#include "opencv2/videostab/ring_buffer.hpp"
#ifdef HAVE_CLP
#include "coin/ClpSimplex.hpp"
#endif
using namespace std;
namespace cv
@@ -254,5 +258,27 @@ float estimateOptimalTrimRatio(const Mat &M, Size size)
return r;
}
LpMotionStabilizer::LpMotionStabilizer(MotionModel model)
{
setMotionModel(model);
}
#ifndef HAVE_CLP
void LpMotionStabilizer::stabilize(int, const vector<Mat>&, pair<int,int>, Mat*) const
{
CV_Error(CV_StsError, "The library is built without Clp support");
}
#else
void LpMotionStabilizer::stabilize(
int size, const vector<Mat> &motions, pair<int,int> range,
Mat *stabilizationMotions) const
{
// TODO implement
CV_Error(CV_StsNotImplemented, "LpMotionStabilizer::stabilize");
}
#endif
} // namespace videostab
} // namespace cv