Visual Servoing Platform version 3.7.0
Loading...
Searching...
No Matches
vpTemplateTrackerWarpTranslation.cpp
1/*
2 * ViSP, open source Visual Servoing Platform software.
3 * Copyright (C) 2005 - 2025 by Inria. All rights reserved.
4 *
5 * This software is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 * See the file LICENSE.txt at the root directory of this source
10 * distribution for additional information about the GNU GPL.
11 *
12 * For using ViSP with software that can not be combined with the GNU
13 * GPL, please contact Inria about acquiring a ViSP Professional
14 * Edition License.
15 *
16 * See https://visp.inria.fr for more information.
17 *
18 * This software was developed at:
19 * Inria Rennes - Bretagne Atlantique
20 * Campus Universitaire de Beaulieu
21 * 35042 Rennes Cedex
22 * France
23 *
24 * If you have questions regarding the use of this file, please contact
25 * Inria at visp@inria.fr
26 *
27 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
28 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
29 *
30 * Description:
31 * Template tracker.
32 *
33 * Authors:
34 * Amaury Dame
35 * Aurelien Yol
36 */
37#include <visp3/tt/vpTemplateTrackerWarpTranslation.h>
38
44
52{
53 p_down[0] = p[0] / 2.;
54 p_down[1] = p[1] / 2.;
55}
56
64{
65 p_up[0] = p[0] * 2.;
66 p_up[1] = p[1] * 2.;
67}
68
75void vpTemplateTrackerWarpTranslation::getdW0(const int &, const int &, const double &dv, const double &du,
76 double *dIdW)
77{
78 dIdW[0] = du;
79 dIdW[1] = dv;
80}
81
90void vpTemplateTrackerWarpTranslation::getdWdp0(const int &, const int &, double *dIdW)
91{
92 dIdW[0] = 1.;
93 dIdW[1] = 0;
94
95 dIdW[2] = 0;
96 dIdW[3] = 1.;
97}
98
108void vpTemplateTrackerWarpTranslation::warpX(const int &v1, const int &u1, double &v2, double &u2, const vpColVector &p)
109{
110 u2 = u1 + p[0];
111 v2 = v1 + p[1];
112}
113
122{
123 X2[0] = X1[0] + p[0];
124 X2[1] = X1[1] + p[1];
125}
126
135 vpMatrix &dM)
136{
137 dM[0][0] = 1;
138 dM[0][1] = 0;
139 dM[1][0] = 0;
140 dM[1][1] = 1;
141}
142
150 const double *dwdp0, vpMatrix &dM)
151{
152 for (unsigned int i = 0; i < nbParam; i++) {
153 dM[0][i] = dwdp0[i];
154 dM[1][i] = dwdp0[i + nbParam];
155 }
156}
157
166{
167 X2[0] = X1[0] + p[0];
168 X2[1] = X1[1] + p[1];
169}
170
178{
179 p_inv[0] = -p[0];
180 p_inv[1] = -p[1];
181}
182
192{
193 p12[0] = p1[0] + p2[0];
194 p12[1] = p1[1] + p2[1];
195}
196END_VISP_NAMESPACE
Implementation of column vector and the associated operations.
Implementation of a matrix and operations on matrices.
Definition vpMatrix.h:175
void pRondp(const vpColVector &p1, const vpColVector &p2, vpColVector &p12) const
void dWarpCompo(const vpColVector &, const vpColVector &, const vpColVector &, const double *dwdp0, vpMatrix &dM)
void warpX(const vpColVector &X1, vpColVector &X2, const vpColVector &p)
void getParamPyramidUp(const vpColVector &p, vpColVector &p_up)
void warpXInv(const vpColVector &X1, vpColVector &X2, const vpColVector &p)
void getdW0(const int &, const int &, const double &dv, const double &du, double *dIdW)
void dWarp(const vpColVector &, const vpColVector &, const vpColVector &, vpMatrix &dM)
void getdWdp0(const int &, const int &, double *dIdW)
void getParamInverse(const vpColVector &p, vpColVector &p_inv) const
void getParamPyramidDown(const vpColVector &p, vpColVector &p_down)
unsigned int nbParam
Number of parameters used to model warp transformation.