42#include <visp3/core/vpConfig.h>
48#include <visp3/core/vpPolygon.h>
49#include <visp3/mbt/vpMbtPolygon.h>
120 std::vector<vpImagePoint> roiImagePoints;
123 if (roiImagePoints.size() == 2) {
124 double x1 = roiImagePoints[0].get_u();
125 double y1 = roiImagePoints[0].get_v();
126 double x2 = roiImagePoints[1].get_u();
127 double y2 = roiImagePoints[1].get_v();
128 double length = std::sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
161 for (
unsigned int i = 0; i <
nbpt; i++) {
162 currentVertex =
p[i].cP;
163 nextVertex =
p[(i + 1) %
nbpt].cP;
165 faceNormal[0] += (currentVertex[1] - nextVertex[1]) * (currentVertex[2] + nextVertex[2]);
166 faceNormal[1] += (currentVertex[2] - nextVertex[2]) * (currentVertex[0] + nextVertex[0]);
167 faceNormal[2] += (currentVertex[0] - nextVertex[0]) * (currentVertex[1] + nextVertex[1]);
173 for (
unsigned int i = 0; i <
nbpt; i += 1) {
188 if (angle < alpha || (modulo && (M_PI - angle) < alpha)) {
198 std::vector<vpImagePoint> roiImagePoints;
202 double area = roiPolygon.
getArea();
218 }
else if (modulo && (M_PI - angle) < alpha +
vpMath::rad(1)) {
Generic class defining intrinsic camera parameters.
void computeFov(const unsigned int &w, const unsigned int &h)
Implementation of column vector and the associated operations.
static double dotProd(const vpColVector &a, const vpColVector &b)
vpColVector & normalize()
Implementation of an homogeneous matrix and operations on such kind of matrices.
static double rad(double deg)
bool isvisible
flag to specify whether the face is visible or not
double minLineLengthThresh
void setLod(bool use_lod)
double minPolygonAreaThresh
bool isappearing
flag to specify whether the face is appearing or not
std::string name
Name of the polygon.
vpMbtPolygon & operator=(const vpMbtPolygon &mbtp)
Class that defines a 3D point in the object frame and allows forward projection of a 3D point in the ...
double get_Y() const
Get the point cY coordinate in the camera frame.
void set_X(double cX)
Set the point cX coordinate in the camera frame.
void set_Y(double cY)
Set the point cY coordinate in the camera frame.
double get_Z() const
Get the point cZ coordinate in the camera frame.
void set_Z(double cZ)
Set the point cZ coordinate in the camera frame.
double get_X() const
Get the point cX coordinate in the camera frame.
void changeFrame(const vpHomogeneousMatrix &cMo)
unsigned int nbpt
Number of points used to define the polygon.
vpPoint * p
corners in the object frame
void computePolygonClipped(const vpCameraParameters &cam=vpCameraParameters())
unsigned int clippingFlag
Clipping flag.
void getRoiClipped(const vpCameraParameters &cam, std::vector< vpImagePoint > &roi)
vpPolygon3D & operator=(const vpPolygon3D &mbtp)
Defines a generic 2D polygon.