27 #include <opencv2/core/core.hpp>
28 #include <opencv2/imgproc/imgproc.hpp>
31 #include <linux/videodev2.h>
88 itsSaliency = addSubComponent<Saliency>(
"saliency");
89 itsKF = addSubComponent<Kalman2D>(
"kalman");
100 inimg.
require(
"input",
w,
h, V4L2_PIX_FMT_YUYV);
129 int const smfac = (1 << smlev);
130 int const roihw = (smfac * 3) / 2;
131 int const mapdrawfac = smfac / 4;
132 int const mapdw = (
w >> smlev) * mapdrawfac;
133 int const mapdh = (
h >> smlev) * mapdrawfac;
136 outimg.require(
"output",
w + (
w & ~(smfac-1)),
h + mapdh, V4L2_PIX_FMT_YUYV);
142 unsigned int const dmx = (mx << smlev) + (smfac >> 2);
143 unsigned int const dmy = (my << smlev) + (smfac >> 2);
144 int rx = std::min(
int(
w) - roihw, std::max(roihw,
int(dmx + 1 + smfac/4)));
145 int ry = std::min(
int(
h) - roihw, std::max(roihw,
int(dmy + 1 + smfac/4)));
152 float kfxraw, kfyraw, kfximg, kfyimg;
153 itsKF->get(kfxraw, kfyraw, kfximg, kfyimg, inimg.
width, inimg.
height, 1.0F, 1.0F);
190 unsigned int const gw = outimg.width - dx, gh = outimg.height -
h;
194 unsigned int const gscale =
int(sqrt((gw * gh) /
itsSaliency->gist_size));