46 #include <visp3/core/vpImagePoint.h>
47 #include <visp3/core/vpRect.h>
48 #include <visp3/core/vpColor.h>
49 #include <visp3/core/vpImage.h>
50 #include <visp3/core/vpPoint.h>
51 #include <visp3/core/vpCameraParameters.h>
120 vpPolygon(
const std::vector<vpImagePoint>& corners);
121 vpPolygon(
const std::list<vpImagePoint>& corners);
127 void buildFrom(
const std::vector<vpImagePoint>& corners);
128 void buildFrom(
const std::list<vpImagePoint>& corners);
131 unsigned int getSize()
const;
134 bool isInside(
const vpImagePoint &iP,
const PointInPolygonMethod &method=PnPolyRayCasting)
const;
165 return this->_center;
179 void init(
const std::vector<vpImagePoint>& corners);
180 void init(
const std::list<vpImagePoint>& corners);
183 void updateBoundingBox();
187 void precalcValuesPnPoly();
189 std::vector<double> m_PnPolyConstants;
190 std::vector<double> m_PnPolyMultiples;
197 static bool isInside(
const std::vector<vpImagePoint>& roi,
const double &i,
const double &j,
const PointInPolygonMethod &method=PnPolyRayCasting);
199 static bool intersect(
const vpImagePoint& p1,
const vpImagePoint& p2,
const double &i,
const double &j,
const double &i_test,
const double &j_test);
const std::vector< vpImagePoint > & getCorners() const
Class to define colors available for display functionnalities.
vpRect _bbox
Bounding box containing the polygon.
vpImagePoint _center
Center of the polygon. It is automatically computed when the corners are set.
Defines a generic 2D polygon.
vpRect getBoundingBox() const
Generic class defining intrinsic camera parameters.
vpImagePoint getCenter() const
std::vector< vpImagePoint > _corners
Collection of image points containing the corners.
bool _goodPoly
Flag set to true when the polygon is a good polygon (ie. it has more than two corners) or false other...
Defines a rectangle in the plane.
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
double _area
Area of the polygon.