34 std::vector<FloatImage>* pyramid) {
35 pyramid->resize(num_levels);
36 (*pyramid)[0] =
image;
37 for (
int i = 1; i < num_levels; ++i) {
50 *x2 /=
pow(2., num_levels_);
51 *y2 /=
pow(2., num_levels_);
56 std::vector<FloatImage> pyramid1(num_levels_);
57 std::vector<FloatImage> pyramid2(num_levels_);
61 for (
int i = num_levels_ - 1; i >= 0; --i) {
63 double xx = x1 /
pow(2., i);
64 double yy = y1 /
pow(2., i);
76 LG <<
"Tracking on level " << i;
78 tracker_->Track(pyramid1[i], pyramid2[i], xx, yy, &x2_new, &y2_new);
85 LG <<
"Finest level of pyramid tracking failed; failing.";
89 LG <<
"Failed to track at level " << i <<
"; restoring guess.";
3D array (row, column, channel).
virtual bool Track(const FloatImage &image1, const FloatImage &image2, double x1, double y1, double *x2, double *y2) const
input_tx image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "preview_img") .compute_source("compositor_compute_preview.glsl") .do_static_compilation(true)
pow(value.r - subtrahend, 2.0)") .do_static_compilation(true)
static void MakePyramid(const FloatImage &image, int num_levels, std::vector< FloatImage > *pyramid)
void DownsampleChannelsBy2(const Array3Df &in, Array3Df *out)