Visual Servoing Platform
version 3.7.0
Toggle main menu visibility
Loading...
Searching...
No Matches
vpTemplateTrackerZone.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
* Template tracker.
32
*
33
* Authors:
34
* Amaury Dame
35
* Aurelien Yol
36
*/
37
#ifndef vpTemplateTrackerZone_hh
38
#define vpTemplateTrackerZone_hh
39
40
#include <vector>
41
42
#include <visp3/core/vpConfig.h>
43
#include <visp3/core/vpDisplay.h>
44
#include <visp3/core/vpException.h>
45
#include <visp3/core/vpImage.h>
46
#include <visp3/core/vpRect.h>
47
#include <visp3/tt/vpTemplateTrackerHeader.h>
48
#include <visp3/tt/vpTemplateTrackerTriangle.h>
49
50
BEGIN_VISP_NAMESPACE
68
class
VISP_EXPORT
vpTemplateTrackerZone
69
{
70
protected
:
71
std::vector<vpTemplateTrackerTriangle>
Zone
;
72
int
min_x
;
73
int
min_y
;
74
int
max_x
;
75
int
max_y
;
76
77
public
:
78
vpTemplateTrackerZone
();
79
vpTemplateTrackerZone
(
const
vpTemplateTrackerZone
&z);
80
virtual
~vpTemplateTrackerZone
();
81
82
// add a triangle to the zone
83
void
add
(
const
vpTemplateTrackerTriangle
&t);
84
void
clear
();
85
void
copy
(
const
vpTemplateTrackerZone
&z);
86
87
// display the area on an image
88
void
display
(
const
vpImage<unsigned char>
&I,
const
vpColor
&col =
vpColor::green
,
unsigned
int
thickness = 3);
89
void
display
(
const
vpImage<vpRGBa>
&I,
const
vpColor
&col =
vpColor::green
,
unsigned
int
thickness = 3);
90
91
// colorie le tieme triangle
92
void
fillTriangle
(
vpImage<unsigned char>
&I,
unsigned
int
id
,
unsigned
char
gray_level);
93
94
double
getArea
()
const
;
95
vpImagePoint
getCenter
()
const
;
96
vpImagePoint
getCenter
(
int
borne_x,
int
borne_y)
const
;
97
// get bounds of the area
98
int
getMaxx
()
const
;
99
int
getMaxy
()
const
;
100
int
getMinx
()
const
;
101
int
getMiny
()
const
;
102
vpRect
getBoundingBox
()
const
;
103
106
unsigned
int
getNbTriangle
()
const
{
return
static_cast<
unsigned
int
>
(
Zone
.size()); }
107
vpTemplateTrackerZone
getPyramidDown()
const
;
108
// renvoie le ieme triangle de la zone
109
void
getTriangle(
unsigned
int
i,
vpTemplateTrackerTriangle
&T)
const
;
110
vpTemplateTrackerTriangle
getTriangle(
unsigned
int
i)
const
;
111
112
// create an area by clicking on an image
113
void
initClick(
const
vpImage<unsigned char>
&I,
bool
delaunay =
false
);
114
// create an area with a pointer of integer that describes a series of
115
// triangles:
116
// *pt= t0.S1.x,t0.S1.y,t0.S2.x,t0.S2.y,t0.S3.x,t0.S3.y, t1.S1.x ...
117
void
initFromPoints(
const
vpImage<unsigned char>
&I,
const
std::vector<vpImagePoint> &ip,
bool
delaunay =
false
);
118
119
// check if a point is in the area
120
bool
inZone(
const
int
&i,
const
int
&j)
const
;
121
bool
inZone(
const
double
&i,
const
double
&j)
const
;
122
// check if a point is in the area and return the corresponding triangle
123
// id_triangle where the point is.
124
bool
inZone(
const
int
&i,
const
int
&j,
unsigned
int
&id_triangle)
const
;
125
bool
inZone(
const
double
&i,
const
double
&j,
unsigned
int
&id_triangle)
const
;
126
127
vpTemplateTrackerZone
&operator=(
const
vpTemplateTrackerZone
&z);
128
};
129
END_VISP_NAMESPACE
130
#endif
vpColor
Class to define RGB colors available for display functionalities.
Definition
vpColor.h:157
vpColor::green
static const vpColor green
Definition
vpColor.h:201
vpImagePoint
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
Definition
vpImagePoint.h:82
vpImage
Definition of the vpImage class member functions.
Definition
vpImage.h:131
vpRect
Defines a rectangle in the plane.
Definition
vpRect.h:79
vpTemplateTrackerTriangle
Definition
vpTemplateTrackerTriangle.h:68
vpTemplateTrackerZone
Definition
vpTemplateTrackerZone.h:69
vpTemplateTrackerZone::vpTemplateTrackerZone
vpTemplateTrackerZone()
Definition
vpTemplateTrackerZone.cpp:46
vpTemplateTrackerZone::Zone
std::vector< vpTemplateTrackerTriangle > Zone
Vector of triangles that defines the zone.
Definition
vpTemplateTrackerZone.h:71
vpTemplateTrackerZone::max_y
int max_y
Bounding box parameter.
Definition
vpTemplateTrackerZone.h:75
vpTemplateTrackerZone::getMiny
int getMiny() const
Definition
vpTemplateTrackerZone.cpp:436
vpTemplateTrackerZone::getArea
double getArea() const
Definition
vpTemplateTrackerZone.cpp:588
vpTemplateTrackerZone::getMinx
int getMinx() const
Definition
vpTemplateTrackerZone.cpp:431
vpTemplateTrackerZone::getNbTriangle
unsigned int getNbTriangle() const
Definition
vpTemplateTrackerZone.h:106
vpTemplateTrackerZone::copy
void copy(const vpTemplateTrackerZone &z)
Definition
vpTemplateTrackerZone.cpp:537
vpTemplateTrackerZone::max_x
int max_x
Bounding box parameter.
Definition
vpTemplateTrackerZone.h:74
vpTemplateTrackerZone::fillTriangle
void fillTriangle(vpImage< unsigned char > &I, unsigned int id, unsigned char gray_level)
Definition
vpTemplateTrackerZone.cpp:502
vpTemplateTrackerZone::getMaxx
int getMaxx() const
Definition
vpTemplateTrackerZone.cpp:421
vpTemplateTrackerZone::getBoundingBox
vpRect getBoundingBox() const
Definition
vpTemplateTrackerZone.cpp:442
vpTemplateTrackerZone::clear
void clear()
Definition
vpTemplateTrackerZone.cpp:60
vpTemplateTrackerZone::add
void add(const vpTemplateTrackerTriangle &t)
Definition
vpTemplateTrackerZone.cpp:245
vpTemplateTrackerZone::getCenter
vpImagePoint getCenter() const
Definition
vpTemplateTrackerZone.cpp:395
vpTemplateTrackerZone::display
void display(const vpImage< unsigned char > &I, const vpColor &col=vpColor::green, unsigned int thickness=3)
Definition
vpTemplateTrackerZone.cpp:458
vpTemplateTrackerZone::min_y
int min_y
Bounding box parameter.
Definition
vpTemplateTrackerZone.h:73
vpTemplateTrackerZone::getMaxy
int getMaxy() const
Definition
vpTemplateTrackerZone.cpp:426
vpTemplateTrackerZone::min_x
int min_x
Bounding box parameter.
Definition
vpTemplateTrackerZone.h:72
BEGIN_VISP_NAMESPACE
Definition
vpMbtDistanceCircle.cpp:55
modules
tracker
tt
include
visp3
tt
vpTemplateTrackerZone.h
Generated by
1.17.0