40 #include <visp3/core/vpConfig.h>
41 #include <visp3/core/vpCameraParameters.h>
42 #include <visp3/core/vpColor.h>
43 #include <visp3/core/vpImage.h>
44 #include <visp3/core/vpImagePoint.h>
45 #include <visp3/core/vpPoint.h>
46 #include <visp3/core/vpRect.h>
113 VP_EXPLICIT
vpPolygon(
const std::vector<vpImagePoint> &corners);
114 VP_EXPLICIT
vpPolygon(
const std::list<vpImagePoint> &corners);
120 vpPolygon &buildFrom(
const std::vector<vpImagePoint> &corners,
const bool &create_convex_hull =
false);
121 vpPolygon &buildFrom(
const std::list<vpImagePoint> &corners,
const bool &create_convex_hull =
false);
123 const bool &create_convex_hull =
false);
125 unsigned int getSize()
const;
127 unsigned int thickness = 1);
129 unsigned int thickness = 1);
131 bool isInside(
const vpImagePoint &iP,
const PointInPolygonMethod &method = PnPolyRayCasting)
const;
140 const std::vector<vpImagePoint> &
getCorners()
const {
return _corners; }
148 inline double getArea()
const {
return this->_area; }
169 static bool isInside(
const std::vector<vpImagePoint> &roi,
const double &i,
const double &j,
170 const PointInPolygonMethod &method = PnPolyRayCasting);
173 void init(
const std::vector<vpImagePoint> &corners);
174 void init(
const std::list<vpImagePoint> &corners);
177 void updateBoundingBox();
196 void precalcValuesPnPoly();
198 std::vector<double> m_PnPolyConstants;
199 std::vector<double> m_PnPolyMultiples;
Generic class defining intrinsic camera parameters.
Class to define RGB colors available for display functionalities.
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
Defines a generic 2D polygon.
const std::vector< vpImagePoint > & getCorners() const
vpRect getBoundingBox() const
vpImagePoint getCenter() const
vpRect _bbox
Bounding box containing the polygon.
@ PnPolySegmentIntersection
std::vector< vpImagePoint > _corners
Collection of image points containing the corners.
double _area
Area of the polygon.
Defines a rectangle in the plane.