video_camera_calibration_static_deepcalib_mapper#

Compute the camera intrinsics and field of view (FOV) for a static camera using DeepCalib.

使用 DeepCalib 计算静态相机的内参和视场角(FOV)。

Type 算子类型: mapper

Tags 标签: gpu, video

🔧 Parameter Configuration 参数配置#

name 参数名

type 类型

default 默认值

desc 说明

model_path

<class ‘str’>

'weights_10_0.02.h5'

The path to the DeepCalib Regression model.

frame_num

typing.Annotated[int, Gt(gt=0)]

3

The number of frames to be extracted uniformly from the video. If it’s 1, only the middle frame will be extracted. If it’s 2, only the first and the last frames will be extracted. If it’s larger than 2, in addition to the first and the last frames, other frames will be extracted uniformly within the video duration. If “duration” > 0, frame_num is the number of frames per segment.

duration

<class ‘float’>

0

The duration of each segment in seconds. If 0, frames are extracted from the entire video. If duration > 0, the video is segmented into multiple segments based on duration, and frames are extracted from each segment.

tag_field_name

<class ‘str’>

'static_camera_calibration_deepcalib_tags'

The field name to store the tags. It’s “static_camera_calibration_deepcalib_tags” in default.

frame_dir

<class ‘str’>

DATA_JUICER_ASSETS_CACHE

Output directory to save extracted frames.

if_output_info

<class ‘bool’>

True

Whether to save the camera parameters results to an JSON file.

output_info_dir

<class ‘str’>

DATA_JUICER_ASSETS_CACHE

Output directory for saving camera parameters.

args

''

extra args

kwargs

''

extra args

📊 Effect demonstration 效果演示#

test#

VideoCameraCalibrationStaticDeepcalibMapper(model_path='weights_10_0.02.h5', frame_num=1, duration=1, frame_dir=DATA_JUICER_ASSETS_CACHE, if_output_info=True, output_info_dir=DATA_JUICER_ASSETS_CACHE)

📥 input data 输入数据#

Sample 1: 1 video
video3.mp4:
Sample 2: 1 video
video4.mp4:
Sample 3: 1 video
video12.mp4:

📤 output data 输出数据#

Sample 1: empty
frame_names_shape
[49]
intrinsics_list_shape
[49, 3, 3]
xi_list_shape
[49]
hfov_list_shape
[49]
vfov_list_shape
[49]
Sample 2: empty
frame_names_shape
[22]
intrinsics_list_shape
[22, 3, 3]
xi_list_shape
[22]
hfov_list_shape
[22]
vfov_list_shape
[22]
Sample 3: empty
frame_names_shape
[3]
intrinsics_list_shape
[3, 3, 3]
xi_list_shape
[3]
hfov_list_shape
[3]
vfov_list_shape
[3]

test_mul_proc#

VideoCameraCalibrationStaticDeepcalibMapper(model_path='weights_10_0.02.h5', frame_num=1, duration=1, frame_dir=DATA_JUICER_ASSETS_CACHE, if_output_info=True, output_info_dir=DATA_JUICER_ASSETS_CACHE)

📥 input data 输入数据#

Sample 1: 1 video
video3.mp4:
Sample 2: 1 video
video4.mp4:
Sample 3: 1 video
video12.mp4:

📤 output data 输出数据#

Sample 1: empty
frame_names_shape
[49]
intrinsics_list_shape
[49, 3, 3]
xi_list_shape
[49]
hfov_list_shape
[49]
vfov_list_shape
[49]
Sample 2: empty
frame_names_shape
[22]
intrinsics_list_shape
[22, 3, 3]
xi_list_shape
[22]
hfov_list_shape
[22]
vfov_list_shape
[22]
Sample 3: empty
frame_names_shape
[3]
intrinsics_list_shape
[3, 3, 3]
xi_list_shape
[3]
hfov_list_shape
[3]
vfov_list_shape
[3]