Structural deformable models
Public Member Functions | Protected Attributes | List of all members
EMDXformer Class Reference

#include <ExpMap.h>

Inheritance diagram for EMDXformer:
Inheritance graph
[legend]
Collaboration diagram for EMDXformer:
Collaboration graph
[legend]

Public Member Functions

 EMDXformer (EMDistribution *input, const PropVec &origin=getIdentityPropTF(), const DMatrixf &tfmat=DMatrixf())
 
virtual ~EMDXformer ()
 
virtual EMDistributioncopy () const
 
PropVec getPropVec () const
 
float ratePropVec (const PropVec &prop, Winner *winner=NULL) const
 
void setTFMat (const DMatrixf &mat)
 
void setMean (const PropVec &mean)
 
void setStdev (const PropVec &stdev)
 
- Public Member Functions inherited from EMDistribution
 EMDistribution ()
 
virtual ~EMDistribution ()
 
virtual void setIntegral (float integral)
 
void setCreator (const Winner &creator)
 
void setShootCount (dword scount)
 
dword getShootCount () const
 
bool hasFlags (dword flags) const
 
void setFlags (dword flags)
 
void unsetFlags (dword flags=0xffffffff)
 

Protected Attributes

EMDistributionm_InputEMD
 
DMatrixf m_TFMat
 
DMatrixf m_ITFMat
 
PropVec m_Origin
 
PropVec m_Mean
 
PropVec m_Stdev
 

Additional Inherited Members

- Public Types inherited from EMDistribution
enum  EDFlags { ED_NONE =0, ED_OLD =1 }
 
- Public Attributes inherited from EMDistribution
float m_Integral
 
Winner m_Creator
 
dword m_ShootCount
 
dword m_Flags
 

Detailed Description

Definition at line 109 of file ExpMap.h.

Constructor & Destructor Documentation

EMDXformer::EMDXformer ( EMDistribution input,
const PropVec origin = getIdentityPropTF(),
const DMatrixf tfmat = DMatrixf() 
)
inline

Definition at line 111 of file ExpMap.h.

References NULL.

114  : m_InputEMD(input), m_Origin(origin), m_Mean(0.f), m_Stdev(1.f) {
115  assert(input != NULL);
116  setTFMat(tfmat);
117  }
#define NULL
Definition: simpletypes.h:9
EMDistribution * m_InputEMD
Definition: ExpMap.h:137
PropVec m_Mean
Definition: ExpMap.h:139
PropVec m_Origin
Definition: ExpMap.h:139
PropVec m_Stdev
Definition: ExpMap.h:139
void setTFMat(const DMatrixf &mat)
Definition: ExpMap.cpp:267
virtual EMDXformer::~EMDXformer ( )
inlinevirtual

Definition at line 123 of file ExpMap.h.

References NULL.

123  {
124  delete m_InputEMD; m_InputEMD = NULL;
125  }
#define NULL
Definition: simpletypes.h:9
EMDistribution * m_InputEMD
Definition: ExpMap.h:137

Member Function Documentation

virtual EMDistribution* EMDXformer::copy ( ) const
inlinevirtual

Reimplemented from EMDistribution.

Definition at line 126 of file ExpMap.h.

References EMDistribution::copy(), m_InputEMD, and NULL.

126  {
127  EMDXformer* cpy = new EMDXformer(*this);
128  cpy->m_InputEMD = m_InputEMD->copy();
129  return (EMDistribution*) cpy;
130  }
EMDistribution * m_InputEMD
Definition: ExpMap.h:137
EMDXformer(EMDistribution *input, const PropVec &origin=getIdentityPropTF(), const DMatrixf &tfmat=DMatrixf())
Definition: ExpMap.h:111
virtual EMDistribution * copy() const
Definition: ExpMap.h:53
PropVec EMDXformer::getPropVec ( ) const
virtual

Reimplemented from EMDistribution.

Definition at line 245 of file ExpMap.cpp.

References fwdPropTF(), and hgPropTF().

246 {
247  PropVec propPV = m_InputEMD->getPropVec();
248  hgPropTF(m_TFMat, propPV);
249  propPV *= m_Stdev;
250  propPV += m_Mean;
251  PropVec pv(m_Origin);
252  fwdPropTF(pv, propPV);
253  return pv;
254 }
virtual PropVec getPropVec() const
Definition: ExpMap.h:49
PropVec & hgPropTF(const DMatrixf &tfmat, PropVec &prop)
Definition: ExpMap.h:182
EMDistribution * m_InputEMD
Definition: ExpMap.h:137
PropVec m_Mean
Definition: ExpMap.h:139
PropVec m_Origin
Definition: ExpMap.h:139
PropVec & fwdPropTF(PropVec &from, const PropTF &tf)
Definition: PropVec.h:51
PropVec m_Stdev
Definition: ExpMap.h:139
DMatrixf m_TFMat
Definition: ExpMap.h:138
float EMDXformer::ratePropVec ( const PropVec prop,
Winner winner = NULL 
) const
virtual

Reimplemented from EMDistribution.

Definition at line 256 of file ExpMap.cpp.

References getPropDir(), getPropTF(), hgPropTF(), mapAnglePI(), and setPropDir().

257 {
258 //inverse transform
259  PropVec tfprop(getPropTF(m_Origin, prop));
260  tfprop -= m_Mean;
261  setPropDir(tfprop, mapAnglePI(getPropDir(tfprop)));
262  tfprop /= m_Stdev;
263  hgPropTF(m_ITFMat, tfprop);
264  return m_InputEMD->ratePropVec(tfprop);
265 }
DMatrixf m_ITFMat
Definition: ExpMap.h:138
PropTF getPropTF(const PropVec &from, const PropVec &to)
Definition: PropVec.h:37
PropVec & hgPropTF(const DMatrixf &tfmat, PropVec &prop)
Definition: ExpMap.h:182
EMDistribution * m_InputEMD
Definition: ExpMap.h:137
PropVec & setPropDir(PropVec &prop, float dir)
Definition: PropVec.h:28
PropVec m_Mean
Definition: ExpMap.h:139
float getPropDir(const PropVec &prop)
Definition: PropVec.h:25
virtual float ratePropVec(const PropVec &prop, Winner *winner=NULL) const
Definition: ExpMap.h:56
PropVec m_Origin
Definition: ExpMap.h:139
PropVec m_Stdev
Definition: ExpMap.h:139
float mapAnglePI(float a)
Definition: mathutil.h:107
void EMDXformer::setMean ( const PropVec mean)
inline

Definition at line 134 of file ExpMap.h.

Referenced by SubStructure::generateEMDist().

134 { m_Mean = mean; }
PropVec m_Mean
Definition: ExpMap.h:139
void EMDXformer::setStdev ( const PropVec stdev)
inline

Definition at line 135 of file ExpMap.h.

References dmutil::stdev().

135 { m_Stdev = stdev; }
PropVec m_Stdev
Definition: ExpMap.h:139
DMatrix< T > stdev(const DMatrix< T > &mat)
Definition: DMatrixUtil.h:106
void EMDXformer::setTFMat ( const DMatrixf mat)

Definition at line 267 of file ExpMap.cpp.

References dmutil::inverse(), VVector< T, D >::size(), DMatrix< T >::sizeX(), and DMatrix< T >::sizeY().

268 {
269  if(mat.sizeX() == mat.sizeY() &&
270  (mat.sizeX() == PropVec::size() ||
271  mat.sizeX() == PropVec::size()+1)) {
272  m_TFMat = mat;
274  } else {
275  m_TFMat.clear();
276  m_ITFMat.clear();
277  }
278 }
DMatrix< T > inverse(const DMatrix< T > &dmat)
Definition: DMatrixLinAlg.h:67
DMatrixf m_ITFMat
Definition: ExpMap.h:138
void clear()
Definition: DMatrix.h:40
dword sizeX() const
Definition: DMatrix.h:42
dword sizeY() const
Definition: DMatrix.h:43
DMatrixf m_TFMat
Definition: ExpMap.h:138
static unsigned int size()
Definition: VVector.h:41

Member Data Documentation

EMDistribution* EMDXformer::m_InputEMD
protected

Definition at line 137 of file ExpMap.h.

Referenced by copy().

DMatrixf EMDXformer::m_ITFMat
protected

Definition at line 138 of file ExpMap.h.

PropVec EMDXformer::m_Mean
protected

Definition at line 139 of file ExpMap.h.

PropVec EMDXformer::m_Origin
protected

Definition at line 139 of file ExpMap.h.

PropVec EMDXformer::m_Stdev
protected

Definition at line 139 of file ExpMap.h.

DMatrixf EMDXformer::m_TFMat
protected

Definition at line 138 of file ExpMap.h.


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