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 | Protected Member Functions | Protected Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
BIAS::ContourDetectorBSpline< StorageType > Class Template Reference

represents a special B-Spline and holds functions to handle fitting More...

#include <FeatureDetector/ContourDetectorBSpline.hh>

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

Public Member Functions

void CenterOverControlPoints ()
 centers the curve by computing center over control points (not accurate!) More...
 
void ComputeRegularisationMatrix ()
 computes the regularisation matrix needed for fitting algorithm. More...
 
 ContourDetectorBSpline ()
 standard constructor More...
 
 ContourDetectorBSpline (const ContourDetectorBSpline< StorageType > &toCopy)
 copy constructor More...
 
int Detect (Image< StorageType > &image, std::vector< BIAS::BIASContour > &contour)
 detect function, unfinished More...
 
void Displace (const double &x, const double &y)
 displace all control points More...
 
void DrawControlPoints (BIAS::Image< StorageType > &img, const StorageType color[3])
 draws the control points of the B-Spline curve into image More...
 
void DrawCurve (BIAS::Image< StorageType > &img, const StorageType color[3])
 draws B-Spline curve into image More...
 
void DrawCurve (BIAS::Image< float > &img)
 draws B-Spline curve into image More...
 
void DrawNormals (const unsigned int normalWidth, BIAS::Image< StorageType > &img, const StorageType color[3])
 draws B-Spline normals into image More...
 
void Fit (BIAS::Image< StorageType > &greyImg, const double &alpha, const unsigned int normalWidth)
 fits B-Spline curve to gradient features found in the image More...
 
void Fit (BIAS::Image< StorageType > &greyImg, const double &alpha, const unsigned int normalWidth, const double &minClip)
 fits B-Spline curve to gradient features found in the image More...
 
void Fit (const BIAS::Image< float > &featImg, const double &alpha, const unsigned int normalWidth)
 fits B-Spline curve to gradient features found in the image More...
 
void Fit (const BIAS::Image< float > &featImg, const double &alpha, const unsigned int normalWidth, const double &minClip)
 fits B-Spline curve to gradient features found in the image More...
 
void GetBoundingBox (int &minX, int &minY, int &maxX, int &maxY)
 returns the parameter of the bounding box of the curve More...
 
ContourBSplineType::Type GetBType ()
 returns type of B-Spline curve - possible values are Open, Closed or Cluster. More...
 
void GetControlPoints (BIAS::Vector< double > &Q)
 returns a vector of control points; first entries are x-coordinates; last entries are y-coordinates More...
 
void GetControlPoints (std::vector< BIAS::Vector2< double > > &cPnts)
 returns a vector of control points in x,y-coordinates More...
 
void GetFeature (BIAS::Image< StorageType > &greyImg, const double &t, const unsigned int normalWidth, BIAS::Vector2< double > &res)
 returns the feature point with highest gradient along the normal in curve point located at "t" More...
 
void GetFeature (BIAS::Image< StorageType > &greyImg, const double &t, const unsigned int normalWidth, const double &minClip, BIAS::Vector2< double > &res)
 returns the feature point with highest gradient along the normal in curve point located at "t" More...
 
void GetFeature (const BIAS::Image< float > &featImg, const double &t, const unsigned int normalWidth, BIAS::Vector2< double > &res)
 returns the feature point with highest gradient along the normal in curve point located at "t" More...
 
void GetFeature (const BIAS::Image< float > &featImg, const double &t, const unsigned int normalWidth, const double &minClip, BIAS::Vector2< double > &res)
 returns the feature point with highest gradient along the normal in curve point located at "t" More...
 
void GetFeature (BIAS::Image< StorageType > &greyImg, const unsigned int normalWidth, const BIAS::Vector2< double > &curvePnt, const BIAS::Vector2< double > &normal, BIAS::Vector2< double > &res)
 returns the feature point with highest gradient along the normal in curve point "curvePnt" More...
 
void GetFeature (BIAS::Image< StorageType > &greyImg, const unsigned int normalWidth, const BIAS::Vector2< double > &curvePnt, const BIAS::Vector2< double > &normal, const double &minClip, BIAS::Vector2< double > &res)
 returns the feature point with highest gradient along the normal in curve point "curvePnt" More...
 
void GetFeature (const BIAS::Image< float > &featImg, const unsigned int normalWidth, const BIAS::Vector2< double > &curvePnt, const BIAS::Vector2< double > &normal, BIAS::Vector2< double > &res)
 returns the feature point with highest gradient along the normal in curve point "curvePnt" More...
 
void GetFeature (const BIAS::Image< float > &featImg, const unsigned int normalWidth, const BIAS::Vector2< double > &curvePnt, const BIAS::Vector2< double > &normal, const double &minClip, BIAS::Vector2< double > &res)
 returns the feature point with highest gradient along the normal in curve point "curvePnt" More...
 
std::vector< unsigned int > GetMultiplePoints ()
 returns vector of multiple points; indicates which control points are modelled as edges More...
 
void GetNormal (const double &t, BIAS::Vector2< double > &res)
 returns normal in curve point More...
 
unsigned int GetOrder ()
 returns order of B-Spline curve More...
 
void GetPoint (const double &t, BIAS::Vector2< double > &res)
 returns point on the curve More...
 
void Init (const unsigned int order, const ContourBSplineType::Type bType, const std::vector< BIAS::Vector2< double > > &cPnts)
 initialisation function for simple curve without edges More...
 
void Init (const unsigned int order, const ContourBSplineType::Type bType, const std::vector< unsigned int > &mPnts, const std::vector< BIAS::Vector2< double > > &cPnts)
 initialisation function for curve with edges More...
 
void Init (const unsigned int order, const ContourBSplineType::Type bType, const BIAS::Vector< double > &Q)
 initialisation function for simple curve without edges More...
 
void Init (const unsigned int order, const ContourBSplineType::Type bType, const std::vector< unsigned int > &mPnts, const BIAS::Vector< double > &Q)
 initialisation function for curve with edges More...
 
bool Load (const std::string &filename)
 load/initialise a ContourBSpline object from an given binary file More...
 
ContourDetectorBSplineoperator= (const ContourDetectorBSpline< StorageType > &toCopy)
 copy operator More...
 
void Rotate (const double &angle)
 rotates curve by angle (rad) More...
 
bool Save (const std::string &filename)
 saves all values which are needed to reinitialise the object to a binary file More...
 
void Scale (const double &scale)
 scales curve isotropic More...
 
void ScaleX (const double &scale)
 scales curve in x-direction (horizontally) More...
 
void ScaleY (const double &scale)
 scales curve in y-direction (vertically) More...
 
void SetControlPoints (const std::vector< BIAS::Vector2< double > > &controlPoints)
 sets new control points More...
 
void SetControlPoints (const BIAS::Vector< double > &Q)
 sets new control points More...
 
void SetDrawSamples (unsigned int samples)
 sets the amount of sample points used to draw the B-Spline curve. More...
 
void SetDrawSampleWidth (double width)
 sets the amount of sample points used to draw the B-Spline curve. More...
 
void SetFitSamples (unsigned int samples)
 sets the amount of samples used to search features along the curve in fitting algorithm. More...
 
void SetFitSampleWidth (double width)
 sets the amount of samples used to search features along the curve in fitting algorithm. More...
 
void SetShapeSpaceEuclidian ()
 sets spape-space for regularised fitting to euclidian similarities More...
 
void SetShapeSpaceIdentity ()
 sets spape-space for regularised fitting to identity More...
 
void SetShapeSpaceMatrix (BIAS::Matrix< double > &shapeSpace)
 sets spape-space for regularised fitting More...
 
void SetShapeSpacePlanarAffin ()
 sets spape-space for regularised fitting to planar affine transformations More...
 
void SetSubShapeSpaceEuclidian ()
 set invariant shape-space for regularised fitting to euclidian similarities More...
 
void SetSubShapeSpaceIdentity ()
 set invariant shape-space for regularised fitting to identity More...
 
void SetSubShapeSpaceMatrix (BIAS::Matrix< double > &subShapeSpace)
 set invariant shape-space for regularised fitting More...
 
void SetSubShapeSpacePlanarAffin ()
 set invariant shape-space for regularised fitting to planar affine transformation More...
 
void SetSubShapeSpaceZero ()
 set invariant shape-space for regularised fitting to zero More...
 
virtual ~ContourDetectorBSpline ()
 destructor More...
 

Static Public Member Functions

static ContourDetectorBSpline Cluster (const std::vector< ContourDetectorBSpline< StorageType > > &bSplines)
 builds a new ContourBspline object from given vector of ContourBSpline objects More...
 

Protected Member Functions

void CPntsToQ_ (const std::vector< BIAS::Vector2< double > > &cPnts)
 converts a given control point vector in x,y-coordinates to the internal used flat control point vector Q whose first entries are x-coordinates and last entries are y-coordinates More...
 
void CPntsToQ_ (const std::vector< BIAS::Vector2< double > > &cPnts, BIAS::Vector< double > &Q)
 converts a given control point vector in x,y-coordinates to the internal used flat control point vector Q whose first entries are x-coordinates and last entries are y-coordinates More...
 
void Fit_ (const BIAS::Image< float > &featImg, const double &alpha, const unsigned int normalWidth)
 fits the curve to a features curve with regularized fitting More...
 
void Fit_ (const BIAS::Image< float > &featImg, const double &alpha, const unsigned int normalWidth, const double &minClip)
 fits the curve to a features curve with regularized fitting More...
 
void GetFeatImage_ (BIAS::Image< StorageType > &greyImg, BIAS::Image< float > &featImg, const unsigned int normalWidth)
 converts given grey image to gradient image with ROI More...
 
void GetNormal_ (const unsigned int numSpan, const double &s, BIAS::Vector2< double > &res)
 computes a normal at curve point which is parametrized by "numSpan" and "s" More...
 
void GetPoint_ (const unsigned int numSpan, const double &s, BIAS::Vector2< double > &res)
 computes a point on curve More...
 
void GetPointAndParamVec_ (const unsigned int numSpan, const double &s, BIAS::Vector< double > &resParamVec, BIAS::Vector2< double > &res)
 computes a point on curve and a parameter vector (byproduct) which can be used for computing a special matrix (U) in the fitting algorithm More...
 
void InitCurve_ ()
 initializes curve for drawing or for getting points on it More...
 
void QToCPnts_ (std::vector< BIAS::Vector2< double > > &cPnts)
 converts a flat control point vector Q whose first entries are x-coordinates and last entries are y-coordinates to a control point vector with x,y-coordinates More...
 
void QToCPnts_ (const BIAS::Vector< double > &Q, std::vector< BIAS::Vector2< double > > &cPnts)
 converts a flat control point vector Q whose first entries are x-coordinates and last entries are y-coordinates to a control point vector with x,y-coordinates More...
 
void TestInit_ (const unsigned int order, const ContourBSplineType::Type bType, const std::vector< unsigned int > &mPnts, const BIAS::Vector< double > &Q)
 tests if B-Spline curve with given parameter can get initialized. More...
 

Protected Attributes

bool curveInitialised_
 bool to indicate a change of control points More...
 
std::vector< std::vector
< BIAS::Vector< double > > > 
curveVectors_
 vectors needed to draw curve (determined by InitCurve_) More...
 
unsigned int drawSamples_
 amount of samples used in drawing algorithm More...
 
double * drawSampleWidth_
 distance of sample points in basis used in drawing algorithm More...
 
unsigned int fitSamples_
 amount of samples used in fitting algorithm More...
 
double * fitSampleWidth_
 distance of sample points in basis used in fitting algorithm More...
 
ContourBSplineDatapData_
 pointer to data of B-Spline curve initialised by call of Init(...) More...
 
ContourBSplineShapeMatrixpRegMatrix_
 pointer to regularisation matrix object More...
 
ContourBSplineShapeMatrixpShapeSpaceMatrix_
 pointer to shape-space matrix object More...
 
ContourBSplineShapeMatrixpSubShapeSpaceMatrix_
 pointer to invariant shape-space matrix object More...
 
BIAS::Vector< double > Q_
 vector of control points; first entries are x-coordinates; last entries are y-coordinates More...
 

Private Member Functions

void AddDebugLevel (const long int lv)
 
void AddDebugLevel (const std::string &name)
 
long ConsumeNextFreeDebuglevel_ ()
 returns the next available debuglevel 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
 
int GetMaxNumContours ()
 return maximum number of contours More...
 
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 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 SetMaxNumContours (const int maxnum)
 
void ShowDebugLevel (std::ostream &os=std::cout) const
 prints all internally known debuglevels More...
 

Static Private Member Functions

static long int GetGlobalDebugLevel ()
 
static void SetGlobalDebugLevel (long int lev)
 

Private 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
 
std::vector< BIAS::BIASContourdetectedContours_
 
int dMaxNumContours_
 maximum number of corners to return More...
 

Static Private Attributes

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

Detailed Description

template<class StorageType>
class BIAS::ContourDetectorBSpline< StorageType >

represents a special B-Spline and holds functions to handle fitting

This class represents a special B-Spline curve for "Active Contours". Based on book: "Active Contours" by Andrew Blake and Michael Isard. (http://www.robots.ox.ac.uk/~contours/)

Class offers functions to manipulate Position, Orientation and Scale of Curve, Drawing and Fitting Curve to gradient features in images.

USAGE construction: ContourBSpline bspline; //call constructor bspline.Init(...); //initialise B-Spline

The call of the Init(...) function looksup if the basis of the B-Spline is already computed. If not, a new ContourBSplineData Objects becomes generated, which holds data of this Object. If a B-Spline with same basis is available the pointer to the available ContourBSplineData gets copied. The purpose is to save/share memory. This is hidden to users of this class. After the Init(..) call, you can draw and manipulate the B-Spline.

For fitting you have to set (nonrecurring) Shape-Space, invariant Shape-Space (SubShapeSpace) and compute the Regularisation-Matrix. Look at "Active Contours" chapter 6 for details. In common cases you want to set Shape-Space to identity (SetShapeSpaceIdentity()) and invariant Shape-Space to planar affin transformations (SetSubShapeSpacePlanarAffin()).

USAGE fitting: bspline.SetShapeSpace...(...); bspline.SetSubShapeSpace...(...); bspline.ComputeRegularisationMatrix(); bspline.Fit(...);

The functions Set*ShapeSpace...(...) and ComputeRegulatisationMatrix() register/generate a ContourBSplineShapeMatrix object. The purpose is to save/share memory. This should be transparent to users of this class.

Author
Marcel Lilienthal, 2005
Examples:
ExampleContourDetectorBSpline.cpp.

Definition at line 103 of file ContourDetectorBSpline.hh.

Constructor & Destructor Documentation

template<class StorageType >
ContourDetectorBSpline::ContourDetectorBSpline ( )

standard constructor

Sets pointers to NULL and initialises some default values for Drawing and Fitting.

Definition at line 42 of file ContourDetectorBSpline.cpp.

template<class StorageType>
BIAS::ContourDetectorBSpline< StorageType >::ContourDetectorBSpline ( const ContourDetectorBSpline< StorageType > &  toCopy)
inline

copy constructor

Parameters
[in]toCopyobject to copy

Uses operator= to copy referred B-Spline as new Object.

Definition at line 123 of file ContourDetectorBSpline.hh.

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

destructor

Unregisters ContourBSplineData object (with reference counting). Unregisters ContourBSplineShapeMatrix objects (with reference counting).

Definition at line 55 of file ContourDetectorBSpline.cpp.

Member Function Documentation

template<class StorageType >
void BIAS::ContourDetectorBSpline< StorageType >::CenterOverControlPoints ( )
inline

centers the curve by computing center over control points (not accurate!)

Definition at line 1249 of file ContourDetectorBSpline.hh.

template<class StorageType >
ContourDetectorBSpline< StorageType > ContourDetectorBSpline::Cluster ( const std::vector< ContourDetectorBSpline< StorageType > > &  bSplines)
static

builds a new ContourBspline object from given vector of ContourBSpline objects

Parameters
[in]bSplinesvector of ContourBSpline objects to cluster

With this function you can cluster B-Spline curves in one B-Spline curve. For example you can represent the contour of glasses with one B-Spline curve constructed of two closed B-Spline curves.

Definition at line 76 of file ContourDetectorBSpline.cpp.

References BIAS::ContourBSplineData::numBasePolynoms_, BIAS::ContourDetectorBSpline< StorageType >::pData_, BIAS::ContourDetectorBSpline< StorageType >::Q_, and BIAS::ContourBSplineData::Register().

template<class StorageType >
void BIAS::ContourDetectorBSpline< StorageType >::ComputeRegularisationMatrix ( )
inline

computes the regularisation matrix needed for fitting algorithm.

The regularisation matrix for the fitting algorithm gets computed. You have to set shape-space and invariant shape-space before! Different to the book "Active Contours" the regularisation factor alpha isnt included in the resulting matrix.

Usage: bspline.SetShapeSpace...(...); bspline.SetSubShapeSpace...(...); bspline.ComputeRegularisationMatrix();

Definition at line 1356 of file ContourDetectorBSpline.hh.

References BIAS::ContourBSplineShapeMatrix::ComputeRegularisationMatrix().

template<class StorageType >
void ContourDetectorBSpline::CPntsToQ_ ( const std::vector< BIAS::Vector2< double > > &  cPnts)
protected

converts a given control point vector in x,y-coordinates to the internal used flat control point vector Q whose first entries are x-coordinates and last entries are y-coordinates

Parameters
[in]cPntsvector of control points in x,y-coordinates

Definition at line 754 of file ContourDetectorBSpline.cpp.

template<class StorageType >
void ContourDetectorBSpline::CPntsToQ_ ( const std::vector< BIAS::Vector2< double > > &  cPnts,
BIAS::Vector< double > &  Q 
)
protected

converts a given control point vector in x,y-coordinates to the internal used flat control point vector Q whose first entries are x-coordinates and last entries are y-coordinates

Parameters
[in]cPntsvector of control points in x,y-coordinates
[out]Qvector of control points; first entries are x-coordinates; last entries are y-coordinates

Definition at line 767 of file ContourDetectorBSpline.cpp.

References TNT::Vector< T >::newsize().

template<class StorageType >
int ContourDetectorBSpline::Detect ( Image< StorageType > &  image,
std::vector< BIAS::BIASContour > &  contour 
)
virtual

detect function, unfinished

Implements BIAS::ContourDetectorBase< StorageType >.

Definition at line 65 of file ContourDetectorBSpline.cpp.

template<class StorageType >
void BIAS::ContourDetectorBSpline< StorageType >::Displace ( const double &  x,
const double &  y 
)
inline

displace all control points

Parameters
[in]xx-offset to x-coordinates of control points
[in]yy-offset to y-coordinates of control points

Definition at line 1208 of file ContourDetectorBSpline.hh.

template<class StorageType >
void ContourDetectorBSpline::DrawControlPoints ( BIAS::Image< StorageType > &  img,
const StorageType  color[3] 
)

draws the control points of the B-Spline curve into image

Parameters
[out]imgoutput image
[in]color

Definition at line 618 of file ContourDetectorBSpline.cpp.

References BIAS::ImageDraw< StorageType >::CircleCenterFilled().

template<class StorageType >
void ContourDetectorBSpline::DrawCurve ( BIAS::Image< StorageType > &  img,
const StorageType  color[3] 
)

draws B-Spline curve into image

Parameters
[out]imgoutput image
[in]colorDraws B-Spline curve into given image. Uses amount of samples given by SetDrawSampleWidth(...) of SetDrawSamples(...). If amount of samples isnt given by these function a default amount is used.

Definition at line 634 of file ContourDetectorBSpline.cpp.

References BIAS::ImageDraw< StorageType >::Line().

template<class StorageType >
void ContourDetectorBSpline::DrawCurve ( BIAS::Image< float > &  img)

draws B-Spline curve into image

Parameters
[out]imgoutput image

Draws B-Spline curve into given image. Uses amount of samples given by SetDrawSampleWidth(...) or SetDrawSamples(...). If amount of samples isnt given by these function a default amount is used.

Definition at line 669 of file ContourDetectorBSpline.cpp.

References BIAS::ImageDraw< StorageType >::Line().

template<class StorageType >
void ContourDetectorBSpline::DrawNormals ( const unsigned int  normalWidth,
BIAS::Image< StorageType > &  img,
const StorageType  color[3] 
)

draws B-Spline normals into image

Parameters
[out]imgoutput image

Draws normals along the B-Spline curve into given image. Uses amount of samples given by SetFitSampleWidth(...) or SetFitSamples(...). If amount of samples isnt given a default amount is used.

Definition at line 704 of file ContourDetectorBSpline.cpp.

References BIAS::ImageDraw< StorageType >::Line().

template<class StorageType >
void ContourDetectorBSpline::Fit ( BIAS::Image< StorageType > &  greyImg,
const double &  alpha,
const unsigned int  normalWidth 
)

fits B-Spline curve to gradient features found in the image

Parameters
[in]greyImginput image
[in]alpharegularisation factor for fitting
[in]normalWidthwidth of normal for searching gradient features

The input image gets converted to a single gradient image. A ROI gets computed from controlpoints and the width to search for features (normalWidth).

Along the curve normals get computed. Number of normals depends on variable fitSampleWidth_ (SetFitSampleWidth(...)). Along the normals the feature points get assigned by the image points width highest gradient and distance less then normalWidth from curve (in both directions). Thus a feature curve is given.

The fitting algorithm is described in the book "Active Contours", chapter 6. The parameter alpha determines the regularisation of the fitting. For numeric stability alpha has to be greater than 0 even if no regularisation is forced. the regularisation determines how the curve should be fitted to the feature curve. high values of alpha cause the fitted curve to keep the ground shape and only adapt position, orientation and scale. small values causes a possibly distorted shape which could have nothing in common with the initial curve.

Definition at line 210 of file ContourDetectorBSpline.cpp.

template<class StorageType >
void ContourDetectorBSpline::Fit ( BIAS::Image< StorageType > &  greyImg,
const double &  alpha,
const unsigned int  normalWidth,
const double &  minClip 
)

fits B-Spline curve to gradient features found in the image

Parameters
[in]greyImginput image
[in]alpharegularisation factor for fitting
[in]normalWidthwidth of normal for searching gradient features
[in]minClipvalue of image gradients which are discarded in the search after feature points

The input image gets converted to a single gradient image. A ROI gets computed from controlpoints and the width to search for features (normalWidth).

Along the curve normals get computed. Number of normals depends on variable fitSampleWidth_ (SetFitSampleWidth(...)). Along the normals the feature points get assigned by the image points width highest gradient and distance less then normalWidth from curve (in both directions). Image gradients with a value less than parameter minClip are discarded. Thus a feature curve is given.

The fitting algorithm is described in the book "Active Contours", chapter 6. The parameter alpha determines the regularisation of the fitting. For numeric stability alpha has to be greater than 0 even if no regularisation is forced. the regularisation determines how the curve should be fitted to the feature curve. high values of alpha cause the fitted curve to keep the ground shape and only adapt position, orientation and scale. small values causes a possibly distorted shape which could have nothing in common with the initial curve.

Definition at line 225 of file ContourDetectorBSpline.cpp.

template<class StorageType >
void ContourDetectorBSpline::Fit ( const BIAS::Image< float > &  featImg,
const double &  alpha,
const unsigned int  normalWidth 
)

fits B-Spline curve to gradient features found in the image

Parameters
[in]featImginput gradient image
[in]alpharegularisation factor for fitting
[in]normalWidthwidth of normal for searching gradient features

Along the curve normals get computed. Number of normals depends on variable fitSampleWidth_ (SetFitSampleWidth(...)). Along the normals the feature points get assigned by the image points width highest gradient and distance less then normalWidth from curve (in both directions). Thus a feature curve is given.

The fitting algorithm is described in the book "Active Contours", chapter 6. The parameter alpha determines the regularisation of the fitting. For numeric stability alpha has to be greater than 0 even if no regularisation is forced. the regularisation determines how the curve should be fitted to the feature curve. high values of alpha cause the fitted curve to keep the ground shape and only adapt position, orientation and scale. small values causes a possibly distorted shape which could have nothing in common with the initial curve.

Definition at line 241 of file ContourDetectorBSpline.cpp.

template<class StorageType >
void ContourDetectorBSpline::Fit ( const BIAS::Image< float > &  featImg,
const double &  alpha,
const unsigned int  normalWidth,
const double &  minClip 
)

fits B-Spline curve to gradient features found in the image

Parameters
[in]featImginput gradient image
[in]alpharegularisation factor for fitting
[in]normalWidthwidth of normal for searching gradient features
[in]minClipvalue of image gradients which are discarded in the search after feature points

Along the curve normals get computed. Number of normals depends on variable fitSampleWidth_ (SetFitSampleWidth(...)). Along the normals the feature points get assigned by the image points width highest gradient and distance less then normalWidth from curve (in both directions). Image gradients with a value less than parameter minClip are discarded. Thus a feature curve is given.

The fitting algorithm is described in the book "Active Contours", chapter 6. The parameter alpha determines the regularisation of the fitting. For numeric stability alpha has to be greater than 0 even if no regularisation is forced. the regularisation determines how the curve should be fitted to the feature curve. high values of alpha cause the fitted curve to keep the ground shape and only adapt position, orientation and scale. small values causes a possibly distorted shape which could have nothing in common with the initial curve.

Definition at line 251 of file ContourDetectorBSpline.cpp.

template<class StorageType >
void ContourDetectorBSpline::Fit_ ( const BIAS::Image< float > &  featImg,
const double &  alpha,
const unsigned int  normalWidth 
)
protected

fits the curve to a features curve with regularized fitting

Parameters
[in]featImageinput gradient image
[in]alpharegularisation factor
[in]normalWidthlength of normal used to search for feature curve

Internal used function to fit the B-Spline curve to a feature curve. The feature curve is determined by searching for image points with highest gradients along the normals at the curve. Parameter "normalWidth" determines the maximal distance of feature point to curve (in both directions).

More details in function Fit(..) and book "Active Contours" chapter 6.

Definition at line 977 of file ContourDetectorBSpline.cpp.

References BIAS::SVD::Invert(), BIAS::Matrix< T >::Mult(), BIAS::Matrix< T >::Multiply(), BIAS::Matrix< T >::MultLeft(), BIAS::Vector< T >::OuterProduct(), BIAS::Vector< T >::SetZero(), and BIAS::Matrix< T >::SetZero().

template<class StorageType >
void ContourDetectorBSpline::Fit_ ( const BIAS::Image< float > &  featImg,
const double &  alpha,
const unsigned int  normalWidth,
const double &  minClip 
)
protected

fits the curve to a features curve with regularized fitting

Parameters
[in]featImageinput gradient image
[in]alpharegularisation factor
[in]normalWidthlength of normal used to search for feature curve
[in]minClipgradients less than "minClip" are discarded in search for feature points

Internal used function to fit the B-Spline curve to a feature curve. The feature curve is determined by searching for image points with highest gradients along the normals at the curve. Parameter "normalWidth" determines the maximal distance of feature point to curve (in both directions).

More details in function Fit(..) and book "Active Contours" chapter 6.

Definition at line 1074 of file ContourDetectorBSpline.cpp.

References BIAS::SVD::Invert(), BIAS::Matrix< T >::Mult(), BIAS::Matrix< T >::Multiply(), BIAS::Matrix< T >::MultLeft(), BIAS::Vector< T >::OuterProduct(), BIAS::Vector< T >::SetZero(), and BIAS::Matrix< T >::SetZero().

template<class StorageType >
void ContourDetectorBSpline::GetBoundingBox ( int &  minX,
int &  minY,
int &  maxX,
int &  maxY 
)

returns the parameter of the bounding box of the curve

Parameters
[out]minXx-coordinate of top left corner of bounding box
[out]minYy-coordinate of top left corner of bounding box
[out]maxXx-coordinate of bottom right corner of bounding box
[out]maxXy-coordinate of bottom right corner of bounding box

Definition at line 583 of file ContourDetectorBSpline.cpp.

template<class StorageType >
ContourBSplineType::Type BIAS::ContourDetectorBSpline< StorageType >::GetBType ( )
inline

returns type of B-Spline curve - possible values are Open, Closed or Cluster.

Definition at line 1418 of file ContourDetectorBSpline.hh.

template<class StorageType>
void BIAS::ContourDetectorBSpline< StorageType >::GetControlPoints ( BIAS::Vector< double > &  Q)
inline

returns a vector of control points; first entries are x-coordinates; last entries are y-coordinates

Parameters
[out]Qvector of control points

Definition at line 630 of file ContourDetectorBSpline.hh.

template<class StorageType>
void BIAS::ContourDetectorBSpline< StorageType >::GetControlPoints ( std::vector< BIAS::Vector2< double > > &  cPnts)
inline

returns a vector of control points in x,y-coordinates

Parameters
[out]cPntsvector of control points in x,y-coordinates

Definition at line 636 of file ContourDetectorBSpline.hh.

template<class StorageType >
void ContourDetectorBSpline::GetFeatImage_ ( BIAS::Image< StorageType > &  greyImg,
BIAS::Image< float > &  featImg,
const unsigned int  normalWidth 
)
protected

converts given grey image to gradient image with ROI

Parameters
[in]greyImginput grey image
[out]featImgoutput gradient image
[in]normalWidthused to determine ROI

Converts a given grey image to a gradient image. gradient image is needed for the fitting algorithm. In the fitting algorithm only a small region of the image is of interest for searching feature points. Thus a ROI gets computed from a bounding box of the curve and the parameter "normalWidth". Parameter "normalWidth" determines how far along curve normal a feature point gets searched.

Definition at line 1174 of file ContourDetectorBSpline.cpp.

References BIAS::Image< StorageType >::FillImageWithConstValue(), BIAS::GradientSobel3x3< InputStorageType, OutputStorageType >::Filter(), BIAS::ImageBase::GetChannelCount(), BIAS::ImageBase::GetHeight(), BIAS::ImageBase::GetWidth(), BIAS::Image< StorageType >::Init(), BIAS::ImageBase::SetROICorners(), and BIAS::ImageBase::UnsetROI().

template<class StorageType >
void ContourDetectorBSpline::GetFeature ( BIAS::Image< StorageType > &  greyImg,
const double &  t,
const unsigned int  normalWidth,
BIAS::Vector2< double > &  res 
)

returns the feature point with highest gradient along the normal in curve point located at "t"

Parameters
[in]greyImginput grey image
[in]tsample point in [0,1]
[in]normalWidthlength of normal for searching gradient feature along normal in curve point at "t"
[out]resresulting feature point

The input image gets converted to a single gradient image. A ROI gets computed from controlpoints and the width to search for feature (normalWidth).

Parameter "t" is used to sample the basis of the curve and computing the curve point at "t". the normal at this curve point gets computed. Along this normal (in both directions) the image point width the highest gradient gets determined. The resulting features point has distance less equal than "normalWidth" to curve point.

Definition at line 476 of file ContourDetectorBSpline.cpp.

template<class StorageType >
void ContourDetectorBSpline::GetFeature ( BIAS::Image< StorageType > &  greyImg,
const double &  t,
const unsigned int  normalWidth,
const double &  minClip,
BIAS::Vector2< double > &  res 
)

returns the feature point with highest gradient along the normal in curve point located at "t"

Parameters
[in]greyImginput grey image
[in]tsample point in [0,1]
[in]normalWidthlength of normal for searching gradient feature along normal in curve point at "t"
[in]minClipvalue of image gradients which are discarded in the search after the feature point
[out]resresulting feature point

The input image gets converted to a single gradient image. A ROI gets computed from controlpoints and the width to search for feature (normalWidth).

Parameter "t" is used to sample the basis of the curve and computing the curve point at "t". the normal at this curve point gets computed. Along this normal (in both directions) the image point width the highest gradient gets determined. image gradients less than "minClip" get discarded. The resulting features point has distance less equal then "normalWidth" to curve point.

Definition at line 491 of file ContourDetectorBSpline.cpp.

template<class StorageType >
void ContourDetectorBSpline::GetFeature ( const BIAS::Image< float > &  featImg,
const double &  t,
const unsigned int  normalWidth,
BIAS::Vector2< double > &  res 
)

returns the feature point with highest gradient along the normal in curve point located at "t"

Parameters
[in]featImginput gradient image
[in]tsample point in [0,1]
[in]normalWidthlength of normal for searching gradient feature along normal in curve point at "t"
[out]resresulting feature point

Parameter "t" is used to sample the basis of the curve and computing the curve point at "t". the normal at this curve point gets computed. Along this normal (in both directions) the image point width the highest gradient gets determined. The resulting feature point has distance less equal than "normalWidth" to curve point.

Definition at line 507 of file ContourDetectorBSpline.cpp.

template<class StorageType >
void ContourDetectorBSpline::GetFeature ( const BIAS::Image< float > &  featImg,
const double &  t,
const unsigned int  normalWidth,
const double &  minClip,
BIAS::Vector2< double > &  res 
)

returns the feature point with highest gradient along the normal in curve point located at "t"

Parameters
[in]featImginput gradient image
[in]tsample point in [0,1]
[in]normalWidthlength of normal for searching gradient feature along normal at curve point at "t"
[in]minClipvalue of image gradients which are discarded in the search after the feature point
[out]resresulting feature point

Parameter "t" is used to sample the basis of the curve and computing the curve point at "t". the normal at this curve point gets computed. Along this normal (in both directions) the image point width the highest gradient gets determined. image gradients less than "minClip" get discarded. The resulting feature point has distance less equal than "normalWidth" to curve point.

Definition at line 545 of file ContourDetectorBSpline.cpp.

template<class StorageType >
void BIAS::ContourDetectorBSpline< StorageType >::GetFeature ( BIAS::Image< StorageType > &  greyImg,
const unsigned int  normalWidth,
const BIAS::Vector2< double > &  curvePnt,
const BIAS::Vector2< double > &  normal,
BIAS::Vector2< double > &  res 
)
inline

returns the feature point with highest gradient along the normal in curve point "curvePnt"

Parameters
[in]greyImginput grey image
[in]normalWidthlength of normal for searching gradient feature along normal at curve point "curvePnt"
[in]curvePntpoint on the curve which is start point for the search for feature point
[in]normalnormal at curve point "curvePnt"
[out]resresulting feature point

The input image gets converted to a single gradient image. A ROI gets computed from controlpoints and the width to search for feature (normalWidth).

Along the normal (in both directions) at curve point "curvePnt" the image point width the highest gradient gets determined. The resulting feature point has distance less equal than "normalWidth" to the curve point.

Definition at line 1431 of file ContourDetectorBSpline.hh.

template<class StorageType >
void BIAS::ContourDetectorBSpline< StorageType >::GetFeature ( BIAS::Image< StorageType > &  greyImg,
const unsigned int  normalWidth,
const BIAS::Vector2< double > &  curvePnt,
const BIAS::Vector2< double > &  normal,
const double &  minClip,
BIAS::Vector2< double > &  res 
)
inline

returns the feature point with highest gradient along the normal in curve point "curvePnt"

Parameters
[in]greyImginput grey image
[in]normalWidthlength of normal for searching gradient feature along normal at curve point "curvePnt"
[in]curvePntpoint on the curve which is start point for the search for feature point
[in]normalnormal at curve point "curvePnt"
[in]minClipvalue of image gradients which are discarded in the search for the feature point
[out]resresulting feature point

The input image gets converted to a single gradient image. A ROI gets computed from controlpoints and the width to search for feature (normalWidth).

Along the normal (in both directions) at curve point "curvePnt" the image point width the highest gradient gets determined. Image gradients less than "minClip"get discarded.The resulting feature point has distance less equal than "normalWidth" to the curve point.

Definition at line 1443 of file ContourDetectorBSpline.hh.

template<class StorageType >
void ContourDetectorBSpline::GetFeature ( const BIAS::Image< float > &  featImg,
const unsigned int  normalWidth,
const BIAS::Vector2< double > &  curvePnt,
const BIAS::Vector2< double > &  normal,
BIAS::Vector2< double > &  res 
)

returns the feature point with highest gradient along the normal in curve point "curvePnt"

Parameters
[in]featImginput gradient image
[in]normalWidthlength of normal for searching gradient feature along normal at curve point "curvePnt"
[in]curvePntpoint on the curve which is start point for the search for feature point
[in]normalnormal at curve point "curvePnt"
[out]resresulting feature point

Along the normal (in both directions) at curve point "curvePnt" the image point width the highest gradient gets determined. The resulting feature point has distance less equal than "normalWidth" to the curve point.

Definition at line 869 of file ContourDetectorBSpline.cpp.

References BIAS::ImageBase::GetHeight(), BIAS::ImageBase::GetWidth(), and BIAS::Image< StorageType >::PixelValue().

template<class StorageType >
void ContourDetectorBSpline::GetFeature ( const BIAS::Image< float > &  featImg,
const unsigned int  normalWidth,
const BIAS::Vector2< double > &  curvePnt,
const BIAS::Vector2< double > &  normal,
const double &  minClip,
BIAS::Vector2< double > &  res 
)

returns the feature point with highest gradient along the normal in curve point "curvePnt"

Parameters
[in]greyImginput gradient image
[in]normalWidthlength of normal for searching gradient feature along normal at curve point "curvePnt"
[in]curvePntpoint on the curve which is start point for the search for feature point
[in]normalnormal at curve point "curvePnt"
[in]minClipvalue of image gradients which are discarded in the search for the feature point
[out]resresulting feature point

Along the normal (in both directions) at curve point "curvePnt" the image point width the highest gradient gets determined. Image gradients less than "minClip"get discarded.The resulting feature point has distance less equal than "normalWidth" to the curve point.

Definition at line 922 of file ContourDetectorBSpline.cpp.

References BIAS::ImageBase::GetHeight(), BIAS::ImageBase::GetWidth(), and BIAS::Image< StorageType >::PixelValue().

template<class StorageType >
std::vector< unsigned int > BIAS::ContourDetectorBSpline< StorageType >::GetMultiplePoints ( )
inline

returns vector of multiple points; indicates which control points are modelled as edges

Definition at line 1424 of file ContourDetectorBSpline.hh.

template<class StorageType >
void ContourDetectorBSpline::GetNormal ( const double &  t,
BIAS::Vector2< double > &  res 
)

returns normal in curve point

Parameters
[in]tsample point in [0,1]
[out]resresulting normal

Parameter "t" is used to sample the basis of curve and compute the normal in curve point at "t".

Definition at line 448 of file ContourDetectorBSpline.cpp.

template<class StorageType >
void ContourDetectorBSpline::GetNormal_ ( const unsigned int  numSpan,
const double &  s,
BIAS::Vector2< double > &  res 
)
protected

computes a normal at curve point which is parametrized by "numSpan" and "s"

Parameters
[in]numSpanspan of curve in which normal is located
[in]ssample point of span in [0,1]
[out]resresulting normal

This function is internal used to compute a normal at a curve point. Each B-Spline-Curve consists of a number of spans. The curve point is parameterized by "numSpan" and "s".

Definition at line 835 of file ContourDetectorBSpline.cpp.

References BIAS::Vector2< T >::NormL2(), and BIAS::Vector< T >::ScalarProduct().

template<class StorageType >
unsigned int BIAS::ContourDetectorBSpline< StorageType >::GetOrder ( )
inline

returns order of B-Spline curve

Definition at line 1412 of file ContourDetectorBSpline.hh.

template<class StorageType >
void ContourDetectorBSpline::GetPoint ( const double &  t,
BIAS::Vector2< double > &  res 
)

returns point on the curve

Parameters
[in]tsample point in [0,1]
[out]resresulting point

Parameter "t" is used to sample the basis of curve and compute the curve point at "t".

Definition at line 420 of file ContourDetectorBSpline.cpp.

template<class StorageType >
void BIAS::ContourDetectorBSpline< StorageType >::GetPoint_ ( const unsigned int  numSpan,
const double &  s,
BIAS::Vector2< double > &  res 
)
inlineprotected

computes a point on curve

Parameters
[in]numSpanspan of curve in which point is located
[in]ssample point of span in [0,1]
[out]resresulting point on curve

This function is internal used to compute a point on a curve. Each B-Spline-Curve consist of a number of spans. Parameter "numSpan" and "s" are used to sample the curve basis.

Definition at line 1456 of file ContourDetectorBSpline.hh.

template<class StorageType >
void ContourDetectorBSpline::GetPointAndParamVec_ ( const unsigned int  numSpan,
const double &  s,
BIAS::Vector< double > &  resParamVec,
BIAS::Vector2< double > &  res 
)
protected

computes a point on curve and a parameter vector (byproduct) which can be used for computing a special matrix (U) in the fitting algorithm

Parameters
[in]numSpanspan of curve in which point is located
[in]ssample point of span in [0,1]
[out]resParamVecspecial parameter vector (byproduct) used in fitting algorithm
[out]resresulting point on curve

This function is internal used to compute a point on a curve. Each B-Spline-Curve consist of a number of spans. Parameter "numSpan" and "s" are used to sample the curve basis. Parameter "resParamVec" is a byproduct of curve point computation. It is build up on basis of "s" and can be used to compute the special matrix "U" in fitting algorihm. More information about "U" can be found in the book "Active Contours".

Definition at line 806 of file ContourDetectorBSpline.cpp.

References TNT::Vector< T >::newsize(), and BIAS::Vector< T >::ScalarProduct().

template<class StorageType >
void ContourDetectorBSpline::Init ( const unsigned int  order,
const ContourBSplineType::Type  bType,
const std::vector< BIAS::Vector2< double > > &  cPnts 
)

initialisation function for simple curve without edges

Parameters
[in]orderorder of B-Spline curve (implies degree)
[in]bTypetype of curve: Open or Closed
[in]cPntscontrol points of curve with x,y-coordinates

Generates/registers basis for B-Spline curve without edges transparently.

Example: bspline.Init(order,BIAS::ContourBSplineType::Open,cPnts);

Definition at line 123 of file ContourDetectorBSpline.cpp.

template<class StorageType >
void ContourDetectorBSpline::Init ( const unsigned int  order,
const ContourBSplineType::Type  bType,
const std::vector< unsigned int > &  mPnts,
const std::vector< BIAS::Vector2< double > > &  cPnts 
)

initialisation function for curve with edges

Parameters
[in]orderorder of B-Spline curve (implies degree)
[in]bTypetype of curve: Open or Closed
[in]mPntsmultiplicity of control points
[in]cPntscontrol points of curve with x,y-coordinates

Generates/registers basis for B-Spline curve with edges transparently.

Param vector mPnts must have same length as vector of control points. A multiplicity of "order-1" at index "i" implies an edge in the curve at control point with index "i".

If type of the curve is "Open" the first control point with an edge is only possible at index "order-1" (begin counting with zero). Last possible control point with an edge is "last index - (order-1)". Edges in control points must have distance in indices of "order-1". Example: If order==3 (quadratic B-Spline) and there is an edge in control point with index 2 (mPnts[2]=2) then the next possible edge is in control point with index 4 (mPnts[4]=2).

If type of curve is "Closed" the indicies of control points with edges must have periodic distance of "order-1". Exampe: If order==3 (quadratic B-Spline) and there is an edge in control point with index 0 (mPnts[0]=2) then the next possible edge is in control point with index 2 (mPnts[2]=2). Periodic distance means that the last possible edge is at index "last index - 1" in this case.

Definition at line 109 of file ContourDetectorBSpline.cpp.

template<class StorageType >
void ContourDetectorBSpline::Init ( const unsigned int  order,
const ContourBSplineType::Type  bType,
const BIAS::Vector< double > &  Q 
)

initialisation function for simple curve without edges

Parameters
[in]orderorder of B-Spline curve (implies degree)
[in]bTypetype of curve: Open or Closed
[in]Qcontrol points of curve first all x-coordinates then all y-coordinates (adopted from book "Active Contours") Q= (x) - vector of x-coordinates (y) - vector of y-coordinates

Generates/registers basis for B-Spline curve without edges transparently.

Definition at line 159 of file ContourDetectorBSpline.cpp.

References BIAS::Vector< T >::Size().

template<class StorageType >
void ContourDetectorBSpline::Init ( const unsigned int  order,
const ContourBSplineType::Type  bType,
const std::vector< unsigned int > &  mPnts,
const BIAS::Vector< double > &  Q 
)

initialisation function for curve with edges

Parameters
[in]orderorder of B-Spline curve (implies degree)
[in]bTypetype of curve: Open or Closed
[in]mPntsmultiplicity of control points
[in]Qcontrol points of curve first all x-coordinates then all y-coordinates (adopted from book "Active Contours") Q= (x) - vector of x-coordinates (y) - vector of y-coordinates

Generates/registers basis for B-Spline curve with edges transparently.

Param vector mPnts must have same length as vector of control points. A multiplicity of "order-1" at index "i" implies an edge in the curve at control point with index "i".

If type of the curve is "Open" the first control point with an edge is only possible at index "order-1" (begin counting with zero). Last possible control point with an edge is "last index - (order-1)". Edges in control points must have distance in indices of "order-1". Example: If order==3 (quadratic B-Spline) and there is an edge in control point with index 2 (mPnts[2]=2) then the next possible edge is in control point with index 4 (mPnts[4]=2).

If type of curve is "Closed" the indicies of control points with edges must have periodic distance of "order-1". Exampe: If order==3 (quadratic B-Spline) and there is an edge in control point with index 0 (mPnts[0]=2) then the next possible edge is in control point with index 2 (mPnts[2]=2). Periodic distance means that the last possible edge is at index "last index - 1" in this case.

Definition at line 139 of file ContourDetectorBSpline.cpp.

References BIAS::ContourBSplineData::Register().

template<class StorageType >
void ContourDetectorBSpline::InitCurve_ ( )
protected

initializes curve for drawing or for getting points on it

Computes curve vectors needed for determine the shape of the curve. Depends on the basis and the current controlpoints.

Definition at line 170 of file ContourDetectorBSpline.cpp.

References BIAS::Matrix< T >::clear(), BIAS::Matrix< T >::GetCol(), and BIAS::Matrix< T >::MultLeft().

template<class StorageType >
bool ContourDetectorBSpline::Load ( const std::string &  filename)

load/initialise a ContourBSpline object from an given binary file

Parameters
[in]filenamename of source file

Definition at line 319 of file ContourDetectorBSpline.cpp.

References BIAS::ContourBSplineType::Cluster, and BIAS::ContourBSplineData::Register().

template<class StorageType >
ContourDetectorBSpline< StorageType > & BIAS::ContourDetectorBSpline< StorageType >::operator= ( const ContourDetectorBSpline< StorageType > &  toCopy)
inline
template<class StorageType >
void ContourDetectorBSpline::QToCPnts_ ( std::vector< BIAS::Vector2< double > > &  cPnts)
protected

converts a flat control point vector Q whose first entries are x-coordinates and last entries are y-coordinates to a control point vector with x,y-coordinates

Parameters
[out]cPntscontrol point vector with x,y-coordinates

Definition at line 781 of file ContourDetectorBSpline.cpp.

template<class StorageType >
void ContourDetectorBSpline::QToCPnts_ ( const BIAS::Vector< double > &  Q,
std::vector< BIAS::Vector2< double > > &  cPnts 
)
protected

converts a flat control point vector Q whose first entries are x-coordinates and last entries are y-coordinates to a control point vector with x,y-coordinates

Parameters
[in]Qvector of control points; first entries are x-coordinates; last entries are y-coordinates
[out]cPntscontrol point vector with x,y-coordinates

Definition at line 793 of file ContourDetectorBSpline.cpp.

References TNT::Vector< T >::size().

template<class StorageType >
void ContourDetectorBSpline::Rotate ( const double &  angle)

rotates curve by angle (rad)

Parameters
[in]anglerotation angle

Rotates curve by angle. Curve must have its origin at zero! There is no test!

Definition at line 399 of file ContourDetectorBSpline.cpp.

References BIAS::Matrix2x2< T >::Mult().

template<class StorageType >
bool ContourDetectorBSpline::Save ( const std::string &  filename)

saves all values which are needed to reinitialise the object to a binary file

Parameters
[in]filenamename of destination file

Definition at line 261 of file ContourDetectorBSpline.cpp.

References BIAS::ContourBSplineType::Cluster.

template<class StorageType >
void BIAS::ContourDetectorBSpline< StorageType >::Scale ( const double &  scale)
inline

scales curve isotropic

Parameters
[in]scalescaling factor

Scales the curve by factor "scale". Curve must have its origin at zero! There is no test!

Definition at line 1219 of file ContourDetectorBSpline.hh.

template<class StorageType >
void BIAS::ContourDetectorBSpline< StorageType >::ScaleX ( const double &  scale)
inline

scales curve in x-direction (horizontally)

Parameters
[in]scalescaling factor

Scales the curve by factor "scale" horizontally. Curve must have its origin at zero! There is no test!

Definition at line 1229 of file ContourDetectorBSpline.hh.

template<class StorageType >
void BIAS::ContourDetectorBSpline< StorageType >::ScaleY ( const double &  scale)
inline

scales curve in y-direction (vertically)

Parameters
[in]scalescaling factor

Scales the curve by factor "scale" vertically. Curve must have its origin at zero! There is no test!

Definition at line 1239 of file ContourDetectorBSpline.hh.

template<class StorageType >
void BIAS::ContourDetectorBSpline< StorageType >::SetControlPoints ( const std::vector< BIAS::Vector2< double > > &  controlPoints)
inline

sets new control points

Parameters
[in]controlPointsvector of control points with x,y-coordinates

Definition at line 1191 of file ContourDetectorBSpline.hh.

template<class StorageType >
void BIAS::ContourDetectorBSpline< StorageType >::SetControlPoints ( const BIAS::Vector< double > &  Q)
inline

sets new control points

Parameters
[in]Qvector of control points consisting of vector of x-coordinates and of vector of y-coordinates Q= (x) vector of x-coordinates (y) vector of y-coordinates

Definition at line 1200 of file ContourDetectorBSpline.hh.

template<class StorageType >
void BIAS::ContourDetectorBSpline< StorageType >::SetDrawSamples ( unsigned int  samples)
inline

sets the amount of sample points used to draw the B-Spline curve.

Parameters
[in]samplesamount of samples used to draw curve

Sets amount of samples which are used to draw the curve. Distance between sample points gets computed (sample width). the sample width is equidistant in sampling the basis of the curve, but not in sampling the curve points!

Definition at line 1403 of file ContourDetectorBSpline.hh.

template<class StorageType >
void BIAS::ContourDetectorBSpline< StorageType >::SetDrawSampleWidth ( double  width)
inline

sets the amount of sample points used to draw the B-Spline curve.

Parameters
[in]widthdistance of sample points along the curve (<1.0)

Computes the amount of samples which are used to draw the curve. These sample points have distance "width". "width" should be considerably <1.0. the sample width is equidistant in sampling the basis of the curve, but not in sampling the curve points!

Definition at line 1393 of file ContourDetectorBSpline.hh.

template<class StorageType >
void BIAS::ContourDetectorBSpline< StorageType >::SetFitSamples ( unsigned int  samples)
inline

sets the amount of samples used to search features along the curve in fitting algorithm.

Parameters
[in]samplesamount of samples used to search features

Sets amount of samples which are used to search features along the curve in the fitting algorithm. Distance between sample points gets computed (sample width). the sample width is equidistant in sampling the basis of the curve, but not in sampling the curve points!

Definition at line 1383 of file ContourDetectorBSpline.hh.

template<class StorageType >
void BIAS::ContourDetectorBSpline< StorageType >::SetFitSampleWidth ( double  width)
inline

sets the amount of samples used to search features along the curve in fitting algorithm.

Parameters
[in]widthdistance of sample points along the curve (<1.0)

Computes the amount of samples which are used to search features along the curve in the fitting algorithm. These sample points have distance "width". "width" should be considerably <1.0. the sample width is equidistant in sampling the basis of the curve, but not in sampling the curve points!

Definition at line 1373 of file ContourDetectorBSpline.hh.

template<class StorageType >
void BIAS::ContourDetectorBSpline< StorageType >::SetShapeSpaceEuclidian ( )
inline

sets spape-space for regularised fitting to euclidian similarities

Read book "Active Contours" chapter 6 for details.

Definition at line 1285 of file ContourDetectorBSpline.hh.

References BIAS::ContourBSplineShapeMatrix::SetShapeSpaceEuclidian().

template<class StorageType >
void BIAS::ContourDetectorBSpline< StorageType >::SetShapeSpaceIdentity ( )
inline

sets spape-space for regularised fitting to identity

Read book "Active Contours" chapter 6 for details. If youre not sure which shape-space to set... set this.

Definition at line 1275 of file ContourDetectorBSpline.hh.

References BIAS::ContourBSplineShapeMatrix::SetShapeSpaceIdentity().

template<class StorageType >
void BIAS::ContourDetectorBSpline< StorageType >::SetShapeSpaceMatrix ( BIAS::Matrix< double > &  shapeSpace)
inline

sets spape-space for regularised fitting

Parameters
[in]shapeSpacematrix of shape-space

Read book "Active Contours" chapter 6 for details.

Definition at line 1264 of file ContourDetectorBSpline.hh.

References BIAS::ContourBSplineShapeMatrix::SetShapeSpaceMatrix().

template<class StorageType >
void BIAS::ContourDetectorBSpline< StorageType >::SetShapeSpacePlanarAffin ( )
inline

sets spape-space for regularised fitting to planar affine transformations

Read book "Active Contours" chapter 6 for details.

Definition at line 1295 of file ContourDetectorBSpline.hh.

References BIAS::ContourBSplineShapeMatrix::SetShapeSpacePlanarAffin().

template<class StorageType >
void BIAS::ContourDetectorBSpline< StorageType >::SetSubShapeSpaceEuclidian ( )
inline

set invariant shape-space for regularised fitting to euclidian similarities

Read book "Active Contours" chapter 6 for details.

Definition at line 1326 of file ContourDetectorBSpline.hh.

References BIAS::ContourBSplineShapeMatrix::SetShapeSpaceEuclidian().

template<class StorageType >
void BIAS::ContourDetectorBSpline< StorageType >::SetSubShapeSpaceIdentity ( )
inline

set invariant shape-space for regularised fitting to identity

Read book "Active Contours" chapter 6 for details.

Definition at line 1316 of file ContourDetectorBSpline.hh.

References BIAS::ContourBSplineShapeMatrix::SetShapeSpaceIdentity().

template<class StorageType >
void BIAS::ContourDetectorBSpline< StorageType >::SetSubShapeSpaceMatrix ( BIAS::Matrix< double > &  subShapeSpace)
inline

set invariant shape-space for regularised fitting

Parameters
[in]subShapeSpacematrix of invariant shape-space

Read book "Active Contours" chapter 6 for details.

Definition at line 1305 of file ContourDetectorBSpline.hh.

References BIAS::ContourBSplineShapeMatrix::SetShapeSpaceMatrix().

template<class StorageType >
void BIAS::ContourDetectorBSpline< StorageType >::SetSubShapeSpacePlanarAffin ( )
inline

set invariant shape-space for regularised fitting to planar affine transformation

Read book "Active Contours" chapter 6 for details.

Definition at line 1336 of file ContourDetectorBSpline.hh.

References BIAS::ContourBSplineShapeMatrix::SetShapeSpacePlanarAffin().

template<class StorageType >
void BIAS::ContourDetectorBSpline< StorageType >::SetSubShapeSpaceZero ( )
inline

set invariant shape-space for regularised fitting to zero

If you set invariant shape-space matrix to zero, you have to set the normal shape-space before (SetShapeSpace...(...))!

Read book "Active Contours" chapter 6 for details.

Definition at line 1346 of file ContourDetectorBSpline.hh.

References BIAS::ContourBSplineShapeMatrix::SetSubShapeSpaceZero().

template<class StorageType >
void ContourDetectorBSpline::TestInit_ ( const unsigned int  order,
const ContourBSplineType::Type  bType,
const std::vector< unsigned int > &  mPnts,
const BIAS::Vector< double > &  Q 
)
protected

tests if B-Spline curve with given parameter can get initialized.

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

Test if B-Spline curve with given parameter can get initialised. Most important test if mPnts is correct. That means if edges could be generated in these control points.

Definition at line 1205 of file ContourDetectorBSpline.cpp.

References BIAS::ContourBSplineType::Closed, BIAS::ContourBSplineType::Open, BIAS::Vector< T >::Size(), and TNT::Vector< T >::size().

Member Data Documentation

template<class StorageType>
bool BIAS::ContourDetectorBSpline< StorageType >::curveInitialised_
protected

bool to indicate a change of control points

Definition at line 1139 of file ContourDetectorBSpline.hh.

template<class StorageType>
std::vector<std::vector<BIAS::Vector<double> > > BIAS::ContourDetectorBSpline< StorageType >::curveVectors_
protected

vectors needed to draw curve (determined by InitCurve_)

Definition at line 1137 of file ContourDetectorBSpline.hh.

template<class StorageType>
unsigned int BIAS::ContourDetectorBSpline< StorageType >::drawSamples_
protected

amount of samples used in drawing algorithm

Definition at line 1155 of file ContourDetectorBSpline.hh.

Referenced by BIAS::ContourDetectorBSpline< StorageType >::operator=().

template<class StorageType>
double* BIAS::ContourDetectorBSpline< StorageType >::drawSampleWidth_
protected

distance of sample points in basis used in drawing algorithm

Definition at line 1151 of file ContourDetectorBSpline.hh.

Referenced by BIAS::ContourDetectorBSpline< StorageType >::operator=().

template<class StorageType>
unsigned int BIAS::ContourDetectorBSpline< StorageType >::fitSamples_
protected

amount of samples used in fitting algorithm

Definition at line 1153 of file ContourDetectorBSpline.hh.

Referenced by BIAS::ContourDetectorBSpline< StorageType >::operator=().

template<class StorageType>
double* BIAS::ContourDetectorBSpline< StorageType >::fitSampleWidth_
protected

distance of sample points in basis used in fitting algorithm

Definition at line 1149 of file ContourDetectorBSpline.hh.

Referenced by BIAS::ContourDetectorBSpline< StorageType >::operator=().

template<class StorageType>
ContourBSplineData* BIAS::ContourDetectorBSpline< StorageType >::pData_
protected

pointer to data of B-Spline curve initialised by call of Init(...)

Definition at line 1134 of file ContourDetectorBSpline.hh.

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

template<class StorageType>
ContourBSplineShapeMatrix* BIAS::ContourDetectorBSpline< StorageType >::pRegMatrix_
protected

pointer to regularisation matrix object

Definition at line 1146 of file ContourDetectorBSpline.hh.

Referenced by BIAS::ContourDetectorBSpline< StorageType >::operator=().

template<class StorageType>
ContourBSplineShapeMatrix* BIAS::ContourDetectorBSpline< StorageType >::pShapeSpaceMatrix_
protected

pointer to shape-space matrix object

Definition at line 1142 of file ContourDetectorBSpline.hh.

Referenced by BIAS::ContourDetectorBSpline< StorageType >::operator=().

template<class StorageType>
ContourBSplineShapeMatrix* BIAS::ContourDetectorBSpline< StorageType >::pSubShapeSpaceMatrix_
protected

pointer to invariant shape-space matrix object

Definition at line 1144 of file ContourDetectorBSpline.hh.

Referenced by BIAS::ContourDetectorBSpline< StorageType >::operator=().

template<class StorageType>
BIAS::Vector<double> BIAS::ContourDetectorBSpline< StorageType >::Q_
protected

vector of control points; first entries are x-coordinates; last entries are y-coordinates

Definition at line 1131 of file ContourDetectorBSpline.hh.

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


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