Added WITH_CLP flag support into cmake scripts.
This commit is contained in:
@@ -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);
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user