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

Utility class for image flood filling. More...

#include <FloodFiller.h>

Classes

struct  DefaultCriterion
 predefined criterion for simple reference-value based filling for 1-channel images More...
 
struct  ReferenceColorCriterion
 predefined criterion for simple reference-value based filling for 3-channel images More...
 
struct  Result
 result structure, returned by the 'apply' methods More...
 

Public Member Functions

const Resultapply (const core::ImgBase *image, const utils::Point &seed, double referenceValue, double threshold)
 flood-fills the given grayscale image starting from given seed point. More...
 
const ResultapplyColor (const core::ImgBase *image, const utils::Point &seed, double refR, double refG, double refB, double threshold)
 flood-fills the given 3-channel image starting from the given seed point More...
 
template<class T , class Criterion >
const ResultapplyGeneric (const core::Img< T > &image, const utils::Point &seed, Criterion crit)
 generic grayscale image floodfilling using an arbitrary filling criterion More...
 
template<class T , class Criterion3Channels >
const ResultapplyColorGeneric (const core::Img< T > &image, const utils::Point &seed, Criterion3Channels crit)
 generic floodfilling algorithm for 3-channel color images More...
 

Public Attributes

struct ICLCV_API icl::cv::FloodFiller::Result result
 

Private Member Functions

utils::Rect prepare (const utils::Size &imageSize, const utils::Point &seed)
 internal utility method More...
 

Private Attributes

std::vector< utils::PointfuturePoints
 internal list of to-be-processed points More...
 

Detailed Description

Utility class for image flood filling.

The flood filler implements a generic flood filling algorithm. Starting with a seed region that contains just a single point, the flood filler will collect all adjacent pixels of this region recursively that meet a certain criterion. The criterion is the template parameter of the FloodFiller's icl::FloodFiller::applyGeneric template method. For convenience, the most common criterions are pre-coded and directly usable by calling the non-template methods icl::FloodFiller::apply and icl::FloodFiller::applyColor.

Member Function Documentation

const Result& icl::cv::FloodFiller::apply ( const core::ImgBase image,
const utils::Point seed,
double  referenceValue,
double  threshold 
)

flood-fills the given grayscale image starting from given seed point.

Image pixels are filled if their pixel value difference to the given referenceValue is less then the given threshold

const Result& icl::cv::FloodFiller::applyColor ( const core::ImgBase image,
const utils::Point seed,
double  refR,
double  refG,
double  refB,
double  threshold 
)

flood-fills the given 3-channel image starting from the given seed point

Here, the fill-criterion is the euclidian distance to the given (refR,refG,regB) reference color, which must be less than the given threshold

template<class T , class Criterion3Channels >
const Result& icl::cv::FloodFiller::applyColorGeneric ( const core::Img< T > &  image,
const utils::Point seed,
Criterion3Channels  crit 
)
inline

generic floodfilling algorithm for 3-channel color images

the criterion function or functor gets all 3-channel pixel values as arguments. Take a look at the icl::Floodfiller::ReferenceColorCriterion class template for more details.

template<class T , class Criterion >
const Result& icl::cv::FloodFiller::applyGeneric ( const core::Img< T > &  image,
const utils::Point seed,
Criterion  crit 
)
inline

generic grayscale image floodfilling using an arbitrary filling criterion

The criterion-function or functor is evaluated by giving it pixel values Take a look at the icl::FloodFiller::DefaultCriterion class for more details.

utils::Rect icl::cv::FloodFiller::prepare ( const utils::Size imageSize,
const utils::Point seed 
)
private

internal utility method

Member Data Documentation

std::vector<utils::Point> icl::cv::FloodFiller::futurePoints
private

internal list of to-be-processed points

struct ICLCV_API icl::cv::FloodFiller::Result icl::cv::FloodFiller::result

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