public class MovingLeastSquaresTransform2 extends AbstractMovingLeastSquaresTransform
Alternative implementation of the smooth coordinate transformation interpolating between a set of control points that are maped exactly on top of each other using landmark based deformation by means of Moving Least Squares as described by \citet{SchaeferAl06}.
This implementation stores the control points in double arrays thus
being significantly more memory efficient than the object based
MovingLeastSquaresTransform
. The object count is constant and does
not depend on the number of control points.
Note, the AbstractMovingLeastSquaresTransform.apply(double[])
and applyInPlace(double[])
methods are not concurrency safe because they use the same Model
instance to execute the local least squares fit.
@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 float[][] |
p |
protected float[][] |
q |
protected float[] |
w |
alpha, model
Constructor and Description |
---|
MovingLeastSquaresTransform2() |
Modifier and Type | Method and Description |
---|---|
void |
applyInPlace(double[] location)
Apply the
CoordinateTransform to a location. |
void |
setMatches(Collection<PointMatch> matches)
Set the control points.
|
void |
setMatches(float[][] p,
float[][] q,
float[] w)
Set the control points passing them as arrays that are used by
reference.
|
public final void setMatches(Collection<PointMatch> matches) throws NotEnoughDataPointsException, IllDefinedDataPointsException
PointMatches
are not stored
by reference but their data is copied into internal data buffers.setMatches
in class AbstractMovingLeastSquaresTransform
matches
- NotEnoughDataPointsException
IllDefinedDataPointsException
public final void setMatches(float[][] p, float[][] q, float[] w) throws NotEnoughDataPointsException, IllDefinedDataPointsException
Set the control points passing them as arrays that are used by reference. The leading index is dimension which usually results in a reduced object count. E.g. four 2d points are:
double[][]{
{x1, x2, x3, x4},
{y1, y2, y3, y4} }
p
- source pointsq
- target pointsw
- weightsNotEnoughDataPointsException
IllDefinedDataPointsException
public void applyInPlace(double[] location)
CoordinateTransform
CoordinateTransform
to a location.Copyright © 2015–2021 Fiji. All rights reserved.