Exemplo n.º 1
0
 def __init__(self, contour):
     self.original = contour
     self.w = whitener(contour)
     self.white = htrans(self.w, contour)
     self.z0 = col(normalizeStart(spectralFeat(self.white, wmax)))
     self.gno = GNModelP(contour, wmax)
     self.gnw = GNModelP(self.white, wmax)
Exemplo n.º 2
0
def cameraOutline2(M, sc = 0.3):

    K,R,C = sepcam(M)
    
    # formamos una transformación 3D para mover la cámara en el origen a la posición de M
    rt = jr(jc(R, -R @ col(C)),
            row(0,0,0,1))
    
    x = 1;
    y = x;
    z = 0.99;
    
    ps =[x,    0,    z,
         (-x), 0,    z,
         0,    0,    z,
         0,    1.3*y,z,
         0,    (-y), z,
         x,    (-y), z,
         x,    y,    z,
         (-x), y,    z,
         (-x), (-y), z,
         x,    (-y), z,
         x,    y,    z,
         0,    y,    z,
         0,    0,    z,
         0,    0,    0,
         1,    1,    z,
         0,    0,    0,
         (-1), 1,    z,
         0,    0,    0,
         (-1), (-1), z,
         0,    0,    0,
         (1), (-1),  z,
         0,    0,    0,
         0,    0,    (2*x)]
    
    ps = np.array(ps).reshape(-1,3)
    return htrans(la.inv(rt), sc * ps)
Exemplo n.º 3
0
def cameraTransf(M):
    K, R, C = sepcam(M)
    rt = jr(jc(R, -R @ col(C)), row(0, 0, 0, 1))
    return la.inv(rt)
Exemplo n.º 4
0
def cameraTransf(p):
    return jr(jc(p.R, col(p.t)), row(0, 0, 0, 1))
Exemplo n.º 5
0
def cameraTransf2(M):
    K, R, C = sepcam(M)
    rt = jr(jc(R, -R @ col(C)), row(0, 0, 0, 1))
    return rt
Exemplo n.º 6
0
 def __init__(self, contour):
     self.original = contour
     self.w = whitener(contour)
     self.white = htrans(self.w, contour)
     f0 = normalizeStart(spectralFeat(self.white, wmax))
     self.z0s = col(f0) * rotator