41 #ifndef __vpDetectorBase_h__
42 #define __vpDetectorBase_h__
49 #include <visp/vpImage.h>
50 #include <visp/vpImagePoint.h>
51 #include <visp/vpRect.h>
100 if (i < m_polygon.size())
110 if (i < m_polygon.size())
132 for(
size_t j=0; j < m_polygon[i].size(); j++) {
133 cog += m_polygon[i][j];
135 cog /= (double)m_polygon[i].size();
143 assert(m_polygon[i].size() > 2);
147 left = right = m_polygon[i][0].get_u();
148 top = bottom = m_polygon[i][0].get_v();
149 for(
size_t j=0; j < m_polygon[i].size(); j++) {
150 double u = m_polygon[i][j].get_u();
151 double v = m_polygon[i][j].get_v();
152 if (u < left) left = u;
153 if (u > right) right = u;
154 if (v < top) top = v;
155 if (v > bottom) bottom = v;
virtual ~vpDetectorBase()
std::vector< vpImagePoint > & getPolygon(size_t i)
error that can be emited by ViSP classes.
size_t getNbObjects() const
vpImagePoint getCog(size_t i) const
size_t m_nb_objects
Number of detected objects.
std::vector< std::vector< vpImagePoint > > & getPolygon()
std::vector< std::string > & getMessage()
std::vector< std::string > m_message
Message attached to each object.
std::string & getMessage(size_t i)
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 ...
vpRect getBBox(size_t i) const
std::vector< std::vector< vpImagePoint > > m_polygon
For each object, defines the polygon that contains the object.