A core technique in 3D computer vision is synthesizing how a scene would look from a different camera viewpoint, given a single source image and its per-pixel depth map. This is known as novel view synthesis via depth reprojection.
The idea is: if you know the depth at every pixel, you can lift each pixel into 3D space, apply a rigid camera transformation, and project the 3D point onto a new image plane.
Implement the function novel_view_synthesis(source_image, depth_map, K_src, K_tgt, R, t) that:
(H, W, C), a depth map of shape (H, W), source and target camera intrinsic matrices K_src and K_tgt (both 3x3), a rotation matrix R (3x3), and a translation vector t (3,).(u, v) with positive depth d:
R and tK_tgt(H, W, C) as a float array initialized to zeros.Use int(round(...)) for converting projected floating-point coordinates to integer pixel positions.