MCPcopy Create free account
hub / github.com/MotrixLab/ADHMR / pixel2cam_batch

Function pixel2cam_batch

ADHMR/lib/utils/pose_utils.py:300–305  ·  view source on GitHub ↗
(pixel_coord, f, c)

Source from the content-addressed store, hash-verified

298 return cam_coord
299
300def pixel2cam_batch(pixel_coord, f, c):
301 cam_coord = torch.zeros_like(pixel_coord).to(pixel_coord.device)
302 cam_coord[:,:,0] = (pixel_coord[:,:,0] - c[:,0].unsqueeze(1)) / f[:,0].unsqueeze(1) * pixel_coord[:,:, 2]
303 cam_coord[:,:,1] = (pixel_coord[:,:,1] - c[:,1].unsqueeze(1)) / f[:,1].unsqueeze(1) * pixel_coord[:,:, 2]
304 cam_coord[:,:,2] = pixel_coord[:,:, 2]
305 return cam_coord
306
307def cam2pixel_batch(cam_coord, f, c):
308 img_coord = torch.zeros_like(cam_coord).to(cam_coord.device)

Callers 1

process_outputFunction · 0.70

Calls 1

toMethod · 0.45

Tested by

no test coverage detected