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