예제 #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)
예제 #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)
예제 #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)
예제 #4
0
def cameraTransf(p):
    return jr(jc(p.R, col(p.t)), row(0, 0, 0, 1))
예제 #5
0
def cameraTransf2(M):
    K, R, C = sepcam(M)
    rt = jr(jc(R, -R @ col(C)), row(0, 0, 0, 1))
    return rt
예제 #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