public class PointMatch extends Object implements Serializable
Points
that are expected to be ideally at
the same location in the world coordinate space.
The link is directed, such that each link touches only p1
.Modifier and Type | Field and Description |
---|---|
protected Point |
p1 |
protected Point |
p2 |
protected double |
strength |
protected double |
weight |
protected double[] |
weights |
Constructor and Description |
---|
PointMatch(Point p1,
Point p2)
Constructor
Create a
PointMatch without weight. |
PointMatch(Point p1,
Point p2,
double weight)
Constructor
Create a
PointMatch with one weight. |
PointMatch(Point p1,
Point p2,
double[] weights)
Constructor
Create a
PointMatch with an Array of weights. |
PointMatch(Point p1,
Point p2,
double[] weights,
double strength)
Constructor
Create a
PointMatch with an Array of weights and a strength. |
PointMatch(Point p1,
Point p2,
double weight,
double strength)
Constructor
Create a
PointMatch with one weight and strength. |
Modifier and Type | Method and Description |
---|---|
static void |
apply(Collection<? extends PointMatch> matches,
CoordinateTransform t)
|
void |
apply(CoordinateTransform t)
Apply a
CoordinateTransform to p1 , update distance. |
void |
apply(CoordinateTransform t,
double amount)
Apply a
CoordinateTransform to p1 with a given amount,
update distance. |
protected void |
calculateWeight() |
static void |
cloneSourcePoints(Collection<PointMatch> matches,
Collection<Point> sourcePoints) |
static void |
cloneTargetPoints(Collection<PointMatch> matches,
Collection<Point> targetPoints) |
static Collection<PointMatch> |
flip(Collection<PointMatch> matches)
Flip symmetrically, weights remains unchanged.
|
static void |
flip(Collection<PointMatch> matches,
Collection<PointMatch> flippedMatches)
Flip all
PointMatches from
matches symmetrically and fill
flippedMatches with them, weights remain
unchanged. |
double |
getDistance() |
Point |
getP1() |
Point |
getP2() |
double |
getWeight() |
double[] |
getWeights() |
static double |
maxDistance(Collection<PointMatch> matches) |
static double |
meanDistance(Collection<PointMatch> matches) |
double |
popWeight()
Get the last weights element and remove it from the list.
|
void |
pushWeight(double w)
Append a new element to the right side of the weights list.
|
void |
setWeight(int index,
double weight) |
void |
setWeights(double[] weights) |
double |
shiftWeight()
Get the first weights element and remove it from the list.
|
static void |
sourcePoints(Collection<PointMatch> matches,
Collection<Point> sourcePoints) |
static void |
targetPoints(Collection<PointMatch> matches,
Collection<Point> targetPoints) |
void |
unshiftWeight(double w)
Append a new element to the left side of the weights list.
|
protected double strength
protected final Point p1
protected final Point p2
protected double[] weights
protected double weight
public PointMatch(Point p1, Point p2, double[] weights, double strength)
PointMatch
with an Array of weights and a strength.
The Array of weights will be copied.
Strength gives the amount of application:
strength = 0 means p1
will not be transferred,
strength = 1 means p1
will be fully transferredp1
- Point 1p2
- Point 2weights
- Array of weightsstrength
- how much should apply(CoordinateTransform, double)
affect p1
public PointMatch(Point p1, Point p2, double[] weights)
PointMatch
with an Array of weights.
The Array of weights will be copied.p1
- Point 1p2
- Point 2weights
- Array of weightspublic PointMatch(Point p1, Point p2, double weight)
PointMatch
with one weight.p1
- Point 1p2
- Point 2weight
- Weightpublic PointMatch(Point p1, Point p2, double weight, double strength)
PointMatch
with one weight and strength.
Strength gives the amount of application:
strength = 0 means p1
will not be transferred,
strength = 1 means p1
will be fully transferredp1
- Point 1p2
- Point 2weight
- Weightstrength
- how much should
apply(CoordinateTransform, double)
affect p1
public PointMatch(Point p1, Point p2)
PointMatch
without weight.p1
- Point 1p2
- Point 2public Point getP1()
public Point getP2()
protected void calculateWeight()
public double[] getWeights()
public void setWeights(double[] weights)
public double getWeight()
public void setWeight(int index, double weight)
public double popWeight()
public void pushWeight(double w)
w
- public double shiftWeight()
public void unshiftWeight(double w)
w
- public double getDistance()
public void apply(CoordinateTransform t)
CoordinateTransform
to p1
, update distance.t
- public void apply(CoordinateTransform t, double amount)
CoordinateTransform
to p1
with a given amount,
update distance.t
- amount
- public static void apply(Collection<? extends PointMatch> matches, CoordinateTransform t)
matches
- t
- public static final void flip(Collection<PointMatch> matches, Collection<PointMatch> flippedMatches)
PointMatches
from
matches symmetrically and fill
flippedMatches with them, weights remain
unchanged.matches
- original setflippedMatches
- result setpublic static final Collection<PointMatch> flip(Collection<PointMatch> matches)
matches
- public static final void sourcePoints(Collection<PointMatch> matches, Collection<Point> sourcePoints)
public static final void cloneSourcePoints(Collection<PointMatch> matches, Collection<Point> sourcePoints)
public static final void targetPoints(Collection<PointMatch> matches, Collection<Point> targetPoints)
public static final void cloneTargetPoints(Collection<PointMatch> matches, Collection<Point> targetPoints)
public static double meanDistance(Collection<PointMatch> matches)
public static double maxDistance(Collection<PointMatch> matches)
Copyright © 2015–2021 Fiji. All rights reserved.