vggt
vggt copied to clipboard
Can I extract the intrinsic and extrinsic parameters of the camera frame by frame from a video? I don't need point cloud data.
Can I extract the intrinsic and extrinsic parameters of the camera frame by frame from a video? I don't need point cloud data. Cause the length of video is long,I wanna to process the video frame by frame
Hi,
If you only want intrinsic and extrinsic parameters, you can just do:
with torch.no_grad():
with torch.cuda.amp.autocast(dtype=dtype):
images = images[None] # add batch dimension
aggregated_tokens_list, ps_idx = model.aggregator(images)
# Predict Cameras
pose_enc = model.camera_head(aggregated_tokens_list)[-1]
# Extrinsic and intrinsic matrices, following OpenCV convention (camera from world)
extrinsic, intrinsic = pose_encoding_to_extri_intri(pose_enc, images.shape[-2:])