 |
Visual Servoing Platform
version 3.2.0
|
44 #include <visp3/core/vpConfig.h>
50 #include <visp3/core/vpPolygon.h>
51 #include <visp3/mbt/vpMbtPolygon.h>
57 : index(-1), isvisible(false), isappearing(false), useLod(false), minLineLengthThresh(50.0),
58 minPolygonAreaThresh(2500.0), name(
""), hasOrientation(true)
63 :
vpPolygon3D(mbtp), index(mbtp.index), isvisible(mbtp.isvisible), isappearing(mbtp.isappearing), useLod(mbtp.useLod),
64 minLineLengthThresh(mbtp.minLineLengthThresh), minPolygonAreaThresh(mbtp.minPolygonAreaThresh), name(mbtp.name),
65 hasOrientation(mbtp.hasOrientation)
122 std::vector<vpImagePoint> roiImagePoints;
125 if (roiImagePoints.size() == 2) {
126 double x1 = roiImagePoints[0].get_u();
127 double y1 = roiImagePoints[0].get_v();
128 double x2 = roiImagePoints[1].get_u();
129 double y2 = roiImagePoints[1].get_v();
130 double length = std::sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
163 for (
unsigned int i = 0; i <
nbpt; i++) {
164 currentVertex =
p[i].
cP;
165 nextVertex =
p[(i + 1) %
nbpt].cP;
167 faceNormal[0] += (currentVertex[1] - nextVertex[1]) * (currentVertex[2] + nextVertex[2]);
168 faceNormal[1] += (currentVertex[2] - nextVertex[2]) * (currentVertex[0] + nextVertex[0]);
169 faceNormal[2] += (currentVertex[0] - nextVertex[0]) * (currentVertex[1] + nextVertex[1]);
171 faceNormal.normalize();
175 for (
unsigned int i = 0; i <
nbpt; i += 1) {
190 if (angle < alpha || (modulo && (M_PI - angle) < alpha)) {
200 std::vector<vpImagePoint> roiImagePoints;
204 double area = roiPolygon.getArea();
220 }
else if (modulo && (M_PI - angle) < alpha +
vpMath::rad(1)) {
double minLineLengthThresh
void set_Y(const double Y)
Set the point Y coordinate in the camera frame.
static double rad(double deg)
void setLod(const bool use_lod)
Generic class defining intrinsic camera parameters.
double get_Z() const
Get the point Z coordinate in the camera frame.
double get_X() const
Get the point X coordinate in the camera frame.
void getRoiClipped(const vpCameraParameters &cam, std::vector< vpImagePoint > &roi)
void set_X(const double X)
Set the point X coordinate in the camera frame.
double minPolygonAreaThresh
Defines a generic 2D polygon.
void changeFrame(const vpHomogeneousMatrix &cMo)
vpPoint * p
corners in the object frame
Implementation of column vector and the associated operations.
vpPolygon3D & operator=(const vpPolygon3D &mbtp)
Implementation of a polygon of the model used by the model-based tracker.
bool isvisible
flag to specify whether the face is visible or not
vpMbtPolygon & operator=(const vpMbtPolygon &mbtp)
std::string name
Name of the polygon.
unsigned int getHeight() const
void computePolygonClipped(const vpCameraParameters &cam=vpCameraParameters())
unsigned int nbpt
Number of points used to define the polygon.
static double dotProd(const vpColVector &a, const vpColVector &b)
bool isappearing
flag to specify whether the face is appearing or not
Class that defines what is a point.
void set_Z(const double Z)
Set the point Z coordinate in the camera frame.
Implementation of an homogeneous matrix and operations on such kind of matrices.
void computeFov(const unsigned int &w, const unsigned int &h)
unsigned int clippingFlag
Clipping flag.
Implements a 3D polygon with render functionnalities like clipping.
double get_Y() const
Get the point Y coordinate in the camera frame.
unsigned int getWidth() const