Visual Servoing Platform
version 3.7.0
Toggle main menu visibility
Loading...
Searching...
No Matches
vpBSpline.h
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
* This class implements the B-Spline
32
*/
33
38
39
#ifndef VP_BSPINE_H
40
#define VP_BSPINE_H
41
42
#include <visp3/core/vpImagePoint.h>
43
44
#include <list>
45
#include <vector>
46
#include <visp3/core/vpMatrix.h>
47
48
BEGIN_VISP_NAMESPACE
49
#ifndef DOXYGEN_SHOULD_SKIP_THIS
50
61
typedef
struct
vpBasisFunction
62
{
63
unsigned
int
i
;
64
unsigned
int
p
;
65
double
u
;
66
unsigned
int
k;
67
double
value;
68
} vpBasisFunction;
69
#endif
70
106
107
class
VISP_EXPORT
vpBSpline
108
{
109
public
/*protected*/
:
111
std::vector<vpImagePoint> controlPoints;
113
std::vector<double>
knots
;
115
unsigned
int
p
;
117
std::vector<vpImagePoint>
crossingPoints
;
118
119
public
:
120
vpBSpline
();
121
127
inline
unsigned
int
get_p
()
const
{
return
p
; }
128
135
inline
void
get_controlPoints
(std::list<vpImagePoint> &list)
const
136
{
137
list.clear();
138
for
(
unsigned
int
i = 0; i < controlPoints.size(); i++) {
139
list.push_back(*(&(controlPoints[0]) + i));
140
}
141
}
142
148
inline
void
get_knots
(std::list<double> &list)
const
149
{
150
list.clear();
151
for
(
unsigned
int
i = 0; i <
knots
.size(); i++) {
152
list.push_back(*(&(
knots
[0]) + i));
153
}
154
}
155
162
inline
void
get_crossingPoints
(std::list<vpImagePoint> &list)
const
163
{
164
list.clear();
165
for
(
unsigned
int
i = 0; i <
crossingPoints
.size(); i++) {
166
list.push_back(*(&(
crossingPoints
[0]) + i));
167
}
168
}
169
175
inline
void
set_p
(
unsigned
int
degree) { this->p = degree; }
176
182
inline
void
set_controlPoints
(
const
std::list<vpImagePoint> &list)
183
{
184
controlPoints.clear();
185
for
(std::list<vpImagePoint>::const_iterator it = list.begin(); it != list.end(); ++it) {
186
controlPoints.push_back(*it);
187
}
188
}
189
195
inline
void
set_knots
(
const
std::list<double> &list)
196
{
197
knots
.clear();
198
for
(std::list<double>::const_iterator it = list.begin(); it != list.end(); ++it) {
199
knots
.push_back(*it);
200
}
201
}
202
209
inline
void
set_crossingPoints
(
const
std::list<vpImagePoint> &list)
210
{
211
crossingPoints
.clear();
212
for
(std::list<vpImagePoint>::const_iterator it = list.begin(); it != list.end(); ++it) {
213
crossingPoints
.push_back(*it);
214
}
215
}
216
217
static
unsigned
int
findSpan(
double
l_u,
unsigned
int
l_p,
const
std::vector<double> &l_knots);
218
unsigned
int
findSpan(
double
u)
const
;
219
220
static
vpBasisFunction *computeBasisFuns(
double
l_u,
unsigned
int
l_i,
unsigned
int
l_p,
221
const
std::vector<double> &l_knots);
222
vpBasisFunction *computeBasisFuns(
double
u)
const
;
223
224
static
vpBasisFunction **computeDersBasisFuns(
double
l_u,
unsigned
int
l_i,
unsigned
int
l_p,
unsigned
int
l_der,
225
const
std::vector<double> &l_knots);
226
vpBasisFunction **computeDersBasisFuns(
double
u,
unsigned
int
der)
const
;
227
228
static
vpImagePoint
computeCurvePoint(
double
l_u,
unsigned
int
l_i,
unsigned
int
l_p,
const
std::vector<double> &l_knots,
229
const
std::vector<vpImagePoint> &l_controlPoints);
230
vpImagePoint
computeCurvePoint(
double
u)
const
;
231
232
static
vpImagePoint
*computeCurveDers(
double
l_u,
unsigned
int
l_i,
unsigned
int
l_p,
unsigned
int
l_der,
233
const
std::vector<double> &l_knots,
const
std::vector<vpImagePoint> &l_controlPoints);
234
vpImagePoint
*computeCurveDers(
double
u,
unsigned
int
der)
const
;
235
};
236
END_VISP_NAMESPACE
237
#endif
vpBSpline::get_controlPoints
void get_controlPoints(std::list< vpImagePoint > &list) const
Definition
vpBSpline.h:135
vpBSpline::set_p
void set_p(unsigned int degree)
Definition
vpBSpline.h:175
vpBSpline::set_crossingPoints
void set_crossingPoints(const std::list< vpImagePoint > &list)
Definition
vpBSpline.h:209
vpBSpline::p
unsigned int p
Degree of the B-Spline basis functions.
Definition
vpBSpline.h:115
vpBSpline::get_p
unsigned int get_p() const
Definition
vpBSpline.h:127
vpBSpline::get_crossingPoints
void get_crossingPoints(std::list< vpImagePoint > &list) const
Definition
vpBSpline.h:162
vpBSpline::set_controlPoints
void set_controlPoints(const std::list< vpImagePoint > &list)
Definition
vpBSpline.h:182
vpBSpline::get_knots
void get_knots(std::list< double > &list) const
Definition
vpBSpline.h:148
vpBSpline::set_knots
void set_knots(const std::list< double > &list)
Definition
vpBSpline.h:195
vpBSpline::crossingPoints
std::vector< vpImagePoint > crossingPoints
Vector which contains the points used during the interpolation method.
Definition
vpBSpline.h:117
vpBSpline::knots
std::vector< double > knots
Vector which contain the knots .
Definition
vpBSpline.h:113
vpBSpline::vpBSpline
vpBSpline()
Definition
vpBSpline.cpp:43
vpImagePoint
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
Definition
vpImagePoint.h:82
BEGIN_VISP_NAMESPACE
Definition
vpMbtDistanceCircle.cpp:55
ibvs-four-points.p
p
Definition
ibvs-four-points.py:280
yolo-centering-task-afma6.i
i
Definition
yolo-centering-task-afma6.py:329
yolo-centering-task-afma6.u
u
Definition
yolo-centering-task-afma6.py:303
modules
core
include
visp3
core
vpBSpline.h
Generated by
1.17.0