37#include <visp3/tt/vpTemplateTrackerBSpline.h>
40#ifndef DOXYGEN_SHOULD_SKIP_THIS
42double vpTemplateTrackerBSpline::getSubPixBspline4(
const vpImage<double> &I,
double r,
double t)
45 int cr =
static_cast<int>(
r);
46 int ct =
static_cast<int>(
t);
47 double er =
static_cast<double>(
r) - cr;
48 double et =
static_cast<double>(
t) - ct;
49 int height =
static_cast<int>(I.getHeight());
50 int width =
static_cast<int>(I.getWidth());
51 for (
int ir = -1; ir <= 2; ir++) {
53 if (tr >= 0 && tr < height) {
54 for (
int it = -1; it <= 2; it++) {
56 if (tt >= 0 && tt < width)
57 res += Bspline4(
static_cast<double>(ir) - er) * Bspline4(
static_cast<double>(it) - et) * I[tr][tt];
64double vpTemplateTrackerBSpline::Bspline4(
double diff)
68 return (aDiff * aDiff * (aDiff / 2. - 1) + 4. / 6.);
70 else if (aDiff < 2.) {
71 double a = 2. - aDiff;
72 return (a * a * a / 6.);
Definition of the vpImage class member functions.
static Type abs(const Type &x)