Visual Servoing Platform
version 3.7.0
Toggle main menu visibility
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
39
BEGIN_VISP_NAMESPACE
43
vpTemplateTrackerWarpTranslation::vpTemplateTrackerWarpTranslation
() {
nbParam
= 2; }
44
51
void
vpTemplateTrackerWarpTranslation::getParamPyramidDown
(
const
vpColVector
&p,
vpColVector
&p_down)
52
{
53
p_down[0] = p[0] / 2.;
54
p_down[1] = p[1] / 2.;
55
}
56
63
void
vpTemplateTrackerWarpTranslation::getParamPyramidUp
(
const
vpColVector
&p,
vpColVector
&p_up)
64
{
65
p_up[0] = p[0] * 2.;
66
p_up[1] = p[1] * 2.;
67
}
68
75
void
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
90
void
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
108
void
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
121
void
vpTemplateTrackerWarpTranslation::warpX
(
const
vpColVector
&X1,
vpColVector
&X2,
const
vpColVector
&p)
122
{
123
X2[0] = X1[0] + p[0];
124
X2[1] = X1[1] + p[1];
125
}
126
134
void
vpTemplateTrackerWarpTranslation::dWarp
(
const
vpColVector
&,
const
vpColVector
&,
const
vpColVector
&,
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
149
void
vpTemplateTrackerWarpTranslation::dWarpCompo
(
const
vpColVector
&,
const
vpColVector
&,
const
vpColVector
&,
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
165
void
vpTemplateTrackerWarpTranslation::warpXInv
(
const
vpColVector
&X1,
vpColVector
&X2,
const
vpColVector
&p)
166
{
167
X2[0] = X1[0] + p[0];
168
X2[1] = X1[1] + p[1];
169
}
170
177
void
vpTemplateTrackerWarpTranslation::getParamInverse
(
const
vpColVector
&p,
vpColVector
&p_inv)
const
178
{
179
p_inv[0] = -p[0];
180
p_inv[1] = -p[1];
181
}
182
191
void
vpTemplateTrackerWarpTranslation::pRondp
(
const
vpColVector
&p1,
const
vpColVector
&p2,
vpColVector
&p12)
const
192
{
193
p12[0] = p1[0] + p2[0];
194
p12[1] = p1[1] + p2[1];
195
}
196
END_VISP_NAMESPACE
vpColVector
Implementation of column vector and the associated operations.
Definition
vpColVector.h:191
vpMatrix
Implementation of a matrix and operations on matrices.
Definition
vpMatrix.h:175
vpTemplateTrackerWarpTranslation::pRondp
void pRondp(const vpColVector &p1, const vpColVector &p2, vpColVector &p12) const
Definition
vpTemplateTrackerWarpTranslation.cpp:191
vpTemplateTrackerWarpTranslation::dWarpCompo
void dWarpCompo(const vpColVector &, const vpColVector &, const vpColVector &, const double *dwdp0, vpMatrix &dM)
Definition
vpTemplateTrackerWarpTranslation.cpp:149
vpTemplateTrackerWarpTranslation::warpX
void warpX(const vpColVector &X1, vpColVector &X2, const vpColVector &p)
Definition
vpTemplateTrackerWarpTranslation.cpp:121
vpTemplateTrackerWarpTranslation::getParamPyramidUp
void getParamPyramidUp(const vpColVector &p, vpColVector &p_up)
Definition
vpTemplateTrackerWarpTranslation.cpp:63
vpTemplateTrackerWarpTranslation::warpXInv
void warpXInv(const vpColVector &X1, vpColVector &X2, const vpColVector &p)
Definition
vpTemplateTrackerWarpTranslation.cpp:165
vpTemplateTrackerWarpTranslation::getdW0
void getdW0(const int &, const int &, const double &dv, const double &du, double *dIdW)
Definition
vpTemplateTrackerWarpTranslation.cpp:75
vpTemplateTrackerWarpTranslation::dWarp
void dWarp(const vpColVector &, const vpColVector &, const vpColVector &, vpMatrix &dM)
Definition
vpTemplateTrackerWarpTranslation.cpp:134
vpTemplateTrackerWarpTranslation::getdWdp0
void getdWdp0(const int &, const int &, double *dIdW)
Definition
vpTemplateTrackerWarpTranslation.cpp:90
vpTemplateTrackerWarpTranslation::getParamInverse
void getParamInverse(const vpColVector &p, vpColVector &p_inv) const
Definition
vpTemplateTrackerWarpTranslation.cpp:177
vpTemplateTrackerWarpTranslation::getParamPyramidDown
void getParamPyramidDown(const vpColVector &p, vpColVector &p_down)
Definition
vpTemplateTrackerWarpTranslation.cpp:51
vpTemplateTrackerWarpTranslation::vpTemplateTrackerWarpTranslation
vpTemplateTrackerWarpTranslation()
Definition
vpTemplateTrackerWarpTranslation.cpp:43
vpTemplateTrackerWarp::nbParam
unsigned int nbParam
Number of parameters used to model warp transformation.
Definition
vpTemplateTrackerWarp.h:68
BEGIN_VISP_NAMESPACE
Definition
vpMbtDistanceCircle.cpp:55
modules
tracker
tt
src
warp
vpTemplateTrackerWarpTranslation.cpp
Generated by
1.17.0