Curve Registration#
statistic calculation for SRVF (curves) open and closed using Karcher Mean and Variance
moduleauthor:: J. Derek Tucker <jdtuck@sandia.gov>
- class curve_stats.fdacurve(beta, mode='O', N=200, scale=False)[source]#
This class provides alignment methods for open and closed curves using the SRVF framework
Usage: obj = fdacurve(beta, mode, N, scale) :param beta: numpy ndarray of shape (n, M, N) describing N curves in R^M :param mode: Open (‘O’) or closed curve (‘C’) (default ‘O’) :param N: resample curve to N points :param scale: scale curve to length 1 (true/false) :param q: (n,T,K) matrix defining n dimensional srvf on T samples with K srvfs :param betan: aligned curves :param qn: aligned srvfs :param basis: calculated basis :param beta_mean: karcher mean curve :param q_mean: karcher mean srvf :param gams: warping functions :param v: shooting vectors :param C: karcher covariance :param s: pca singular values :param U: pca singular vectors :param coef: pca coefficients :param pca principal directions :param qun: cost function :param lambda: lambda :param samples: random samples :param gamr: random warping functions :param cent: center :param scale: scale :param len: length of curve :param len_q: length of srvf :param mean_scale mean length :param mean_scale_q mean length srvf :param E: energy
Author : J. D. Tucker (JDT) <jdtuck AT sandia.gov> Date : 26-Aug-2020
- karcher_mean(rotation=True, parallel=False, lam=0.0, cores=-1, method='DP')[source]#
This calculates the mean of a set of curves :param rotation: compute optimal rotation (default = T) :param parallel: run in parallel (default = F) :param lam: controls the elasticity (default = 0) :param cores: number of cores for parallel (default = -1 (all)) :param method: method to apply optimization (default=”DP”) options are “DP” or “RBFGS”
- plot(multivariate=False)[source]#
plot curve mean results
- Parameters:
multivariate – plot as multivariate functions instead of curves (default=False)
- sample_shapes(no=3, numSamp=10)[source]#
Computes sample shapes from mean and covariance
- Parameters:
no – number of direction (default 3)
numSamp – number of samples (default 10)
- shape_pca(no=10)[source]#
Computes principal direction of variation specified by no. N is Number of shapes away from mean. Creates 2*N+1 shape sequence
- Parameters:
no – number of direction (default 3)
- srvf_align(rotation=True, lam=0.0, parallel=False, cores=-1, method='DP')[source]#
This aligns a set of curves to the mean and computes mean if not computed :param rotation: compute optimal rotation (default = T) :param lam: controls the elasticity (default = 0) :param parallel: run in parallel (default = F) :param cores: number of cores for parallel (default = -1 (all)) :param method: method to apply optimization (default=”DP”) options are “DP” or “RBFGS”