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;
140 vpDirection clockwise()
142 vpDirection direction;
143 int directionSize = LAST_DIRECTION;
144 direction.m_direction = vpDirectionType(((
int)m_direction + 1) % directionSize);
153 vpDirection counterClockwise()
155 vpDirection direction;
156 int directionSize = (int)LAST_DIRECTION;
158 direction.m_direction = vpDirectionType(idx);
171 int yy = (int)(point.
get_i() + m_diry[(int)m_direction]);
172 int xx = (int)(point.
get_j() + m_dirx[(int)m_direction]);
178 int pixel = I[yy][xx];
238 for (std::vector<vpContour *>::const_iterator it = contour.
m_children.begin(); it != contour.
m_children.end();
251 for (std::vector<vpContour *>::iterator it =
m_children.begin(); it !=
m_children.end(); ++it) {
252 (*it)->m_parent =
nullptr;
253 if (*it !=
nullptr) {
269 for (std::vector<vpContour *>::iterator it =
m_children.begin(); it !=
m_children.end(); ++it) {
270 (*it)->m_parent =
nullptr;
271 if (*it !=
nullptr) {
284 for (std::vector<vpContour *>::const_iterator it = other.
m_children.begin(); it != other.
m_children.end(); ++it) {
300 if (parent !=
nullptr) {
316 unsigned char grayValue = 255);
342 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)