@References(references={@Reference(author={"Cootes, T. F.","Taylor, C. J."},title="Statistical Models of Appearance for Computer Vision",type=Unpublished,month="October",year="2001",url="http://isbe.man.ac.uk/~bim/Models/app_model.ps.gz"),@Reference(type=Inproceedings,author={"Cj. Taylor","D. H. Cooper","J. Graham"},title="Training models of shape from sets of examples",year="1992",booktitle="Proc. BMVC92, Springer-Verlag",pages={"9","","18"})}) public class PointDistributionModel extends Object
PointList
s with
corresponding points (the ith point in each PointList
is the same
landmark).
The pdm models the mean shape and the variance from the mean of the
top N principal components. The model is generative and can generate new
shapes from a scaling vector. To ensure that newly generated shapes are
plausible, scaling vectors have PointDistributionModel.Constraint
s applied to them.Modifier and Type | Class and Description |
---|---|
static class |
PointDistributionModel.BoxConstraint
A constraint that ensures that each individual
element of the scaling vector is within
+/- x standard deviations of the model.
|
static interface |
PointDistributionModel.Constraint
Interface for modelling constraints applied to the
scaling vector of
PointDistributionModel s
so that generated models are plausible. |
static class |
PointDistributionModel.EllipsoidConstraint
Constrain the scaling vector to a hyper-ellipsoid.
|
static class |
PointDistributionModel.NullConstraint
A constraint that does nothing.
|
Modifier and Type | Field and Description |
---|---|
protected PointDistributionModel.Constraint |
constraint |
protected int |
maxIter |
protected PointList |
mean |
protected int |
numComponents |
protected PrincipalComponentAnalysis |
pc |
Constructor and Description |
---|
PointDistributionModel(List<PointList> data)
Construct a
PointDistributionModel from the given data
with a PointDistributionModel.NullConstraint . |
PointDistributionModel(PointDistributionModel.Constraint constraint,
List<PointList> data)
Construct a
PointDistributionModel from the given data
and PointDistributionModel.Constraint . |
Modifier and Type | Method and Description |
---|---|
IndependentPair<Jama.Matrix,double[]> |
fitModel(PointList observed)
Determine the best parameters of the PDM for the given model.
|
PointList |
generateNewShape(double[] scaling)
Generate a plausible new shape from the scaling vector.
|
PointList |
getMean() |
double[] |
getStandardDeviations(double multiplier)
Compute the standard deviations of the shape components, multiplied by the
given value.
|
void |
setNumComponents(int n)
Set the number of components of the PDM
|
void |
setNumComponents(PrincipalComponentAnalysis.ComponentSelector selector)
Set the number of components of the PDM using a
PrincipalComponentAnalysis.ComponentSelector . |
protected PointDistributionModel.Constraint constraint
protected PrincipalComponentAnalysis pc
protected int numComponents
protected int maxIter
public PointDistributionModel(List<PointList> data)
PointDistributionModel
from the given data
with a PointDistributionModel.NullConstraint
.data
- public PointDistributionModel(PointDistributionModel.Constraint constraint, List<PointList> data)
PointDistributionModel
from the given data
and PointDistributionModel.Constraint
.constraint
- data
- public void setNumComponents(int n)
n
- number of componentspublic void setNumComponents(PrincipalComponentAnalysis.ComponentSelector selector)
PrincipalComponentAnalysis.ComponentSelector
.selector
- the PrincipalComponentAnalysis.ComponentSelector
to apply.public PointList generateNewShape(double[] scaling)
PointDistributionModel.Constraint
before being used to generate the model.scaling
- scaling vector.public double[] getStandardDeviations(double multiplier)
multiplier
- the multiplierpublic IndependentPair<Jama.Matrix,double[]> fitModel(PointList observed)
observed
- the observed model.