Visual Servoing Platform  version 3.2.0 under development (2018-08-16)

Functions

VISP_EXPORT void vp::drawContours (vpImage< unsigned char > &I, const std::vector< std::vector< vpImagePoint > > &contours, unsigned char grayValue=255)
 
VISP_EXPORT void vp::drawContours (vpImage< vpRGBa > &I, const std::vector< std::vector< vpImagePoint > > &contours, const vpColor &color)
 
VISP_EXPORT void vp::findContours (const vpImage< unsigned char > &I_original, vpContour &contours, std::vector< std::vector< vpImagePoint > > &contourPts, const vpContourRetrievalType &retrievalMode=vp::CONTOUR_RETR_TREE)
 

Detailed Description

Contours extraction.

Function Documentation

void vp::drawContours ( vpImage< unsigned char > &  I,
const std::vector< std::vector< vpImagePoint > > &  contours,
unsigned char  grayValue = 255 
)

Draw the input contours on the binary image.

Parameters
I: Grayscale image where we want to draw the input contours.
contours: Detected contours.
grayValue: Drawing grayscale color.
Examples:
testContours.cpp, tutorial-contour.cpp, and tutorial-count-coins.cpp.

Definition at line 250 of file vpContours.cpp.

References vpImage< Type >::getSize().

void vp::drawContours ( vpImage< vpRGBa > &  I,
const std::vector< std::vector< vpImagePoint > > &  contours,
const vpColor color 
)

Draw the input contours on the color image.

Parameters
I: Color image where we want to draw the input contours.
contours: Detected contours.
color: Drawing color.

Definition at line 275 of file vpContours.cpp.

References vpRGBa::B, vpRGBa::G, vpImage< Type >::getSize(), and vpRGBa::R.

Referenced by vp::vpContour::setParent().

void vp::findContours ( const vpImage< unsigned char > &  I_original,
vpContour contours,
std::vector< std::vector< vpImagePoint > > &  contourPts,
const vpContourRetrievalType retrievalMode = vp::CONTOUR_RETR_TREE 
)

Extract contours from a binary image.

Parameters
I_original: Input binary image (0 means background, 1 means foreground, other values are not allowed).
contours: Detected contours.
contourPts: List of contours, each contour contains a list of contour points.
retrievalMode: Contour retrieval mode.
Examples:
testContours.cpp, tutorial-contour.cpp, and tutorial-count-coins.cpp.

Definition at line 300 of file vpContours.cpp.

References vpImage< Type >::bitmap, vp::CONTOUR_HOLE, vp::CONTOUR_OUTER, vp::CONTOUR_RETR_EXTERNAL, vp::CONTOUR_RETR_LIST, vp::CONTOUR_RETR_TREE, vpImagePoint::get_i(), vpImagePoint::get_j(), vpImage< Type >::getHeight(), vpImage< Type >::getSize(), vpImage< Type >::getWidth(), vp::vpContour::m_children, vp::vpContour::m_contourType, vp::vpContour::m_parent, vp::vpContour::m_points, vpImagePoint::set_j(), and vp::vpContour::setParent().

Referenced by vp::vpContour::setParent().