Implementation:Datajuicer Data juicer VideoCameraCalibrationStaticDeepcalibMapper
| Knowledge Sources | |
|---|---|
| Domains | Data_Processing, Mapping |
| Last Updated | 2026-02-14 16:00 GMT |
Overview
Concrete tool for static camera calibration using DeepCalib provided by Data-Juicer.
Description
VideoCameraCalibrationStaticDeepcalibMapper is a mapper operator that computes camera intrinsics and field of view (FOV) for a static camera from video frames using the DeepCalib deep learning model. It extracts frames uniformly from videos, preprocesses them with Keras/ImageNet utilities, runs them through a DeepCalib regression model loaded from a .h5 weights file via TensorFlow/Keras, and stores the estimated camera calibration parameters in the sample metadata, with optional JSON output.
Usage
Use when you need automated camera calibration from video data to obtain intrinsic parameters for 3D reconstruction, undistortion, and other geometric video processing tasks.
Code Reference
Source Location
- Repository: Datajuicer_Data_juicer
- File: data_juicer/ops/mapper/video_camera_calibration_static_deepcalib_mapper.py
Signature
@OPERATORS.register_module("video_camera_calibration_static_deepcalib_mapper")
class VideoCameraCalibrationStaticDeepcalibMapper(Mapper):
def __init__(self, model_path: str = "weights_10_0.02.h5", frame_num: PositiveInt = 3, duration: float = 0, tag_field_name: str = MetaKeys.static_camera_calibration_deepcalib_tags, frame_dir: str = DATA_JUICER_ASSETS_CACHE, if_output_info: bool = True, output_info_dir: str = DATA_JUICER_ASSETS_CACHE, *args, **kwargs):
Import
from data_juicer.ops.mapper.video_camera_calibration_static_deepcalib_mapper import VideoCameraCalibrationStaticDeepcalibMapper
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| model_path | str | No | Path to the DeepCalib regression model weights (default: "weights_10_0.02.h5") |
| frame_num | PositiveInt | No | Number of frames to extract uniformly (default: 3) |
| duration | float | No | Duration of each segment in seconds; 0 for entire video (default: 0) |
| tag_field_name | str | No | Field name to store tags (default: "static_camera_calibration_deepcalib_tags") |
| frame_dir | str | No | Output directory for extracted frames |
| if_output_info | bool | No | Whether to save camera parameters to JSON (default: True) |
| output_info_dir | str | No | Output directory for saving camera parameters JSON |
Outputs
| Name | Type | Description |
|---|---|---|
| samples | Dict | Transformed samples with camera intrinsics, distortion coefficients, and FOV metadata |
Usage Examples
process:
- video_camera_calibration_static_deepcalib_mapper:
model_path: "weights_10_0.02.h5"
frame_num: 5
if_output_info: true