Image Component Library (ICL)
Public Types | Public Member Functions | Private Attributes | List of all members
icl::cv::ContourDetector Class Reference

The ContourDetector extracts all contours of a given image. More...

#include <ContourDetector.h>

Inheritance diagram for icl::cv::ContourDetector:
icl::utils::Uncopyable

Public Types

enum  Algorithm { Fast, Accurate, AccurateWithHierarchy }
 contour tracing algorithm used More...
 

Public Member Functions

 ContourDetector (const icl8u thresh=128, Algorithm a=Fast)
 
virtual ~ContourDetector ()
 
void drawAllContours (core::ImgBase *img, const icl64f &value)
 
const std::vector< Contour > & detect (const core::ImgBase *image)
 
const std::vector< Contour > & detect (core::Img8u &image)
 
void setThreshold (const icl8u &threshold)
 sets new binarization threshold More...
 
void setAlgorithm (Algorithm a)
 sets whether a contour hierarchy is created More...
 

Private Attributes

Data * m_data
 internal data pointer More...
 

Additional Inherited Members

- Protected Member Functions inherited from icl::utils::Uncopyable
 Uncopyable ()
 Empty base constructor. More...
 

Detailed Description

The ContourDetector extracts all contours of a given image.

Internally, the implementation works on binary images only, but a compatiblity layer is provided that allows for working on arbitraryly-typed images by internally converting the input image before the compuation takes place. The algorithms alters the values of the input image for performance reasons. If a const image is passed to the ContourDetector::detect method, the image is copied/converted before

Contour Hierarchy

The ContourDetector can be set up to also extract a countour hierarchy.

Algorithms

Internally 2 different contour tracing algorithms are implemented. While the "Fast" method uses a 4-point neighbourhood, the Accurate method uses a 8-point neighborhood an can also optionally be used to obtain a region hierarchy. The fast method uses its own memory allocator to improve runtime performance.

Member Enumeration Documentation

◆ Algorithm

contour tracing algorithm used

Enumerator
Fast 

fast contour detection algorithm (using 4-point neighbourhood)

Accurate 

accurate contour detection algorithm (using 8-point neighborhood)

AccurateWithHierarchy 

same as Accurate, but with Hierarchy estimation

Constructor & Destructor Documentation

◆ ContourDetector()

icl::cv::ContourDetector::ContourDetector ( const icl8u  thresh = 128,
Algorithm  a = Fast 
)
Parameters
theshthreshold for creating the binary image
hierarchyshows if the relationship of the contours should be calculated

◆ ~ContourDetector()

virtual icl::cv::ContourDetector::~ContourDetector ( )
virtual

Member Function Documentation

◆ detect() [1/2]

const std::vector<Contour>& icl::cv::ContourDetector::detect ( const core::ImgBase image)

◆ detect() [2/2]

const std::vector<Contour>& icl::cv::ContourDetector::detect ( core::Img8u image)

◆ drawAllContours()

void icl::cv::ContourDetector::drawAllContours ( core::ImgBase img,
const icl64f value 
)

◆ setAlgorithm()

void icl::cv::ContourDetector::setAlgorithm ( Algorithm  a)

sets whether a contour hierarchy is created

◆ setThreshold()

void icl::cv::ContourDetector::setThreshold ( const icl8u threshold)

sets new binarization threshold

Member Data Documentation

◆ m_data

Data* icl::cv::ContourDetector::m_data
private

internal data pointer


The documentation for this class was generated from the following file: