70 #ifndef _vpContours_h_
71 #define _vpContours_h_
73 #include <visp3/core/vpColor.h>
74 #include <visp3/core/vpImage.h>
75 #include <visp3/core/vpPolygon.h>
102 vpDirectionType m_direction;
138 vpDirection clockwise()
140 vpDirection direction;
141 int directionSize = LAST_DIRECTION;
142 direction.m_direction = vpDirectionType(((
int)m_direction + 1) % directionSize);
151 vpDirection counterClockwise()
153 vpDirection direction;
154 int directionSize = (int)LAST_DIRECTION;
156 direction.m_direction = vpDirectionType(idx);
169 int yy = (int)(point.
get_i() + m_diry[(int)m_direction]);
170 int xx = (int)(point.
get_j() + m_dirx[(int)m_direction]);
176 int pixel = I[yy][xx];
236 for (std::vector<vpContour *>::const_iterator it = contour.
m_children.begin(); it != contour.
m_children.end();
249 for (std::vector<vpContour *>::iterator it =
m_children.begin(); it !=
m_children.end(); ++it) {
250 (*it)->m_parent =
nullptr;
251 if (*it !=
nullptr) {
267 for (std::vector<vpContour *>::iterator it =
m_children.begin(); it !=
m_children.end(); ++it) {
268 (*it)->m_parent =
nullptr;
269 if (*it !=
nullptr) {
282 for (std::vector<vpContour *>::const_iterator it = other.
m_children.begin(); it != other.
m_children.end(); ++it) {
298 if (parent !=
nullptr) {
314 unsigned char grayValue = 255);
340 std::vector<std::vector<vpImagePoint> > &contourPts,
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 ...
Definition of the vpImage class member functions.
unsigned int getWidth() const
unsigned int getHeight() const
static float modulo(const float &value, const float &modulo)
Gives the rest of value divided by modulo when the quotient can only be an integer.
VISP_EXPORT void findContours(const vpImage< unsigned char > &I_original, vpContour &contours, std::vector< std::vector< vpImagePoint > > &contourPts, const vpContourRetrievalType &retrievalMode=vp::CONTOUR_RETR_TREE)
VISP_EXPORT void drawContours(vpImage< unsigned char > &I, const std::vector< std::vector< vpImagePoint > > &contours, unsigned char grayValue=255)
vpContour & operator=(const vpContour &other)
vpContourType m_contourType
Contour type.
void setParent(vpContour *parent)
vpContour * m_parent
Parent contour.
vpContour(const vpContourType &type)
std::vector< vpImagePoint > m_points
Vector of points belonging to the contour.
std::vector< vpContour * > m_children
Children contour.
vpContour(const vpContour &contour)