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

data object which holds all infomations of a B-Spline curve (ContourBSpline); its shared by B-Spline curves with same basis. More...

#include <FeatureDetector/ContourBSplineData.hh>

+ Inheritance diagram for BIAS::ContourBSplineData:
+ Collaboration diagram for BIAS::ContourBSplineData:

Public Member Functions

void AddDebugLevel (const long int lv)
 
void AddDebugLevel (const std::string &name)
 
void ComputeAreaCoefficientMatrix_ ()
 computes the area coefficient matrix of the B-Spline curve More...
 
BIAS::Polynom ComputeBasePolynomRecursive_ (const unsigned int span, const unsigned int knotIndex, const unsigned int order, const std::vector< int > &breakpoints)
 recursivly computes one base polynom for a span matrix More...
 
void ComputeSpan_ (const unsigned int span, const int placeOff, const std::vector< unsigned int > &kMult, const std::vector< int > &k)
 computes the span matrix of a B-Spline curves span More...
 
void ComputeSplineMetricMatrix_ ()
 computes the metric matrix (scriptB) of the B-Spline curve More...
 
void ComputeSplineMetricMatrixParametric_ ()
 computes the metrix matrix (I^2 x scriptB) of the B-Spline curve More...
 
 ContourBSplineData ()
 empty standard constructor More...
 
bool DebugLevelIsSet (const long int lv) const
 
bool DebugLevelIsSet (const std::string &name) const
 
int GetDebugLevel () const
 
std::ostream & GetDebugStream () const
 
void GetDebugStream (std::ostream &os) const
 
long int Name2DebugLevel (const std::string &name) const
 looks up a debuglevel in the internal map, returns 0 if not found More...
 
long int NewDebugLevel (const std::string &name)
 creates a new debuglevel More...
 
void PrintDebugLevel (std::ostream &os=std::cout) const
 
void RegisterAperiodicBSpline_ ()
 inits class variables for an open B-Spline curve More...
 
void RegisterPeriodicBSpline_ ()
 inits class variables for a closed B-Spline curve More...
 
void RemoveDebugLevel (const long int lv)
 
void RemoveDebugLevel (const std::string &name)
 
void SetDebugLevel (const long int lv)
 
void SetDebugLevel (const std::string &name)
 
void SetDebugStream (const std::ostream &os)
 
void ShowDebugLevel (std::ostream &os=std::cout) const
 prints all internally known debuglevels More...
 
void Unregister ()
 decrements reference counter to this data object and deletes it if there is no reference to it More...
 
 ~ContourBSplineData ()
 destructor More...
 

Static Public Member Functions

static long int GetGlobalDebugLevel ()
 
static ContourBSplineDataLookUpData_ (const unsigned int order, const ContourBSplineType::Type bType, const std::vector< unsigned int > &mPnts)
 looks up if a ContourBSplineData object with the initial given parameter exist and returns pointer to it or NULL More...
 
static ContourBSplineDataRegister (const unsigned int order, const ContourBSplineType::Type bType, const std::vector< unsigned int > &mPnts)
 registers a ContourBSpline object and returns pointer to its data object More...
 
static ContourBSplineDataRegister (const std::vector< ContourBSplineData * > &bSplinesData)
 registers a clustered ContourBSpline object and returns pointer to its data object More...
 
static ContourBSplineDataRegister (const unsigned int order, const ContourBSplineType::Type bType, const std::vector< unsigned int > &mPnts, const unsigned int numBasePolynoms, const unsigned int numSpans, const std::vector< unsigned int > &numSpansVec, const std::vector< BIAS::Matrix< double > > &placedSpanMatrices)
 registers a clustered ContourBSpline object and returns pointer to its data object More...
 
static void SetGlobalDebugLevel (long int lev)
 

Public Attributes

BIAS::Matrix< double > areaCoefficientMatrix_
 area coefficient matrix - confer to "Active Contours", chapter 3, p.65 More...
 
ContourBSplineType::Type bType_
 type of B-Spline curve (Open,Closed,Cluster) More...
 
std::vector< unsigned int > mPnts_
 vector of multiplicities - determines in which control points edges are modelled More...
 
unsigned int numBasePolynoms_
 number of base polynoms of curve - equal to number of control points More...
 
unsigned int numSpans_
 number of spans of curve More...
 
std::vector< unsigned int > numSpansVec_
 number of spans for sub B-Spline curves of the B-Spline curve length >1 when curve is clustered More...
 
unsigned int order_
 order of B-Spline curve More...
 
std::vector< BIAS::Matrix
< double > > 
placedSpanMatrices_
 span matrices of curve (multiplied with placement matrices - p.292) More...
 
unsigned int reference_
 reference counter - for handling unregister More...
 
BIAS::Matrix< double > splineMetricMatrix_
 metric matrix - confer to "Active Contours", chapter 3, p.50f More...
 
BIAS::Matrix< double > splineMetricMatrixParametric_
 metric matrix - confer to "Active Contours", chapter 3, p.59 More...
 

Static Public Attributes

static std::list
< ContourBSplineData * > 
pntr_
 list of all pointers to ContourBSplineData objects More...
 

Protected Member Functions

long ConsumeNextFreeDebuglevel_ ()
 returns the next available debuglevel More...
 

Protected Attributes

long int _liDebugLevel
 
long int _liNextDebugLevel
 new concept, debuglevel are managed here in the debug class More...
 
std::map< std::string, long int > _String2Debuglevel
 

Static Protected Attributes

static std::ostream _zDebugStream
 
static long int GlobalDebugLevel = 0
 

Friends

class ContourBSpline
 
class ContourBSplineShapeMatrix
 

Detailed Description

data object which holds all infomations of a B-Spline curve (ContourBSpline); its shared by B-Spline curves with same basis.

Objects of this class save informations of a B-Spline curve (ContourBSpline). If two or more ContourBSpline objects are initialised with the same order, type and multiplicity vector, then they share the same ContourBSplineData object. (Attention: shape-space and regularisation matrices are handled by class ContourBSplineShapeMatrix.)

A ContourBSplineData object is created/registered transparently by a call of a ContourBSpline objects Init(...) or Load(...) function. These functions call Register(...) of this class. The Register(...) function looks if it allready has the right data object. If yes, it registers the ContourBSpline object by incrementing the reference counter of the data object and returns the pointer to the data object. If not, it uses the input parameter to create a new data object. Details of creation process are documented in book "Active Contours", mainly in appendix A.

If a ContourBSpline objects gets destroyed it calls the Unregister function of ContourBSplineData object. The reference counter gets decremented and the data object destroyed if the reference counter is zero.

Definition at line 73 of file ContourBSplineData.hh.

Constructor & Destructor Documentation

BIAS::ContourBSplineData::ContourBSplineData ( )
inline

empty standard constructor

Definition at line 78 of file ContourBSplineData.hh.

BIAS::ContourBSplineData::~ContourBSplineData ( )
inline

destructor

Definition at line 81 of file ContourBSplineData.hh.

References Unregister().

Member Function Documentation

void BIAS::Debug::AddDebugLevel ( const long int  lv)
inlineinherited
void BIAS::Debug::AddDebugLevel ( const std::string &  name)
inlineinherited

Definition at line 362 of file Debug.hh.

void ContourBSplineData::ComputeAreaCoefficientMatrix_ ( )

computes the area coefficient matrix of the B-Spline curve

Confer to "Active Contours" chapter 3, p.65; appendix A, p.293 for details.

Definition at line 504 of file ContourBSplineData.cpp.

References BIAS::Matrix< T >::MultiplyIP(), BIAS::Matrix< T >::MultLeft(), and BIAS::Matrix< T >::SetZero().

Referenced by Register().

BIAS::Polynom ContourBSplineData::ComputeBasePolynomRecursive_ ( const unsigned int  span,
const unsigned int  knotIndex,
const unsigned int  order,
const std::vector< int > &  breakpoints 
)

recursivly computes one base polynom for a span matrix

Parameters
[in]spanindex of span which includes base polynom
[in]knotIndexindex of first knot of base polynom
[in]orderorder of B-Spline curve
[in]breakpointsvector of knot values

Confer to "Active Contours" appendix A p.291 for details.

Definition at line 353 of file ContourBSplineData.cpp.

References BIAS::Polynom::SetOrder().

void ContourBSplineData::ComputeSpan_ ( const unsigned int  span,
const int  placeOff,
const std::vector< unsigned int > &  kMult,
const std::vector< int > &  k 
)

computes the span matrix of a B-Spline curves span

Parameters
[in]spanindex of span whose matrix should be computed
[in]placeOffoffset used in periodic case for index of first knot of a span
[in]kMultvector of multiplicities of knots
[in]kvector of knots values (plain)

Confer to "Active Contours" appendix A p.291 for details.

Definition at line 398 of file ContourBSplineData.cpp.

References BIAS::Matrix< T >::MultLeft(), and BIAS::ContourBSplineType::Open.

void ContourBSplineData::ComputeSplineMetricMatrix_ ( )

computes the metric matrix (scriptB) of the B-Spline curve

Confer to "Active Contours" chapter 3, p.50f; appendix A, p.293 for details.

Definition at line 448 of file ContourBSplineData.cpp.

References BIAS::Matrix< T >::MultiplyIP(), BIAS::Matrix< T >::MultLeft(), TNT::Matrix< T >::newsize(), and BIAS::Matrix< T >::SetIdentity().

Referenced by Register().

void ContourBSplineData::ComputeSplineMetricMatrixParametric_ ( )

computes the metrix matrix (I^2 x scriptB) of the B-Spline curve

Confer to "Active Contours" chapter 3, p.59; appendix A, p.293 for details.

Definition at line 477 of file ContourBSplineData.cpp.

Referenced by Register().

long BIAS::Debug::ConsumeNextFreeDebuglevel_ ( )
inlineprotectedinherited

returns the next available debuglevel

Author
woelk 09/2006

Definition at line 521 of file Debug.hh.

bool BIAS::Debug::DebugLevelIsSet ( const long int  lv) const
inlineinherited
bool BIAS::Debug::DebugLevelIsSet ( const std::string &  name) const
inlineinherited

Definition at line 350 of file Debug.hh.

int BIAS::Debug::GetDebugLevel ( ) const
inlineinherited
std::ostream& BIAS::Debug::GetDebugStream ( ) const
inlineinherited

Definition at line 405 of file Debug.hh.

void BIAS::Debug::GetDebugStream ( std::ostream &  os) const
inlineinherited

Definition at line 414 of file Debug.hh.

static long int BIAS::Debug::GetGlobalDebugLevel ( )
inlinestaticinherited

Definition at line 431 of file Debug.hh.

ContourBSplineData * ContourBSplineData::LookUpData_ ( const unsigned int  order,
const ContourBSplineType::Type  bType,
const std::vector< unsigned int > &  mPnts 
)
static

looks up if a ContourBSplineData object with the initial given parameter exist and returns pointer to it or NULL

Parameters
[in]orderorder of B-Spline curve
[in]bTypetype of B-Spline curve (Open or Closed)
[in]mPntsmultiplicity vector of curve (determines in which control points edges are modelled

Definition at line 178 of file ContourBSplineData.cpp.

long int BIAS::Debug::Name2DebugLevel ( const std::string &  name) const
inlineinherited

looks up a debuglevel in the internal map, returns 0 if not found

Author
woelk 09/2006

Definition at line 454 of file Debug.hh.

long int BIAS::Debug::NewDebugLevel ( const std::string &  name)
inlineinherited
void BIAS::Debug::PrintDebugLevel ( std::ostream &  os = std::cout) const
inlineinherited

Definition at line 383 of file Debug.hh.

ContourBSplineData * ContourBSplineData::Register ( const unsigned int  order,
const ContourBSplineType::Type  bType,
const std::vector< unsigned int > &  mPnts 
)
static

registers a ContourBSpline object and returns pointer to its data object

Parameters
[in]orderorder of B-Spline curve
[in]bTypetype of B-Spline curve (Open or Closed)
[in]mPntsvector of multiplicities (holds information in which control points edges are modelled

This function is transparently called by the Init(...) function of a ContourBSpline object.

Looks up if there is already a data object that fits to the calling ContourBSpline object. If yes, it returns the pointer to this ContourBSplineData object and inkrements the reference counter of the data object. If not, a new ContourBSplineData object gets created.

Generation includes class variables: order (copy) bType (copy) mPnts (copy) numBasePolynoms (equal to number of control points (length of mPnts)) dependent on type of BSplineCurve (handled by specific helper functions): splineMetricMatrix_ //see "Active Contours" chapter 3 splineMetricMatrixParametric_ areaCoefficientMatrix_ //confer to "Active Contours" chapter 3 //not used for further computation at moment

Definition at line 31 of file ContourBSplineData.cpp.

References bType_, ComputeAreaCoefficientMatrix_(), ComputeSplineMetricMatrix_(), ComputeSplineMetricMatrixParametric_(), mPnts_, numBasePolynoms_, numSpans_, numSpansVec_, BIAS::ContourBSplineType::Open, order_, reference_, RegisterAperiodicBSpline_(), and RegisterPeriodicBSpline_().

Referenced by BIAS::ContourDetectorBSpline< StorageType >::Cluster(), BIAS::ContourDetectorBSpline< StorageType >::Init(), and BIAS::ContourDetectorBSpline< StorageType >::Load().

ContourBSplineData * ContourBSplineData::Register ( const std::vector< ContourBSplineData * > &  bSplinesData)
static

registers a clustered ContourBSpline object and returns pointer to its data object

Parameters
[in]bSplinesDatavector of data objects from B-Spline curves which get clustered into one data object

This function is transparently called by the Cluster(...) function of class ContourBSpline.

Data object is build on basis of given B-Spline curves data objects.

There is no lookup if a data object already exist. When you cluster some B-Spline curves and want a copy of the clustered curve, use operator=.

no lookup here ... cause composition of periodic and aperiodic bsplines possible

type Cluster isnt meaningful at all ... clustered splines can be composition of periodic and aperiodic bsplines

Definition at line 72 of file ContourBSplineData.cpp.

References bType_, BIAS::ContourBSplineType::Cluster, ComputeAreaCoefficientMatrix_(), ComputeSplineMetricMatrix_(), ComputeSplineMetricMatrixParametric_(), mPnts_, numBasePolynoms_, numSpans_, numSpansVec_, order_, placedSpanMatrices_, reference_, and BIAS::Matrix< T >::SetZero().

ContourBSplineData * ContourBSplineData::Register ( const unsigned int  order,
const ContourBSplineType::Type  bType,
const std::vector< unsigned int > &  mPnts,
const unsigned int  numBasePolynoms,
const unsigned int  numSpans,
const std::vector< unsigned int > &  numSpansVec,
const std::vector< BIAS::Matrix< double > > &  placedSpanMatrices 
)
static

registers a clustered ContourBSpline object and returns pointer to its data object

Parameters
[in]orderorder of clustered B-Spline curve
[in]bTypeType of curve (Cluster)
[in]mPntsmultiplicity vector of curve (determines in which control points edges are modelled)
[in]numBasePolynomsnumber of basepolynomes of the curve (equal to number of control points)
[in]numSpansnumber of spans of curve
[in]numSpansVecvector seperates numSpans of seperate curves in cluster
[in]placedSpanMatricesvector of all placed span-matrices of curve (see "Active Contours" appendix A)

This funcion is called transparently by Load(...) function of class ContourBSpline.

There is no lookup if a data object already exist. When you cluster some B-Spline curves and want a copy of the clustered curve, use operator=.

Definition at line 146 of file ContourBSplineData.cpp.

References bType_, ComputeAreaCoefficientMatrix_(), ComputeSplineMetricMatrix_(), ComputeSplineMetricMatrixParametric_(), mPnts_, numBasePolynoms_, numSpans_, numSpansVec_, order_, placedSpanMatrices_, and reference_.

void ContourBSplineData::RegisterAperiodicBSpline_ ( )

inits class variables for an open B-Spline curve

computes: numSpans_ //number of spans of curve placedSpanMatrices //placed span matrices - see "Active Contours" //appendix A, p.292 splineMetricMatrix_ //see "Active Contours" chapter 3 splineMetricMatrixParametric_ areaCoefficientMatrix_ //confer to "Active Contours" chapter 3 //not used for further computation at moment

Definition at line 303 of file ContourBSplineData.cpp.

Referenced by Register().

void ContourBSplineData::RegisterPeriodicBSpline_ ( )

inits class variables for a closed B-Spline curve

computes: numSpans_ //number of spans of curve placedSpanMatrices //placed span matrices - see "Active Contours" //appendix A, p.292 splineMetricMatrix_ //see "Active Contours" chapter 3 splineMetricMatrixParametric_ areaCoefficientMatrix_ //confer to "Active Contours" chapter 3 //not used for further computation at moment

Definition at line 194 of file ContourBSplineData.cpp.

Referenced by Register().

void BIAS::Debug::RemoveDebugLevel ( const long int  lv)
inlineinherited

Definition at line 369 of file Debug.hh.

void BIAS::Debug::RemoveDebugLevel ( const std::string &  name)
inlineinherited

Definition at line 376 of file Debug.hh.

void BIAS::Debug::SetDebugLevel ( const long int  lv)
inlineinherited
void BIAS::Debug::SetDebugLevel ( const std::string &  name)
inlineinherited

Definition at line 325 of file Debug.hh.

void BIAS::Debug::SetDebugStream ( const std::ostream &  os)
inlineinherited

Definition at line 398 of file Debug.hh.

static void BIAS::Debug::SetGlobalDebugLevel ( long int  lev)
inlinestaticinherited

Definition at line 424 of file Debug.hh.

void BIAS::Debug::ShowDebugLevel ( std::ostream &  os = std::cout) const
inlineinherited

prints all internally known debuglevels

Author
woelk 09/2006

Definition at line 496 of file Debug.hh.

void BIAS::ContourBSplineData::Unregister ( )
inline

decrements reference counter to this data object and deletes it if there is no reference to it

This function is transparently called by the destructor of a ContourBSpline object.

Definition at line 334 of file ContourBSplineData.hh.

References pntr_, and reference_.

Referenced by ~ContourBSplineData().

Friends And Related Function Documentation

friend class ContourBSpline
friend

Definition at line 74 of file ContourBSplineData.hh.

friend class ContourBSplineShapeMatrix
friend

Definition at line 75 of file ContourBSplineData.hh.

Member Data Documentation

long int BIAS::Debug::_liDebugLevel
protectedinherited

Definition at line 510 of file Debug.hh.

Referenced by BIAS::Debug::operator=(), and BIAS::ImageBase::operator=().

long int BIAS::Debug::_liNextDebugLevel
protectedinherited

new concept, debuglevel are managed here in the debug class

Definition at line 516 of file Debug.hh.

Referenced by BIAS::Debug::operator=().

std::map<std::string, long int> BIAS::Debug::_String2Debuglevel
protectedinherited

Definition at line 517 of file Debug.hh.

Referenced by BIAS::Debug::operator=().

std::ostream BIAS::Debug::_zDebugStream
staticprotectedinherited

Definition at line 511 of file Debug.hh.

Referenced by BIAS::Debug::operator=().

BIAS::Matrix<double> BIAS::ContourBSplineData::areaCoefficientMatrix_

area coefficient matrix - confer to "Active Contours", chapter 3, p.65

(currently not farther used in fitting process)

Definition at line 331 of file ContourBSplineData.hh.

ContourBSplineType::Type BIAS::ContourBSplineData::bType_

type of B-Spline curve (Open,Closed,Cluster)

Definition at line 296 of file ContourBSplineData.hh.

Referenced by Register().

long int BIAS::Debug::GlobalDebugLevel = 0
staticprotectedinherited

Definition at line 513 of file Debug.hh.

std::vector<unsigned int> BIAS::ContourBSplineData::mPnts_

vector of multiplicities - determines in which control points edges are modelled

Definition at line 302 of file ContourBSplineData.hh.

Referenced by Register().

unsigned int BIAS::ContourBSplineData::numBasePolynoms_

number of base polynoms of curve - equal to number of control points

Definition at line 311 of file ContourBSplineData.hh.

Referenced by BIAS::ContourDetectorBSpline< StorageType >::Cluster(), and Register().

unsigned int BIAS::ContourBSplineData::numSpans_

number of spans of curve

Definition at line 314 of file ContourBSplineData.hh.

Referenced by Register().

std::vector<unsigned int> BIAS::ContourBSplineData::numSpansVec_

number of spans for sub B-Spline curves of the B-Spline curve length >1 when curve is clustered

Definition at line 308 of file ContourBSplineData.hh.

Referenced by Register().

unsigned int BIAS::ContourBSplineData::order_

order of B-Spline curve

Definition at line 293 of file ContourBSplineData.hh.

Referenced by Register().

std::vector<BIAS::Matrix<double> > BIAS::ContourBSplineData::placedSpanMatrices_

span matrices of curve (multiplied with placement matrices - p.292)

Definition at line 317 of file ContourBSplineData.hh.

Referenced by Register().

std::list< ContourBSplineData * > ContourBSplineData::pntr_
static

list of all pointers to ContourBSplineData objects

Definition at line 287 of file ContourBSplineData.hh.

Referenced by Unregister().

unsigned int BIAS::ContourBSplineData::reference_

reference counter - for handling unregister

Definition at line 290 of file ContourBSplineData.hh.

Referenced by Register(), and Unregister().

BIAS::Matrix<double> BIAS::ContourBSplineData::splineMetricMatrix_

metric matrix - confer to "Active Contours", chapter 3, p.50f

Definition at line 320 of file ContourBSplineData.hh.

BIAS::Matrix<double> BIAS::ContourBSplineData::splineMetricMatrixParametric_

metric matrix - confer to "Active Contours", chapter 3, p.59

Definition at line 323 of file ContourBSplineData.hh.

Referenced by BIAS::ContourBSplineShapeMatrix::ComputeRegularisationMatrix().


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