Image Component Library (ICL)
|
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 Result & | apply (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 Result & | 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 More... | |
template<class T , class Criterion > | |
const Result & | applyGeneric (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 Result & | applyColorGeneric (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::Point > | futurePoints |
internal list of to-be-processed points More... | |
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.
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
|
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.
|
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.
|
private |
internal utility method
|
private |
internal list of to-be-processed points
struct ICLCV_API icl::cv::FloodFiller::Result icl::cv::FloodFiller::result |