Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
BIAS::BlobDetectorBFS< StorageType > Class Template Reference

Detects multiple blobs in an image, image has to be black except blocks to detect. More...

#include <FeatureDetector/BlobDetectorBFS.hh>

+ Inheritance diagram for BIAS::BlobDetectorBFS< StorageType >:
+ Collaboration diagram for BIAS::BlobDetectorBFS< StorageType >:

Public Member Functions

 BlobDetectorBFS ()
 standard constructor More...
 
int Detect (BIAS::Image< StorageType > &image, std::vector< BIAS::BIASBlob > &blobs)
 Detect and return blobs in an image. More...
 
int DrawInImage (BIAS::Image< StorageType > &image)
 draws the detected blobs in image More...
 
int GetLargestBoundingBox (BIAS::BIASBlob &corners)
 return largest blob (bounding box) More...
 
int GetMaxNumBlobs ()
 return maximum number of blobs More...
 
void SetEraseBelowMinSize (bool erase)
 setting this true will clear pixels (0) in clusters of weight < minWeight More...
 
void SetGaussSigma (double sigma)
 set sigma for gaussian blurr before blobdetection More...
 
void SetMaxNumBlobs (const int maxnum)
 
void SetMaxSize (unsigned maxSize)
 
void SetMinSize (unsigned minSize)
 set minimum size of blobs More...
 
void SetROI (const BIAS::Vector2< unsigned > &UL, const BIAS::Vector2< unsigned > &LR)
 set a ROI (region of interest) in the image to detect More...
 
void SetThreshold (StorageType threshold)
 set threshold for blobdetection More...
 
virtual ~BlobDetectorBFS ()
 standard destructor More...
 

Protected Member Functions

int ClusterDescent_ (const unsigned int x, const unsigned int y, const unsigned int w, const unsigned int h, StorageType **idaIn, unsigned char **idaMark, BIAS::BIASBlob &corners, StorageType **idaOrig)
 protected blobDetection function More...
 

Protected Attributes

std::vector< BIAS::BIASBlobcorners_
 
int dMaxNumBlobs_
 maximum number of corners to return More...
 
bool eraseBelowMinWeight_
 
double gaussSigma_
 
BIAS::Image< StorageType > imageSmooth_
 
BIAS::Vector2< unsigned > LR_
 
BIAS::Image< unsigned char > marker_
 
BIAS::Image< unsigned char > markerBackup_
 
BIAS::BIASBlob maxCorners_
 
unsigned maxWeight_
 
unsigned minWeight_
 
BIAS::Gauss< StorageType,
StorageType > 
smoothFilter_
 
StorageType threshold_
 
BIAS::Vector2< unsigned > UL_
 

Detailed Description

template<class StorageType>
class BIAS::BlobDetectorBFS< StorageType >

Detects multiple blobs in an image, image has to be black except blocks to detect.

Author
fkellner/ischiller 07/2008

Definition at line 23 of file BlobDetectorBFS.hh.

Constructor & Destructor Documentation

template<class StorageType >
BlobDetectorBFS::BlobDetectorBFS ( )

standard constructor

Definition at line 13 of file BlobDetectorBFS.cpp.

template<class StorageType >
BlobDetectorBFS::~BlobDetectorBFS ( )
virtual

standard destructor

Definition at line 27 of file BlobDetectorBFS.cpp.

Member Function Documentation

template<class StorageType>
int BlobDetectorBFS::ClusterDescent_ ( const unsigned int  x,
const unsigned int  y,
const unsigned int  w,
const unsigned int  h,
StorageType **  idaIn,
unsigned char **  idaMark,
BIAS::BIASBlob corners,
StorageType **  idaOrig 
)
protected

protected blobDetection function

Parameters
[in]xstart x pixel coordinate
[in]ystart y pixel coordinate
[in]wwidth of search space
[in]hheight of search space
[in]idaIninput image imageDataArray
[out]idaMarkmark image imageDataArray (handled pixels are marked here)
[out]cornersdetected corners
Returns
int 0 on success -1 on failure

Definition at line 145 of file BlobDetectorBFS.cpp.

References BIAS::BIASBlob::centerofmass, BIAS::BIASBlob::LR, BIAS::BIASBlob::UL, and BIAS::BIASBlob::weight.

template<class StorageType>
int BlobDetectorBFS::Detect ( BIAS::Image< StorageType > &  image,
std::vector< BIAS::BIASBlob > &  blobs 
)
virtual

Detect and return blobs in an image.

Parameters
[in]imagethe image to detect blobs in
[out]cornersvector where detected blobs are stored in
Returns
0 on sucess, -1 on failure

Implements BIAS::BlobDetectorBase< StorageType >.

Definition at line 39 of file BlobDetectorBFS.cpp.

References BIAS::ImageBase::CopyIn_NoInit(), BIAS::ImageBase::GetChannelCount(), BIAS::ImageBase::GetHeight(), BIAS::Image< StorageType >::GetImageDataArray(), BIAS::ImageBase::GetWidth(), and BIAS::BIASBlob::weight.

template<class StorageType>
int BlobDetectorBFS::DrawInImage ( BIAS::Image< StorageType > &  image)

draws the detected blobs in image

Parameters
[in]imagethe blobs are drawn in here
Returns
0 on sucess, -1 on failure

Definition at line 321 of file BlobDetectorBFS.cpp.

References BIAS::BIASBlob::centerofmass, BIAS::ImageDraw< StorageType >::CircleCenterFilled(), BIAS::ImageBase::GetChannelCount(), BIAS::BIASBlob::LR, BIAS::ImageDraw< StorageType >::RectangleCorners(), BIAS::ImageConvert::ToRGB(), and BIAS::BIASBlob::UL.

template<class StorageType>
int BIAS::BlobDetectorBFS< StorageType >::GetLargestBoundingBox ( BIAS::BIASBlob corners)
inline

return largest blob (bounding box)

Parameters
cornerslargest detected blob
Returns
0 on sucess, -1 on failure

Definition at line 62 of file BlobDetectorBFS.hh.

template<class StorageType>
int BIAS::BlobDetectorBase< StorageType >::GetMaxNumBlobs ( )
inlineinherited

return maximum number of blobs

Author
ischiller

Definition at line 82 of file BlobDetectorBase.hh.

template<class StorageType>
void BIAS::BlobDetectorBFS< StorageType >::SetEraseBelowMinSize ( bool  erase)
inline

setting this true will clear pixels (0) in clusters of weight < minWeight

Parameters
erasetrue to clean up

Definition at line 108 of file BlobDetectorBFS.hh.

template<class StorageType>
void BIAS::BlobDetectorBFS< StorageType >::SetGaussSigma ( double  sigma)
inline

set sigma for gaussian blurr before blobdetection

Parameters
sigmathe gauss sigma

Definition at line 89 of file BlobDetectorBFS.hh.

template<class StorageType>
void BIAS::BlobDetectorBase< StorageType >::SetMaxNumBlobs ( const int  maxnum)
inlineinherited

Definition at line 74 of file BlobDetectorBase.hh.

template<class StorageType>
void BIAS::BlobDetectorBFS< StorageType >::SetMaxSize ( unsigned  maxSize)
inline

Definition at line 101 of file BlobDetectorBFS.hh.

template<class StorageType>
void BIAS::BlobDetectorBFS< StorageType >::SetMinSize ( unsigned  minSize)
inline

set minimum size of blobs

Parameters
minsizeminimum size in pixel

Definition at line 97 of file BlobDetectorBFS.hh.

template<class StorageType>
void BIAS::BlobDetectorBFS< StorageType >::SetROI ( const BIAS::Vector2< unsigned > &  UL,
const BIAS::Vector2< unsigned > &  LR 
)
inline

set a ROI (region of interest) in the image to detect

Parameters
ULVector2 containing upper left corner
LRVector2 containing lower right corner

Definition at line 52 of file BlobDetectorBFS.hh.

template<class StorageType>
void BIAS::BlobDetectorBFS< StorageType >::SetThreshold ( StorageType  threshold)
inline

set threshold for blobdetection

Parameters
thresholddifference between background (black) and blob content

Definition at line 81 of file BlobDetectorBFS.hh.

Member Data Documentation

template<class StorageType>
std::vector<BIAS::BIASBlob> BIAS::BlobDetectorBFS< StorageType >::corners_
protected

Definition at line 133 of file BlobDetectorBFS.hh.

template<class StorageType>
int BIAS::BlobDetectorBase< StorageType >::dMaxNumBlobs_
protectedinherited

maximum number of corners to return

Definition at line 89 of file BlobDetectorBase.hh.

template<class StorageType>
bool BIAS::BlobDetectorBFS< StorageType >::eraseBelowMinWeight_
protected

Definition at line 139 of file BlobDetectorBFS.hh.

template<class StorageType>
double BIAS::BlobDetectorBFS< StorageType >::gaussSigma_
protected

Definition at line 135 of file BlobDetectorBFS.hh.

template<class StorageType>
BIAS::Image<StorageType> BIAS::BlobDetectorBFS< StorageType >::imageSmooth_
protected

Definition at line 137 of file BlobDetectorBFS.hh.

template<class StorageType>
BIAS::Vector2<unsigned> BIAS::BlobDetectorBFS< StorageType >::LR_
protected

Definition at line 131 of file BlobDetectorBFS.hh.

template<class StorageType>
BIAS::Image<unsigned char> BIAS::BlobDetectorBFS< StorageType >::marker_
protected

Definition at line 130 of file BlobDetectorBFS.hh.

template<class StorageType>
BIAS::Image<unsigned char> BIAS::BlobDetectorBFS< StorageType >::markerBackup_
protected

Definition at line 130 of file BlobDetectorBFS.hh.

template<class StorageType>
BIAS::BIASBlob BIAS::BlobDetectorBFS< StorageType >::maxCorners_
protected

Definition at line 132 of file BlobDetectorBFS.hh.

template<class StorageType>
unsigned BIAS::BlobDetectorBFS< StorageType >::maxWeight_
protected

Definition at line 138 of file BlobDetectorBFS.hh.

template<class StorageType>
unsigned BIAS::BlobDetectorBFS< StorageType >::minWeight_
protected

Definition at line 138 of file BlobDetectorBFS.hh.

template<class StorageType>
BIAS::Gauss<StorageType,StorageType> BIAS::BlobDetectorBFS< StorageType >::smoothFilter_
protected

Definition at line 136 of file BlobDetectorBFS.hh.

template<class StorageType>
StorageType BIAS::BlobDetectorBFS< StorageType >::threshold_
protected

Definition at line 134 of file BlobDetectorBFS.hh.

template<class StorageType>
BIAS::Vector2<unsigned> BIAS::BlobDetectorBFS< StorageType >::UL_
protected

Definition at line 131 of file BlobDetectorBFS.hh.


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