vggt icon indicating copy to clipboard operation
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.

Open tangdong1994 opened this issue 7 months ago • 1 comments

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

tangdong1994 avatar May 27 '25 06:05 tangdong1994

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:])

jytime avatar May 30 '25 12:05 jytime