const std::vector<Point2f> &points0, const std::vector<Point2f> &points1,
int model = AFFINE, float *rmse = 0);
-CV_EXPORTS struct RansacParams
+struct CV_EXPORTS RansacParams
{
int size; // subset size
float thresh; // max error to classify as inlier
class CV_EXPORTS NullLog : public ILog
{
public:
- virtual void print(const char */*format*/, ...) {}
+ virtual void print(const char * /*format*/, ...) {}
};
class CV_EXPORTS LogToStdout : public ILog
double normGx = norm(Gx);
double normGy = norm(Gx);
double sumSq = normGx*normGx + normGy*normGy;
- return 1.f / (sumSq / frame.size().area() + 1e-6);
+ return 1.f / (sumSq / frame.size().area() + 1e-6f);
}
WeightingDeblurer::WeightingDeblurer()
{
- setSensitivity(0.1);
+ setSensitivity(0.1f);
}
{
for (int x = 0; x < frame.cols; ++x)
{
- int x1 = M(0,0)*x + M(0,1)*y + M(0,2);
- int y1 = M(1,0)*x + M(1,1)*y + M(1,2);
+ int x1 = static_cast<int>(M(0,0)*x + M(0,1)*y + M(0,2));
+ int y1 = static_cast<int>(M(1,0)*x + M(1,1)*y + M(1,2));
if (x1 >= 0 && x1 < neighbor.cols && y1 >= 0 && y1 < neighbor.rows)
{
{
float wSumInv = 1.f / wSum_(y,x);
frame.at<Point3_<uchar> >(y,x) = Point3_<uchar>(
- bSum_(y,x) * wSumInv, gSum_(y,x) * wSumInv, rSum_(y,x) * wSumInv);
+ static_cast<uchar>(bSum_(y,x)*wSumInv),
+ static_cast<uchar>(gSum_(y,x)*wSumInv),
+ static_cast<uchar>(rSum_(y,x)*wSumInv));
}
}
}
solve(A, b, sol, DECOMP_SVD);
if (rmse)
- *rmse = norm(A*sol, b, NORM_L2) / sqrt((double)npoints);
+ *rmse = norm(A*sol, b, NORM_L2) / sqrt(static_cast<float>(npoints));
Mat_<float> M = Mat::eye(3, 3, CV_32F);
M(0,0) = M(1,1) = sol(0,0);
solve(A, b, sol, DECOMP_SVD);
if (rmse)
- *rmse = norm(A*sol, b, NORM_L2) / sqrt((double)npoints);
+ *rmse = norm(A*sol, b, NORM_L2) / sqrt(static_cast<float>(npoints));
Mat_<float> M = Mat::eye(3, 3, CV_32F);
for (int i = 0, k = 0; i < 2; ++i)
static inline int areaSign(Point2f a, Point2f b, Point2f c)
{
- float area = (b-a).cross(c-a);
- if (area < -1e-5f) return -1;
- if (area > 1e-5f) return 1;
+ double area = (b-a).cross(c-a);
+ if (area < -1e-5) return -1;
+ if (area > 1e-5) return 1;
return 0;
}
{
CV_Assert(M.size() == Size(3,3) && M.type() == CV_32F);
- const float w = size.width;
- const float h = size.height;
+ const float w = static_cast<float>(size.width);
+ const float h = static_cast<float>(size.height);
const float dx = floor(w * trimRatio);
const float dy = floor(h * trimRatio);
const float srcM[6] =
{
CV_Assert(M.size() == Size(3,3) && M.type() == CV_32F);
- const float w = size.width;
- const float h = size.height;
+ const float w = static_cast<float>(size.width);
+ const float h = static_cast<float>(size.height);
Mat_<float> M_(M);
Point2f pt[4] = {Point2f(0,0), Point2f(w,0), Point2f(w,h), Point2f(0,h)};
c2 = (c2 + pixels[nh].color.y) / 2;
c3 = (c3 + pixels[nh].color.z) / 2;
}
- frame_(y, x) = Point3_<uchar>(c1, c2, c3);
+ frame_(y, x) = Point3_<uchar>(
+ static_cast<uchar>(c1),
+ static_cast<uchar>(c2),
+ static_cast<uchar>(c3));
mask_(y, x) = 255;
}
}
}
float wSumInv = 1.f / wSum;
- frame(y,x) = Point3_<uchar>(c1*wSumInv, c2*wSumInv, c3*wSumInv);
+ frame(y,x) = Point3_<uchar>(
+ static_cast<uchar>(c1*wSumInv),
+ static_cast<uchar>(c2*wSumInv),
+ static_cast<uchar>(c3*wSumInv));
mask(y,x) = 255;
}
{
setFrameSource(new NullFrameSource());
setMotionEstimator(new PyrLkRobustMotionEstimator());
- setMotionFilter(new GaussianMotionFilter(15, sqrt(15.0)));
+ setMotionFilter(new GaussianMotionFilter(15, sqrt(15.f)));
setDeblurer(new NullDeblurer());
setInpainter(new NullInpainter());
setEstimateTrimRatio(true);
return Mat(); // frame source is empty
const Mat &stabilizedFrame = at(curStabilizedPos_, stabilizedFrames_);
- int dx = floor(trimRatio_ * stabilizedFrame.cols);
- int dy = floor(trimRatio_ * stabilizedFrame.rows);
+ int dx = static_cast<int>(floor(trimRatio_ * stabilizedFrame.cols));
+ int dy = static_cast<int>(floor(trimRatio_ * stabilizedFrame.rows));
return stabilizedFrame(Rect(dx, dy, stabilizedFrame.cols - 2*dx, stabilizedFrame.rows - 2*dy));
}