1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 07:43:03 +04:00

Merge remote-tracking branch 'itseez/opencv'

Conflicts:
	modules/video/src/simpleflow.cpp
	modules/video/test/test_simpleflow.cpp
This commit is contained in:
Yury Zemlyanskiy
2012-09-05 13:40:14 +04:00
611 changed files with 162920 additions and 16776 deletions
+1 -1
View File
@@ -269,7 +269,7 @@ namespace
if (updateBackgroundModel_)
{
for (int i = 0; i < nfeatures; ++i)
weights[i] *= 1.0f - learningRate_;
weights[i] *= (float)(1.0f - learningRate_);
bool inserted = insertFeature(newFeatureColor, (float)learningRate_, colors, weights, nfeatures, maxFeatures_);
+5 -5
View File
@@ -77,7 +77,7 @@ static void removeOcclusions(const Mat& flow,
static void wd(Mat& d, int top_shift, int bottom_shift, int left_shift, int right_shift, float sigma) {
for (int dr = -top_shift, r = 0; dr <= bottom_shift; ++dr, ++r) {
for (int dc = -left_shift, c = 0; dc <= right_shift; ++dc, ++c) {
d.at<float>(r, c) = -(dr*dr + dc*dc);
d.at<float>(r, c) = (float)-(dr*dr + dc*dc);
}
}
d *= 1.0 / (2.0 * sigma * sigma);
@@ -361,7 +361,7 @@ static void selectPointsToRecalcFlow(const Mat& flow,
mask.at<uchar>(curr_bottom, curr_right) = MASK_TRUE_VALUE;
for (int rr = curr_top; rr <= curr_bottom; ++rr) {
for (int cc = curr_left; cc <= curr_right; ++cc) {
speed_up.at<uchar>(rr, cc) = speed_up_at_this_point + 1;
speed_up.at<uchar>(rr, cc) = (uchar)(speed_up_at_this_point + 1);
}
}
} else {
@@ -398,9 +398,9 @@ static inline float extrapolateValueInRect(int height, int width,
if (r == height && c == width) { return v22;}
float qr = float(r) / height;
float pr = 1.0 - qr;
float pr = 1.0f - qr;
float qc = float(c) / width;
float pc = 1.0 - qc;
float pc = 1.0f - qc;
return v11*pr*pc + v12*pr*qc + v21*qr*pc + v22*qc*qr;
}
@@ -562,7 +562,7 @@ CV_EXPORTS_W void calcOpticalFlowSF(Mat& from,
selectPointsToRecalcFlow(flow,
averaging_radius,
speed_up_thr,
(int)speed_up_thr,
curr_rows,
curr_cols,
speed_up,
+2 -18
View File
@@ -51,27 +51,11 @@ using namespace std;
#define UNKNOWN_FLOW_THRESH 1e9
namespace cv {
/*
template<class T>
inline static T sqr(T t) {
return t*t;
}
static float dist(const Vec3b& p1, const Vec3b& p2) {
return sqr(p1[0] - p2[0]) +
sqr(p1[1] - p2[1]) +
sqr(p1[2] - p2[2]);
}
inline static float dist(const Vec2f& p1, const Vec2f& p2) {
return sqr(p1[0] - p2[0]) +
sqr(p1[1] - p2[1]);
}*/
inline static float dist(const Vec3b& p1, const Vec3b& p2) {
return (p1[0] - p2[0]) * (p1[0] - p2[0]) +
return (float)((p1[0] - p2[0]) * (p1[0] - p2[0]) +
(p1[1] - p2[1]) * (p1[1] - p2[1]) +
(p1[2] - p2[2]) * (p1[2] - p2[2]);
(p1[2] - p2[2]) * (p1[2] - p2[2]));
}
inline static float dist(const Vec2f& p1, const Vec2f& p2) {