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 #ifdef VISP_BUILD_DEPRECATED_FUNCTIONS
121 VP_DEPRECATED
void buildFrom(
const std::vector<vpImagePoint> &corners,
const bool create_convex_hull =
false);
122 VP_DEPRECATED
void buildFrom(
const std::list<vpImagePoint> &corners,
const bool create_convex_hull =
false);
123 VP_DEPRECATED
void buildFrom(
const std::vector<vpPoint> &corners,
const vpCameraParameters &cam,
124 const bool create_convex_hull =
false);
126 vpPolygon &build(
const std::vector<vpImagePoint> &corners,
const bool &create_convex_hull =
false);
127 vpPolygon &build(
const std::list<vpImagePoint> &corners,
const bool &create_convex_hull =
false);
129 const bool &create_convex_hull =
false);
131 unsigned int getSize()
const;
133 unsigned int thickness = 1);
135 unsigned int thickness = 1);
137 bool isInside(
const vpImagePoint &iP,
const PointInPolygonMethod &method = PnPolyRayCasting)
const;
146 const std::vector<vpImagePoint> &
getCorners()
const {
return _corners; }
154 inline double getArea()
const {
return this->_area; }
175 static bool isInside(
const std::vector<vpImagePoint> &roi,
const double &i,
const double &j,
176 const PointInPolygonMethod &method = PnPolyRayCasting);
179 void init(
const std::vector<vpImagePoint> &corners);
180 void init(
const std::list<vpImagePoint> &corners);
183 void updateBoundingBox();
202 void precalcValuesPnPoly();
204 std::vector<double> m_PnPolyConstants;
205 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.