depth generator fixed at absent values

This commit is contained in:
Rostislav Vasilikhin 2022-06-29 23:45:33 +02:00
parent 6b2d1033bd
commit 44c0b58258

View File

@ -49,6 +49,7 @@ def reprojectRtProject(image, K, depthFactor, rmat, tmat):
v = K @ (rmat @ Kinv @ np.array([x*z, y*z, z]).T + tmat[:, 0]) v = K @ (rmat @ Kinv @ np.array([x*z, y*z, z]).T + tmat[:, 0])
if z > 0:
projected[y, x, :] = v[:] projected[y, x, :] = v[:]
return projected return projected
@ -105,6 +106,6 @@ def outFile(path, ptsimg):
outObj = False outObj = False
if outObj: if outObj:
objdir = "/path/to/objdir/" objdir = "/path/to/objdir/"
outFile(objdir + "reproj_rot_proj.obj", reproject(im2, depthFactor, K)) outFile(objdir + "reproj_rot_proj.obj", reproject(dstDepth, depthFactor, K))
outFile(objdir + "rotated.obj", reprojectRt(srcDepth, K, depthFactor, rmat, tmat)) outFile(objdir + "rotated.obj", reprojectRt(srcDepth, K, depthFactor, rmat, tmat))