public class CPD
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_MAX_ITERS |
static boolean |
verbose |
Constructor and Description |
---|
CPD() |
Modifier and Type | Method and Description |
---|---|
static AffineTransform3d |
affine(Point3d[] X,
Point3d[] Y,
double w,
double tol,
int maxIters,
Point3d[] TY)
Uses the affine CPD algorithm to align a set of points
|
static AffineTransform3d |
affine(Point3d[] X,
Point3d[] Y,
double w,
double tol,
int maxIters,
Point3d[] TY,
AffineTransform3d trans,
double[] sigma2Holder)
Uses the affine CPD algorithm to align a set of points
|
static AffineTransform3d |
affine(PolygonalMesh meshRef,
PolygonalMesh meshReg,
double w,
double tol,
int maxIters)
Uses the affine CPD algorithm to align two meshes
|
static Point3d[] |
coherent(Point3d[] X,
Point3d[] Y,
double lambda,
double beta2,
double w,
double tol,
int maxIters)
Uses the coherent CPD algorithm to align a set of points
|
static Point3d[] |
coherent(Point3d[] X,
Point3d[] Y,
double lambda,
double beta2,
double w,
double tol,
int maxIters,
Point3d[] TY)
Uses the coherent CPD algorithm to align a set of points
|
static Point3d[] |
coherent(Point3d[] X,
Point3d[] Y,
double lambda,
double beta2,
double w,
double tol,
int maxIters,
Point3d[] TY,
double[] sigma2Holder)
Uses the coherent CPD algorithm to align a set of points
|
static PolygonalMesh |
coherent(PolygonalMesh meshRef,
PolygonalMesh meshReg,
double lambda,
double beta2,
double w,
double tol,
int maxIters)
Uses the coherent CPD algorithm to align two meshes
|
static PolygonalMesh |
coherent(PolygonalMesh meshRef,
PolygonalMesh meshReg,
double lambda,
double beta2,
double w,
double tol,
int maxIters,
PolygonalMesh out)
Uses the coherent CPD algorithm to align two meshes
|
static Point3d |
computeMean(Point3d[] pnts,
double[] P,
double Np,
Point3d mean)
Compute and return the weighted mean
|
static double |
computeP(Point3d[] X,
Point3d[] TY,
double sigma2,
double w,
double[][] P,
double[] P1,
double[] Pt1)
Computes the CPD probability function P(m|n)
|
static double |
computeP(Point3d[] X,
Point3d[] TY,
double sigma2,
double w,
double[][] P,
double[] P1,
double[] Pt1,
double tol2)
Computes the CPD probability function P(m|n)
|
static double |
computeQ(Point3d[] X,
Point3d[] TY,
double[][] P,
double Np,
double sigma2)
CPD Objective function
|
static double |
computeQ(Point3d[] X,
Point3d[] TY,
double[][] P,
double Np,
double sigma2,
double tol2)
CPD Objective function
|
static double |
computeVariance(Point3d[] X,
Point3d[] TY,
double[][] P,
double Np)
Estimates the CPD variance
|
static ScaledRigidTransform3d |
rigid(Point3d[] X,
Point3d[] Y,
double w,
double tol,
int maxIters,
boolean allowScaling,
Point3d[] TY)
Uses the rigid CPD algorithm to align a set of points
|
static ScaledRigidTransform3d |
rigid(Point3d[] X,
Point3d[] Y,
double w,
double tol,
int maxIters,
boolean allowScaling,
Point3d[] TY,
ScaledRigidTransform3d trans,
double[] sigma2Holder)
Uses the rigid CPD algorithm to align a set of points
|
static ScaledRigidTransform3d |
rigid(PolygonalMesh meshRef,
PolygonalMesh meshReg,
double w,
double tol,
int maxIters,
boolean allowScaling)
Uses the rigid CPD algorithm to align two meshes
|
static void |
transformPoints(Point3d[] Y,
AffineTransform3dBase trans,
Point3d[] TY)
Transforms a set of points
|
static void |
transformPoints(Point3d[] Y,
double s,
Matrix3d R,
Vector3d t,
Point3d[] TY)
Transforms points based on rigid transform
|
static void |
transformPoints(Point3d[] Y,
Matrix3d A,
Vector3d t,
Point3d[] TY)
Transforms points based on affine transform
|
static void |
transformPoints(Point3d[] Y,
MatrixNd G,
MatrixNd W,
Point3d[] TY) |
static void |
transformPoints(Point3d[] Y,
Point3d[] TY)
Transforms a set of points by identity (copies points)
|
public static int DEFAULT_MAX_ITERS
public static boolean verbose
public static ScaledRigidTransform3d rigid(Point3d[] X, Point3d[] Y, double w, double tol, int maxIters, boolean allowScaling, Point3d[] TY, ScaledRigidTransform3d trans, double[] sigma2Holder)
X
- reference input pointsY
- points to registerw
- weight, accounting to noise (w=0 --> no noise)tol
- will iterative until objective function changes by less than thismaxIters
- maximum number of iterationsallowScaling
- whether or not to allow scalingTY
- transformed pointstrans
- initial guess of scaled rigid transformsigma2Holder
- initial guess of variancepublic static double computeP(Point3d[] X, Point3d[] TY, double sigma2, double w, double[][] P, double[] P1, double[] Pt1)
X
- Input pointsTY
- Transformed output pointssigma2
- variancew
- weight to account for noise/outliersP
- MxN probability matrixP1
- Mx1 vector, P*1Pt1
- Nx1 vector, trans(P)*1public static double computeP(Point3d[] X, Point3d[] TY, double sigma2, double w, double[][] P, double[] P1, double[] Pt1, double tol2)
X
- Input pointsTY
- Transformed output pointssigma2
- variancew
- weight to account for noise/outliersP
- MxN probability matrixP1
- Mx1 vector, P*1Pt1
- Nx1 vector, trans(P)*1tol2
- squared point tolerancepublic static double computeQ(Point3d[] X, Point3d[] TY, double[][] P, double Np, double sigma2)
X
- reference pointsTY
- transformed input pointsP
- probability matrixNp
- sum of all probabilitiessigma2
- probability variancepublic static double computeQ(Point3d[] X, Point3d[] TY, double[][] P, double Np, double sigma2, double tol2)
X
- reference pointsTY
- transformed input pointsP
- probability matrixNp
- sum of all probabilitiessigma2
- probability variancetol2
- squared point tolerancepublic static void transformPoints(Point3d[] Y, double s, Matrix3d R, Vector3d t, Point3d[] TY)
Y
- input pointss
- scaleR
- rotationt
- translationTY
- transformed pointspublic static void transformPoints(Point3d[] Y, AffineTransform3dBase trans, Point3d[] TY)
Y
- input pointstrans
- transformTY
- transformed pointspublic static void transformPoints(Point3d[] Y, Point3d[] TY)
Y
- input pointsTY
- transformed pointspublic static void transformPoints(Point3d[] Y, Matrix3d A, Vector3d t, Point3d[] TY)
Y
- input pointsA
- affine transformt
- translationTY
- transformed pointspublic static void transformPoints(Point3d[] Y, MatrixNd G, MatrixNd W, Point3d[] TY)
public static double computeVariance(Point3d[] X, Point3d[] TY, double[][] P, double Np)
X
- N input pointsTY
- M transformed output pointsP
- probability matrix (if null, P(m,n) = 1/M)Np
- Total sum of entries in probability matrixpublic static Point3d computeMean(Point3d[] pnts, double[] P, double Np, Point3d mean)
pnts
- set of pointsP
- vector of probabilitiesNp
- sum of probabilitiesmean
- mean to fill, if null, creates newpublic static ScaledRigidTransform3d rigid(Point3d[] X, Point3d[] Y, double w, double tol, int maxIters, boolean allowScaling, Point3d[] TY)
X
- reference input pointsY
- points to registerw
- weight, accounting to noise (w=0 --> no noise)tol
- will iterative until objective function changes by less than thismaxIters
- maximum number of iterationsallowScaling
- whether or not to allow scalingTY
- transformed pointspublic static ScaledRigidTransform3d rigid(PolygonalMesh meshRef, PolygonalMesh meshReg, double w, double tol, int maxIters, boolean allowScaling)
meshRef
- reference meshmeshReg
- mesh to registerw
- weight, accounting to noise (w=0 --> no noise)tol
- will iterative until objective function changes by less than thismaxIters
- maximum number of iterationsallowScaling
- whether or not to allow scalingpublic static AffineTransform3d affine(Point3d[] X, Point3d[] Y, double w, double tol, int maxIters, Point3d[] TY, AffineTransform3d trans, double[] sigma2Holder)
X
- reference input pointsY
- points to registerw
- weight, accounting to noise (w=0 --> no noise)tol
- will iterative until objective function changes by less than thismaxIters
- maximum number of iterationsTY
- transformed pointstrans
- initial guess of scaled rigid transformsigma2Holder
- initial guess of variancepublic static AffineTransform3d affine(Point3d[] X, Point3d[] Y, double w, double tol, int maxIters, Point3d[] TY)
X
- reference input pointsY
- points to registerw
- weight, accounting to noise (w=0 --> no noise)tol
- will iterative until objective function changes by less than thismaxIters
- maximum number of iterationsTY
- transformed pointspublic static AffineTransform3d affine(PolygonalMesh meshRef, PolygonalMesh meshReg, double w, double tol, int maxIters)
meshRef
- reference meshmeshReg
- mesh to registerw
- weight, accounting to noise (w=0 --> no noise)tol
- will iterative until objective function changes by less than thismaxIters
- maximum number of iterationspublic static Point3d[] coherent(Point3d[] X, Point3d[] Y, double lambda, double beta2, double w, double tol, int maxIters, Point3d[] TY, double[] sigma2Holder)
X
- reference input pointsY
- points to registerlambda
- weight factor for regularization term (> 0)beta2
- coherence factor, beta^2 (> 0)w
- weight, accounting to noise (w=0 --> no noise)tol
- will iterative until objective function changes by less than thismaxIters
- maximum number of iterationsTY
- transformed pointssigma2Holder
- initial variance estimatepublic static Point3d[] coherent(Point3d[] X, Point3d[] Y, double lambda, double beta2, double w, double tol, int maxIters)
X
- reference input pointsY
- points to registerlambda
- weight factor for regularization term (> 0)beta2
- coherence factor, beta^2 (> 0)w
- weight, accounting to noise (w=0 --> no noise)tol
- will iterative until objective function changes by less than thismaxIters
- maximum number of iterationspublic static Point3d[] coherent(Point3d[] X, Point3d[] Y, double lambda, double beta2, double w, double tol, int maxIters, Point3d[] TY)
X
- reference input pointsY
- points to registerlambda
- weight factor for regularization term (> 0)beta2
- coherence factor, beta^2 (> 0)w
- weight, accounting to noise (w=0 --> no noise)tol
- will iterative until objective function changes by less than thismaxIters
- maximum number of iterationsTY
- transformed pointspublic static PolygonalMesh coherent(PolygonalMesh meshRef, PolygonalMesh meshReg, double lambda, double beta2, double w, double tol, int maxIters)
meshRef
- reference meshmeshReg
- mesh to registerlambda
- weight factor for regularization term (> 0)beta2
- coherence factor, beta^2 (> 0)w
- weight, accounting to noise (w=0 --> no noise)tol
- will iterative until objective function changes by less than thismaxIters
- maximum number of iterationspublic static PolygonalMesh coherent(PolygonalMesh meshRef, PolygonalMesh meshReg, double lambda, double beta2, double w, double tol, int maxIters, PolygonalMesh out)
meshRef
- reference meshmeshReg
- mesh to registerlambda
- weight factor for regularization term (> 0)beta2
- coherence factor, beta^2 (> 0)w
- weight, accounting to noise (w=0 --> no noise)tol
- will iterative until objective function changes by less than thismaxIters
- maximum number of iterationsout
- transformed mesh