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

Evaluates a segementation into fore/back-ground. More...

#include <FeatureDetector/BlobDetectorLevelSet.hh>

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

Public Member Functions

void AddEvaluationSquare (const BIAS::Vector2< int > &p1, const BIAS::Vector2< int > &p2)
 look at SetEvaluationSquare() More...
 
 BlobDetectorLevelSet ()
 
int Detect (Image< StorageType > &image, std::vector< BIAS::BIASBlob > &blobs)
 purely virtual interface definition More...
 
void Evolute ()
 does the hole segmentation work by modifying the level set (look at class discription) More...
 
const BIAS::Image< StorageType > & GetEval () const
 returns (roi) msk (the evaluation array) as an image More...
 
BIAS::Image< StorageType > & GetEval ()
 returns (roi) msk (the evaluation array) as an image (is allowed to be modified, iff image's roi is not in use) More...
 
std::vector< int > GetHistogram (int hist)
 
const BIAS::Image< StorageType > & GetImage () const
 returns reference of currently used image More...
 
const BIAS::Image< StorageType > & GetLevel () const
 returns the actual level set, modified each time you call Evolute() More...
 
BIAS::Image< StorageType > & GetLevel ()
 returns the actual level set, modified each time you call Evolute(), (is allowed to be modified), (0 is background, != 0 is foreground) More...
 
int GetMaxNumBlobs ()
 return maximum number of blobs More...
 
void GetSegmentation (BIAS::Image< StorageType > &im) const
 creates an image for visulalistion of the actual segmentation given by actual level set More...
 
void Init (const BIAS::Image< StorageType > &image, bool useROI=true)
 initialise this instance with given image, note: image must not be modified until you delete this instance or an other image is set, the image's roi msk defines the evaluation area (if given) More...
 
void InitLevelSetSquare (const BIAS::Vector2< int > &p1, const BIAS::Vector2< int > &p2)
 look at class discription More...
 
void Set (const BIAS::Image< StorageType > &image, bool useROI=true)
 sets image to operate on, note: image must not be modified until you delete this instance or an other image is set, the image's roi msk defines the evaluation area (if given) More...
 
void SetEvaluationSquare (const BIAS::Vector2< int > &p1, const BIAS::Vector2< int > &p2)
 can be used only, iff image's roi is not in use (look at class discription) More...
 
void SetMaxNumBlobs (const int maxnum)
 
virtual ~BlobDetectorLevelSet ()
 

Protected Member Functions

void AddSquare (BIAS::Image< StorageType > &image, const BIAS::Vector2< int > &p1, const BIAS::Vector2< int > &p2)
 
void ClearHistograms ()
 
void RecalcHistograms ()
 

Static Protected Member Functions

static void ClearHistogram (int hist[])
 
static void Resize (BIAS::Image< StorageType > &image, const int w, const int h)
 

Protected Attributes

int _hist0 [256]
 
int _hist1 [256]
 
int dMaxNumBlobs_
 maximum number of corners to return More...
 
BIAS::Image< StorageType > eval_
 
bool eval_ownsdata_
 
const BIAS::Image< StorageType > * image_
 
BIAS::Image< StorageType > * level_
 
BIAS::Image< StorageType > * level_s_
 

Detailed Description

template<class StorageType>
class BIAS::BlobDetectorLevelSet< StorageType >

Evaluates a segementation into fore/back-ground.

Usage: Initialise class with an image by calling Init(), if the image roi has a valid mask it is used as evaluation area. Set an initial level set square (use InitLevelSetSquare). Set a evaluation square, if the image has no valid roi mask. Than call Evolute() round about 100 times (or what ever it will needs).

What you get: The segmentation of image is given by GetLevel(), but GetSegmentation() creats an image much better for visalisation.


Please take a look at example ExampleSegmentationLevelSet, which visualises the Evolute() steps.

Test:
tested with ExampleBlobDetectorLevelSet.cpp
Author
Dennis Herzog, 2005-07-28, edited ischiller 08/08
Examples:
ExampleBlobDetectorLevelSet.cpp.

Definition at line 35 of file BlobDetectorLevelSet.hh.

Constructor & Destructor Documentation

template<class StorageType >
BlobDetectorLevelSet::BlobDetectorLevelSet ( )

Definition at line 12 of file BlobDetectorLevelSet.cpp.

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

Definition at line 21 of file BlobDetectorLevelSet.cpp.

Member Function Documentation

template<class StorageType >
void BlobDetectorLevelSet::AddEvaluationSquare ( const BIAS::Vector2< int > &  p1,
const BIAS::Vector2< int > &  p2 
)

look at SetEvaluationSquare()

Definition at line 231 of file BlobDetectorLevelSet.cpp.

template<class StorageType >
void BlobDetectorLevelSet::AddSquare ( BIAS::Image< StorageType > &  image,
const BIAS::Vector2< int > &  p1,
const BIAS::Vector2< int > &  p2 
)
protected
template<class StorageType >
void BlobDetectorLevelSet::ClearHistogram ( int  hist[])
staticprotected

Definition at line 90 of file BlobDetectorLevelSet.cpp.

template<class StorageType >
void BlobDetectorLevelSet::ClearHistograms ( )
protected

Definition at line 97 of file BlobDetectorLevelSet.cpp.

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

purely virtual interface definition

Implements BIAS::BlobDetectorBase< StorageType >.

Definition at line 33 of file BlobDetectorLevelSet.cpp.

References BIAS::ImageBase::GetROI(), and BIAS::ROI::MaskValid().

template<class StorageType >
void BlobDetectorLevelSet::Evolute ( )

does the hole segmentation work by modifying the level set (look at class discription)

Author
Bodo Rosenhahn / ported and optimised by Dennis Herzog, 2005-07-28

Definition at line 242 of file BlobDetectorLevelSet.cpp.

template<class StorageType>
const BIAS::Image<StorageType>& BIAS::BlobDetectorLevelSet< StorageType >::GetEval ( ) const
inline

returns (roi) msk (the evaluation array) as an image

Author
Dennis Herzog, 2005-07-28

Definition at line 88 of file BlobDetectorLevelSet.hh.

template<class StorageType>
BIAS::Image<StorageType>& BIAS::BlobDetectorLevelSet< StorageType >::GetEval ( )
inline

returns (roi) msk (the evaluation array) as an image (is allowed to be modified, iff image's roi is not in use)

Author
Dennis Herzog, 2005-07-28

Definition at line 93 of file BlobDetectorLevelSet.hh.

template<class StorageType >
std::vector< int > BlobDetectorLevelSet::GetHistogram ( int  hist)
Returns
histogram of foreground (hist=1) and background (hist=0)
Author
Dennis Herzog, 2005-07-28

Definition at line 64 of file BlobDetectorLevelSet.cpp.

template<class StorageType>
const BIAS::Image<StorageType>& BIAS::BlobDetectorLevelSet< StorageType >::GetImage ( ) const
inline

returns reference of currently used image

Author
Dennis Herzog, 2005-07-28

Definition at line 84 of file BlobDetectorLevelSet.hh.

template<class StorageType>
const BIAS::Image<StorageType>& BIAS::BlobDetectorLevelSet< StorageType >::GetLevel ( ) const
inline

returns the actual level set, modified each time you call Evolute()

Author
Dennis Herzog, 2005-07-28

Definition at line 99 of file BlobDetectorLevelSet.hh.

template<class StorageType>
BIAS::Image<StorageType>& BIAS::BlobDetectorLevelSet< StorageType >::GetLevel ( )
inline

returns the actual level set, modified each time you call Evolute(), (is allowed to be modified), (0 is background, != 0 is foreground)

Author
Dennis Herzog, 2005-07-28

Definition at line 106 of file BlobDetectorLevelSet.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 BlobDetectorLevelSet::GetSegmentation ( BIAS::Image< StorageType > &  im) const

creates an image for visulalistion of the actual segmentation given by actual level set

Author
Dennis Herzog, 2005-07-28

Definition at line 46 of file BlobDetectorLevelSet.cpp.

References BIAS::Image< StorageType >::GetImageDataArray().

template<class StorageType >
void BlobDetectorLevelSet::Init ( const BIAS::Image< StorageType > &  image,
bool  useROI = true 
)

initialise this instance with given image, note: image must not be modified until you delete this instance or an other image is set, the image's roi msk defines the evaluation area (if given)

Author
Dennis Herzog, 2005-07-28

Definition at line 185 of file BlobDetectorLevelSet.cpp.

References BIAS::ImageBase::GetHeight(), and BIAS::ImageBase::GetWidth().

template<class StorageType >
void BlobDetectorLevelSet::InitLevelSetSquare ( const BIAS::Vector2< int > &  p1,
const BIAS::Vector2< int > &  p2 
)

look at class discription

Author
Dennis Herzog, 2005-07-28

Definition at line 211 of file BlobDetectorLevelSet.cpp.

template<class StorageType >
void BlobDetectorLevelSet::RecalcHistograms ( )
protected

Definition at line 104 of file BlobDetectorLevelSet.cpp.

template<class StorageType >
void BlobDetectorLevelSet::Resize ( BIAS::Image< StorageType > &  image,
const int  w,
const int  h 
)
staticprotected
template<class StorageType >
void BlobDetectorLevelSet::Set ( const BIAS::Image< StorageType > &  image,
bool  useROI = true 
)

sets image to operate on, note: image must not be modified until you delete this instance or an other image is set, the image's roi msk defines the evaluation area (if given)

Author
Dennis Herzog, 2005-08-01

Definition at line 156 of file BlobDetectorLevelSet.cpp.

References BIAS::ImageBase::GetHeight(), BIAS::ImageBase::GetImageData(), BIAS::ROI::GetMaskImage(), BIAS::ImageBase::GetROI(), BIAS::ImageBase::GetWidth(), and BIAS::ROI::MaskValid().

template<class StorageType >
void BlobDetectorLevelSet::SetEvaluationSquare ( const BIAS::Vector2< int > &  p1,
const BIAS::Vector2< int > &  p2 
)

can be used only, iff image's roi is not in use (look at class discription)

Author
Dennis Herzog, 2005-07-28

Definition at line 220 of file BlobDetectorLevelSet.cpp.

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

Definition at line 74 of file BlobDetectorBase.hh.

Member Data Documentation

template<class StorageType>
int BIAS::BlobDetectorLevelSet< StorageType >::_hist0[256]
protected

Definition at line 118 of file BlobDetectorLevelSet.hh.

template<class StorageType>
int BIAS::BlobDetectorLevelSet< StorageType >::_hist1[256]
protected

Definition at line 119 of file BlobDetectorLevelSet.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>
BIAS::Image<StorageType> BIAS::BlobDetectorLevelSet< StorageType >::eval_
protected

Definition at line 124 of file BlobDetectorLevelSet.hh.

template<class StorageType>
bool BIAS::BlobDetectorLevelSet< StorageType >::eval_ownsdata_
protected

Definition at line 125 of file BlobDetectorLevelSet.hh.

template<class StorageType>
const BIAS::Image<StorageType>* BIAS::BlobDetectorLevelSet< StorageType >::image_
protected

Definition at line 121 of file BlobDetectorLevelSet.hh.

template<class StorageType>
BIAS::Image<StorageType>* BIAS::BlobDetectorLevelSet< StorageType >::level_
protected

Definition at line 122 of file BlobDetectorLevelSet.hh.

template<class StorageType>
BIAS::Image<StorageType>* BIAS::BlobDetectorLevelSet< StorageType >::level_s_
protected

Definition at line 123 of file BlobDetectorLevelSet.hh.


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