CVB++ 14.0
BlobFilter Class Referencefinal

Class to build a filter for the blob search. More...

#include <cvb/foundation/blob.hpp>

Public Member Functions

 BlobFilter ()=default
 Default filter without any filter set. More...
 
Cvb::Foundation::Blob::BlobBorderFilter BorderFilter () const noexcept
 Gets whether to filter blobs that touch the borders of the image. More...
 
void SetBorderFilter (Cvb::Foundation::Blob::BlobBorderFilter borderFilter) noexcept
 Sets whether to filter blobs that touch the borders of the image. More...
 
bool ContainsRangeFilter (BlobRangeFilter rangeFilter) const noexcept
 Check if a range filter exists. More...
 
ValueRange< int > & operator[] (BlobRangeFilter rangeFilter)
 Sets the range filters via an attribute. More...
 

Friends

std::vector< BlobResultBinarizeAndSearchBlobs (const ImagePlane &plane, ValueRange< int > binarizationThreshold, const BlobFilter &filter)
 Searches for all blobs in the given image plane. More...
 
std::vector< BlobResultBinarizeAndSearchBlobs (const ImagePlane &plane, ValueRange< int > binarizationThreshold, Rect< int > aoi, const BlobFilter &filter)
 Searches for all blobs in the given image plane. More...
 
std::vector< BlobResultSearchBlobs (const Image &binarizedImage, const BlobFilter &filter)
 Searches for all blobs in the given binarized image. More...
 
std::vector< BlobResultSearchBlobs (const Image &binarizedImage, Rect< int > aoi, const BlobFilter &filter)
 Searches for all blobs in the given binarized image. More...
 

Detailed Description

Class to build a filter for the blob search.

Examples
Foundation/QmlBlobSearch.

Constructor & Destructor Documentation

◆ BlobFilter()

BlobFilter ( )
default

Default filter without any filter set.

Exceptions
Anyexception derived from std::exception including CvbException.

Member Function Documentation

◆ BorderFilter()

Cvb::Foundation::Blob::BlobBorderFilter BorderFilter ( ) const
inlinenoexcept

Gets whether to filter blobs that touch the borders of the image.

Returns
The border filter flags.
Exceptions
Doesnot throw any exception.

◆ ContainsRangeFilter()

bool ContainsRangeFilter ( BlobRangeFilter  rangeFilter) const
inlinenoexcept

Check if a range filter exists.

Parameters
[in]rangeFilterThe range filter attribute.
Returns
True if a range filter for the given attribute exists, false otherwise.
Exceptions
Doesnot throw any exception.

◆ operator[]()

ValueRange< int > & operator[] ( BlobRangeFilter  rangeFilter)
inline

Sets the range filters via an attribute.

Parameters
[in]rangeFilterThe filter range attribute.
Returns
The filter range.
Exceptions
Anyexception derived from std::exception including CvbException.

If a a filter range is read from default/empty filter an invalid range is returned. So you should check if a range filter exists for a given attribute using ContainsRangeFilter().

◆ SetBorderFilter()

void SetBorderFilter ( Cvb::Foundation::Blob::BlobBorderFilter  borderFilter)
inlinenoexcept

Sets whether to filter blobs that touch the borders of the image.

Parameters
[in]borderFilterThe border filter flags.
Exceptions
Doesnot throw any exception.

Friends And Related Function Documentation

◆ BinarizeAndSearchBlobs [1/2]

std::vector< BlobResult > BinarizeAndSearchBlobs ( const ImagePlane plane,
ValueRange< int >  binarizationThreshold,
const BlobFilter filter 
)
friend

Searches for all blobs in the given image plane.

Parameters
[in]planeImage plane to process.
[in]binarizationThresholdMinimum and maximum gray values (inclusive) to be considered as an object.
[in]filterFilter which blobs are to be returned.
Returns
Unordered blob results.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ BinarizeAndSearchBlobs [2/2]

std::vector< BlobResult > BinarizeAndSearchBlobs ( const ImagePlane plane,
ValueRange< int >  binarizationThreshold,
Rect< int >  aoi,
const BlobFilter filter 
)
friend

Searches for all blobs in the given image plane.

Parameters
[in]planeImage plane to process.
[in]binarizationThresholdMinimum and maximum gray values (inclusive) to be considered as an object.
[in]aoiRegion in which blobs are to be searched.
[in]filterFilter which blobs are to be returned.
Returns
Unordered blob results.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ SearchBlobs [1/2]

std::vector< BlobResult > SearchBlobs ( const Image binarizedImage,
const BlobFilter filter 
)
friend

Searches for all blobs in the given binarized image.

Parameters
[in]binarizedImageImage consisting only of 0 and 255.
[in]filterFilter which blobs are to be returned.
Returns
Unordered blob results.
Exceptions
Anyexception derived from std::exception including CvbException.

Image containing pixels with values 0 or 255. 255 marks an object.

◆ SearchBlobs [2/2]

std::vector< BlobResult > SearchBlobs ( const Image binarizedImage,
Rect< int >  aoi,
const BlobFilter filter 
)
friend

Searches for all blobs in the given binarized image.

Parameters
[in]binarizedImageImage consisting only of 0 and 255.
[in]aoiRegion in which blobs are to be searched.
[in]filterFilter which blobs are to be returned.
Returns
Unordered blob results.
Exceptions
Anyexception derived from std::exception including CvbException.

Image containing pixels with values 0 or 255. 255 marks an object.