98 inimg.
require(
"input", w,
h, V4L2_PIX_FMT_YUYV);
107 unsigned int const ow = outimg.
width, oh = outimg.height;
108 outimg.require(
"output", ow, oh, V4L2_PIX_FMT_GREY);
122 int const smadj = smlev > 0 ? (1 << (smlev-1)) : 0;
123 unsigned int const dmx = (mx << smlev) + smadj;
124 unsigned int const dmy = (my << smlev) + smadj;
127 itsKF->set(dmx, dmy, w,
h);
128 float kfxraw, kfyraw;
itsKF->get(kfxraw, kfyraw, 1.0F);
135 unsigned int const gistonlyw = 72;
unsigned int const gistsize =
itsSaliency->gist_size;
136 unsigned int gisth = (gistsize + ow - 1) / ow;
138 if (
false == ( (ow == mapw && oh == maph) ||
139 (ow == mapw * 6 && oh == maph) ||
140 (ow == gistonlyw && oh == gistsize / gistonlyw) ||
141 (ow == mapw && oh == maph + (gistsize + mapw - 1) / mapw) ||
142 (ow == mapw * 6 && oh == maph + (gistsize + mapw*6 - 1) / (mapw*6)) ) )
143 LFATAL(
"Incorrect output size. With current saliency parameters, valid sizes are: " <<
144 mapw <<
'x' << maph <<
" (saliency map only), " <<
145 mapw * 6 <<
'x' << maph <<
" (saliency map + feature maps), " <<
146 gistonlyw <<
'x' << gistsize / gistonlyw <<
" (gist only), " <<
147 mapw <<
'x' << maph + (gistsize + mapw - 1) / mapw <<
" (saliency map + gist), " <<
148 mapw * 6 <<
'x' << maph + (gistsize + mapw*6 - 1) / (mapw*6) <<
" (saliency + feature maps + gist).");
151 unsigned int offset = 0;
152 if (oh == maph || oh == maph + gisth)
166 if (oh == gisth || oh == maph + gisth)
168 unsigned char * d = outimg.pixelsw<
unsigned char>();
if (oh == maph + gisth) d += ow * maph;
172 int const rem = ow * gisth - gistsize;
173 if (rem > 0) memset(d + gistsize, 0, rem);