I use pytorch3d to construct mesh from a RGB color and a depth image. The mesh construncted seems to be right, but here
are the problems.
when I give a target camera extrinsic as an identity matrix, the rendering image has too much noise but when target camera extrinsic has a slight offset from identity matrix, the noise would be weaken but still exists.
the rendering image lost rightmost column of pixels and lowest row of pixels.
Here is my code of rendering:
`
def cameras_from_opencv_projection_no_ndc(R, tvec, camera_matrix, image_size, device):
Rendering result save as follows:
tgt_img = np.clip(image[0][...,:3].cpu().numpy() * 255, 0, 255) cv2.imwrite("img.png", tgt_img.astype(np.uint8))
Here is my mesh and texture:
Here is when target camera extrinsic equals indentify matrix, rendering result:
You can see promblem 1and 2 I described above.
when target camera extrinsic equals
tgt_pose = np.array([[1.0, 0.0, 0.0, 0.005],
[0.0, 1.0, 0.0, 0.0],
[0.0, 0.0, 1.0, 0.0],
[0.0, 0.0, 0.0, 1.0]], dtype=float), redering result is as follows:
noise is weaken but still exsits if you watch carefully.
So does anyone know how to solve the problem. Thanks a lot!!!!!!!
I use pytorch3d to construct mesh from a RGB color and a depth image. The mesh construncted seems to be right, but here are the problems.
when I give a target camera extrinsic as an identity matrix, the rendering image has too much noise but when target camera extrinsic has a slight offset from identity matrix, the noise would be weaken but still exists.
the rendering image lost rightmost column of pixels and lowest row of pixels.
Here is my code of rendering: ` def cameras_from_opencv_projection_no_ndc(R, tvec, camera_matrix, image_size, device):
`def cameras_from_opencv_projection_no_ndc(R, tvec, camera_matrix, image_size, device):
`def _render_one_mesh(self, mesh, tgt_pose_w2c_N44, tgt_k_N33, height, width, only_zbuf=False, rend_mask=False):
Rendering result save as follows:
tgt_img = np.clip(image[0][...,:3].cpu().numpy() * 255, 0, 255) cv2.imwrite("img.png", tgt_img.astype(np.uint8))
Here is my mesh and texture: Here is when target camera extrinsic equals indentify matrix, rendering result: You can see promblem 1and 2 I described above. when target camera extrinsic equals tgt_pose = np.array([[1.0, 0.0, 0.0, 0.005], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]], dtype=float), redering result is as follows: noise is weaken but still exsits if you watch carefully.
So does anyone know how to solve the problem. Thanks a lot!!!!!!!