25 #include <Base/Debug/Debug.hh>
26 #include <MathAlgo/SVD.hh>
28 #include "ContourBSplineShapeMatrix.hh"
42 (*mat)[i][j] = matrix[i][j];
51 const unsigned int numBasePolynoms){
53 mat->
newsize(2*numBasePolynoms,2*numBasePolynoms);
61 const unsigned int numBasePolynoms,
65 mat->
newsize(2*numBasePolynoms,4);
68 for(i=0;i<numBasePolynoms;i++){
70 (*mat)[i+numBasePolynoms][1]=1.;
72 (*mat)[i+numBasePolynoms][2]=Q[i+numBasePolynoms];
73 (*mat)[i][3]=-Q[i+numBasePolynoms];
74 (*mat)[i+numBasePolynoms][3]=Q[i];
82 const unsigned int numBasePolynoms,
86 mat->
newsize(2*numBasePolynoms,6);
89 for(i=0;i<numBasePolynoms;i++){
91 (*mat)[i+numBasePolynoms][1]=1.;
93 (*mat)[i+numBasePolynoms][3]=Q[i+numBasePolynoms];
94 (*mat)[i+numBasePolynoms][4]=Q[i];
95 (*mat)[i][5]=Q[i+numBasePolynoms];
108 pntr_.push_back(mat);
124 HscriptSub=*subShapeSpace;
126 HscriptSub.MultLeft(Uscript);
127 Hscript.MultLeft(shapeSpace->
Transpose());
128 HscriptSub.MultLeft(subShapeSpace->
Transpose());
138 BIAS::SVD subShapeSpaceSVD(*subShapeSpace);
177 (*mat)[i][j]=Ed[i][j];
184 pntr_.push_back(mat);
computes and holds the singular value decomposition of a rectangular (not necessarily quadratic) Matr...
Subscript num_cols() const
Matrix< T > Transpose() const
transpose function, storing data destination matrix
data object which holds a shape matrix or regularisation matrix for a b-spline curve; could be shared...
Matrix< T > & newsize(Subscript M, Subscript N)
unsigned int reference_
reference counter - for handling unregister
data object which holds all infomations of a B-Spline curve (ContourBSpline); its shared by B-Spline ...
static ContourBSplineShapeMatrix * ComputeRegularisationMatrix(ContourBSplineData *data, ContourBSplineShapeMatrix *shapeSpace, ContourBSplineShapeMatrix *subShapeSpace)
generates a new regularisation matrix as ContourBSplineShapeMatrix object and returns pointer to it ...
static ContourBSplineShapeMatrix * SetShapeSpacePlanarAffin(const unsigned int numBasePolynoms, const BIAS::Vector< double > &Q)
generates a new shape-matrix (invariant as well) as ContourBSplineShapeMatrix object and returns a po...
ContourBSplineShapeMatrix()
standard constructor
void SetZero()
Sets all values to zero.
static ContourBSplineShapeMatrix * SetShapeSpaceMatrix(const BIAS::Matrix< double > &matrix)
generates a new shape-matrix (invariant as well) as ContourBSplineShapeMatrix object and returns a po...
void SetIdentity()
Converts matrix to identity matrix.
static ContourBSplineShapeMatrix * SetShapeSpaceIdentity(const unsigned int numBasePolynoms)
generates a new shape-matrix (invariant as well) as ContourBSplineShapeMatrix object and returns a po...
Matrix< double > Invert()
returns pseudoinverse of A = U * S * V^T A^+ = V * S^+ * U^T
static ContourBSplineShapeMatrix * SetSubShapeSpaceZero(ContourBSplineShapeMatrix *shapeSpace)
generates a new invariant shape-matrix as ContourBSplineShapeMatrix object and returns a pointer to i...
void MultLeft(const Matrix< T > &arg)
in Place matrix multiplication this is equal to M = arg*M, but faster
Subscript num_rows() const
static std::list< ContourBSplineShapeMatrix * > pntr_
list of all pointers to ContourBSplineShapeMatrix objects
BIAS::Matrix< double > splineMetricMatrixParametric_
metric matrix - confer to "Active Contours", chapter 3, p.59
static ContourBSplineShapeMatrix * SetShapeSpaceEuclidian(const unsigned int numBasePolynoms, const BIAS::Vector< double > &Q)
generates a new shape-matrix (invariant as well) as ContourBSplineShapeMatrix object and returns a po...