75 #ifndef _vpContours_h_
76 #define _vpContours_h_
78 #include <visp3/core/vpColor.h>
79 #include <visp3/core/vpImage.h>
80 #include <visp3/core/vpPolygon.h>
97 vpDirectionType m_direction;
123 vpDirection clockwise()
125 vpDirection direction;
126 int directionSize = LAST_DIRECTION;
127 direction.m_direction = vpDirectionType(((
int)m_direction + 1) % directionSize);
132 vpDirection counterClockwise()
134 vpDirection direction;
135 int directionSize = (int)LAST_DIRECTION;
137 direction.m_direction = vpDirectionType(idx);
144 int yy = (int)(point.
get_i() + m_diry[(int)m_direction]);
145 int xx = (int)(point.
get_j() + m_dirx[(int)m_direction]);
151 int pixel = I[yy][xx];
186 for (std::vector<vpContour *>::const_iterator it = contour.
m_children.begin(); it != contour.
m_children.end();
196 for (std::vector<vpContour *>::iterator it =
m_children.begin(); it !=
m_children.end(); ++it) {
197 (*it)->m_parent = NULL;
211 for (std::vector<vpContour *>::iterator it =
m_children.begin(); it !=
m_children.end(); ++it) {
212 (*it)->m_parent = NULL;
225 for (std::vector<vpContour *>::const_iterator it = other.
m_children.begin(); it != other.
m_children.end(); ++it) {
238 if (parent != NULL) {
245 unsigned char grayValue = 255);
250 std::vector<std::vector<vpImagePoint> > &contourPts,
Class to define RGB colors available for display functionnalities.
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 int modulo(int a, int n)
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
void setParent(vpContour *parent)
vpContour(const vpContourType &type)
std::vector< vpImagePoint > m_points
std::vector< vpContour * > m_children
vpContour(const vpContour &contour)