public class MovingLeastSquaresMesh<M extends AbstractModel<M>> extends TransformMesh
@article{SchaeferAl06, author = {Scott Schaefer and Travis McPhail and Joe Warren}, title = {Image deformation using moving least squares}, journal = {ACM Transactions on Graphics}, volume = {25}, number = {3}, month = {July}, year = {2006}, issn = {0730-0301}, pages = {533--540}, publisher = {ACM}, address = {New York, NY, USA}, }
Modifier and Type | Field and Description |
---|---|
protected double |
error |
protected Class<M> |
modelClass |
protected HashMap<PointMatch,Tile<M>> |
pt
Tiles are a collection of PointMatches that share a common
transformation model.
|
av, defaultPointFactory, defaultPointMatchFactory, height, va, width
Constructor and Description |
---|
MovingLeastSquaresMesh(Class<M> modelClass,
int numX,
double width,
double height) |
MovingLeastSquaresMesh(Class<M> modelClass,
int numX,
int numY,
double width,
double height) |
Modifier and Type | Method and Description |
---|---|
void |
addMatchWeightedByDistance(PointMatch pm,
double alpha)
Add a PointMatch to all Tiles weighted by its distance to the
corresponding vertex.
|
void |
apply(CoordinateTransform t)
Apply an arbitrary coordinate transformation to each Tile's
PointMatches.
|
Tile<M> |
findClosest(double[] there)
What to use this method for:
If you want to add a PointMatch between two Tiles t and o do the
following.
|
double |
getError() |
Class<M> |
getModelClass() |
HashMap<PointMatch,Tile<M>> |
getVerticeModelMap() |
Set<PointMatch> |
getVertices() |
int |
numVertices() |
void |
updateModels()
Updates each vertex' transformation model by means of moving least
squares.
|
protected double |
weigh(double d,
double alpha) |
addTriangle, apply, applyInPlace, applyInverse, applyInverseInPlace, bounds, createInverse, findClosestSourcePoint, findClosestTargetPoint, getAV, getHeight, getVA, getWidth, illustrateBestRigidSVG, illustrateMesh, illustrateMeshSVG, illustrateTriangle, init, isInConvexTargetPolygon, isInSourcePolygon, numY, scale, updateAffine, updateAffines
protected final HashMap<PointMatch,Tile<M extends AbstractModel<M>>> pt
protected double error
protected final Class<M extends AbstractModel<M>> modelClass
public MovingLeastSquaresMesh(Class<M> modelClass, int numX, int numY, double width, double height)
public final HashMap<PointMatch,Tile<M>> getVerticeModelMap()
public final Set<PointMatch> getVertices()
public final int numVertices()
public final double getError()
protected final double weigh(double d, double alpha)
public final Tile<M> findClosest(double[] there)
public final void addMatchWeightedByDistance(PointMatch pm, double alpha)
pm
- alpha
- public final void updateModels() throws NotEnoughDataPointsException, IllDefinedDataPointsException
public final void apply(CoordinateTransform t)
modelClass
.
This method is intended to be used for initializing the mesh in case
that further operations estimate a refined configuration.t
- Copyright © 2015–2021 Fiji. All rights reserved.