Commit b91aa6e4 authored by Tadej Borovšak's avatar Tadej Borovšak

GO home

parent e779e276
CXX := g++
CXXFLAGS := $(shell pkg-config --cflags opencv) -Wall -Wextra
LDFLAGS := $(shell pkg-config --libs opencv) -Wall -Wextra
CXXFLAGS := $(shell pkg-config --cflags opencv) -Wall -Wextra -ggdb
LDFLAGS := $(shell pkg-config --libs opencv) -Wall -Wextra -ggdb
APPS := \
mean-shift \
cross-entropy
cross-entropy \
track
all: $(APPS)
......
......@@ -13,8 +13,8 @@ using namespace cv;
static RNG rng (time (NULL));
#define SMOOTH 1
#define MIN_SIGMA 1
#define SMOOTH 0
#define MIN_SIGMA 0
#define SHOOW_STEPS 1
......@@ -68,7 +68,7 @@ cross_entropy (Mat const &res,
new_val = res.at<float> (mean[0], mean[1]);
float diff = fabs (new_val - old_val) / fabs (new_val + old_val);
cout << diff << endl;
if (diff < 0.02)
if (diff < 0.002)
break;
accum = Vec2i (0, 0);
......@@ -80,7 +80,7 @@ cross_entropy (Mat const &res,
sigma = Scalar (sqrt (accum[0] / (float)no_elites),
sqrt (accum[1] / (float)no_elites));
#if MIN_SIGMA
sigma = Scalar (max (sigma[0], 3.0), max (sigma[1], 2.0));
sigma = Scalar (max (sigma[0], 3.0), max (sigma[1], 3.0));
#endif /* MIN_SIGMA */
}
while (true);
......
......@@ -90,7 +90,7 @@ main (int argc,
res.at<float> (50, 70) = 0.5f;
GaussianBlur (res, res, Size (), 10);
#if 0
#if 1
Mat kernel = Mat::ones (ksize, ksize, CV_32F);
#else
Mat kernel = getStructuringElement (MORPH_ELLIPSE, Size(ksize, ksize));
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment