PPaste!

BinocularStereo

Home - All the pastes - Authored by Thooms

Raw version

1
2
3
4
5
6
7
8
XYZ = np.zeros([32,3])
for i in range(32):
    A = [[M1[0] - uv_center[i,0]*M1[8], M1[1] - uv_center[i,0]*M1[9], M1[2] - uv_center[i,0]*M1[10]], 
        [M1[4] - uv_center[i,1]*M1[8], M1[5] - uv_center[i,1]*M1[9], M1[6] - uv_center[i,1]*M1[10]], 
        [M2[0] - uv_left[i,0]*M2[8], M2[1] - uv_left[i,0]*M2[9], M2[2] - uv_left[i,0]*M2[10]], 
        [M2[4] - uv_left[i,1]*M2[8], M2[5] - uv_left[i,1]*M2[9], M2[6] - uv_left[i,1]*M2[10]]] 
    tB = [M1[11]*uv_center[i,0] - M1[3], M1[11]*uv_center[i,1] - M1[7], M2[11]*uv_left[i,0] - M2[3], M2[11]*uv_left[i,1] - M2[7]]
    XYZ[i] = linalg.pinv(A).dot(tB)