Esempio n. 1
0
def fit_ThinPlateSpline_RotReg(x_na, y_ng, bend_coef = .1, rot_coefs = (0.01,0.01,0.0025),scale_coef=.01):
    import fastrapp
    f = ThinPlateSpline()
    rfunc = fastrapp.rot_reg
    fastrapp.set_coeffs(rot_coefs, scale_coef)
    f.lin_ag, f.trans_g, f.w_ng = tps_fit_regrot(x_na, y_ng, bend_coef, rfunc)
    f.x_na = x_na
    return f        
Esempio n. 2
0
 def fit(self, x_na, y_ng, wt_n=None, verbose=True, bend_coef=.1, rot_coef=None):
     """
     x_nd: source cloud
     y_nd: target cloud
     wt_n: weight the points        
     """        
     self.n, self.d = n,d = x_na.shape
     l_init = self.lin_ag if hasattr(self, "lin_ag") else None
     self.lin_ag, self.trans_g, self.w_ng = tps.tps_fit_regrot(x_na, y_ng, bend_coef, self.regfunc, wt_n, l_init = l_init, max_iter = self.n_fit_iters, rgrad = self.reggrad)
     self.x_na = x_na        
Esempio n. 3
0
def fit_ThinPlateSpline_RotReg(x_na,
                               y_ng,
                               bend_coef=.1,
                               rot_coefs=(0.01, 0.01, 0.0025),
                               scale_coef=.01):
    import fastrapp
    f = ThinPlateSpline()
    rfunc = fastrapp.rot_reg
    fastrapp.set_coeffs(rot_coefs, scale_coef)
    f.lin_ag, f.trans_g, f.w_ng = tps_fit_regrot(x_na, y_ng, bend_coef, rfunc)
    f.x_na = x_na
    return f
Esempio n. 4
0
 def fit(self,
         x_na,
         y_ng,
         wt_n=None,
         verbose=True,
         bend_coef=.1,
         rot_coef=None):
     """
     x_nd: source cloud
     y_nd: target cloud
     wt_n: weight the points        
     """
     self.n, self.d = n, d = x_na.shape
     l_init = self.lin_ag if hasattr(self, "lin_ag") else None
     self.lin_ag, self.trans_g, self.w_ng = tps.tps_fit_regrot(
         x_na,
         y_ng,
         bend_coef,
         self.regfunc,
         wt_n,
         l_init=l_init,
         max_iter=self.n_fit_iters,
         rgrad=self.reggrad)
     self.x_na = x_na