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

Function cam2pixel_batch

ADHMR/lib/utils/pose_utils.py:307–312  ·  view source on GitHub ↗
(cam_coord, f, c)

Source from the content-addressed store, hash-verified

305 return cam_coord
306
307def cam2pixel_batch(cam_coord, f, c):
308 img_coord = torch.zeros_like(cam_coord).to(cam_coord.device)
309 img_coord[:,:,0] = cam_coord[:,:, 0] / (cam_coord[:,:, 2] + 1e-8) * f[:,0].unsqueeze(1) + c[:,0].unsqueeze(1)
310 img_coord[:,:,1] = cam_coord[:,:, 1] / (cam_coord[:,:, 2] + 1e-8) * f[:,1].unsqueeze(1) + c[:,1].unsqueeze(1)
311 img_coord[:,:,2] = cam_coord[:,:, 2]
312 return img_coord
313
314def pixel2cam_matrix(pixel_coord, intrinsic_param):
315

Callers 1

process_outputFunction · 0.70

Calls 1

toMethod · 0.45

Tested by

no test coverage detected