ds_msp.rig¶
Multi-camera rig calibration — the N-camera analogue of MC-Calib, extending single-camera
intrinsics (ds_msp.calib) and two-view geometry (ds_msp.mvg) to a full rig. See the
rig calibration guide for the CLI-driven workflow.
ds_msp.rig ¶
Multi-camera rig calibration — the N-camera analogue of MC-Calib.
DS-MSP's single-camera, multi-model intrinsics (calib.bundle) and two-view MVG
(mvg) are extended here to a full rig: many cameras + many planar boards observed
over many frames, fused into one consistent set of extrinsics + intrinsics.
The math is model-agnostic — every routine composes poses and calls a
CameraModel's project / unproject / project_jacobian. So the entire
pipeline works for any of DS-MSP's camera models, exactly as it is in MC-Calib.
BoardObs
dataclass
¶
One planar board seen by one camera in one frame (cf. BoardObs.cpp).
Source code in ds_msp/data/observations.py
Object3D
dataclass
¶
Several planar boards fused into one rigid 3D point cloud (cf. Object3D.cpp).
Source code in ds_msp/data/observations.py
row_of ¶
Look up the row into :attr:pts_3d for a (board_id, corner_id) pair.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
board_id
|
int
|
One of :attr: |
required |
corner_id
|
int
|
Board-local corner id (as detected by the board's own numbering). |
required |
Returns:
| Type | Description |
|---|---|
int
|
Row index into :attr: |
Raises:
| Type | Description |
|---|---|
KeyError
|
If |
Source code in ds_msp/data/observations.py
ObjectObs
dataclass
¶
One fused object seen by one camera in one frame (cf. Object3DObs.cpp).
Source code in ds_msp/data/observations.py
RigState
dataclass
¶
The optimization variable mutated by the staged global BA (rig.bundle).
Source code in ds_msp/data/observations.py
calibrate_rig ¶
calibrate_rig(obj: Object3D, object_obs: List[ObjectObs], img_size: Dict[int, Tuple[int, int]], *, fix_intrinsics: bool = False, verbose: bool = False, front_end: Optional[Callable] = None, he_approach: int = 0, refine_structure: bool = False, structure_rounds: int = 6, gnc_iters: int = 5, gnc_start: float = 4.0, noise_bound: Optional[float] = None, on_iter=None, objects: Optional[List[Object3D]] = None, reproj_gate_px: Optional[float] = None) -> RigState
Calibrate a multi-camera rig from fused-object observations.
Returns a :class:RigState with per-camera intrinsics, T_c_g extrinsics
(reference camera = identity), and per-frame object poses.
noise_bound (per-corner reprojection σ in pixels) makes the global joint BA run the
median-free GNC-TLS solver (barc = 3.03·σ inlier band), which rejects gross-outlier
corners past the 50% breakdown of the MAD auto-scale; the cheaper stages (group refine,
structure polish) stay on the legacy reweighting so the cost stays bounded. The per-frame
pose seed (:func:_gated_pnp) always uses a high-breakdown RANSAC PnP. This low-level
primitive defaults to None (legacy path); the config-driven product entry
:func:~ds_msp.rig.calib_param.calibrate_from_config supplies a noise_bound (config
default 1.0 px) so a real calibration is robust by default.
on_iter(it, max_iter, rms, cost, rig_snapshot) — optional live-progress callback,
forwarded to every stage's underlying solver (:func:bundle.refine / core.optimize.lm_solve /
schur_lm); fires once per solver iteration across every stage in sequence.
Source code in ds_msp/rig/calibrate.py
552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 | |
load_camera ¶
Read one camera's calibrated intrinsics back into a ready CameraModel instance --
the ds_msp.io.mccalib analogue of :func:ds_msp.io.kalibr.load_kalibr.
Needs camera_model (or the legacy distortion_type/disto_type int) to be
present in the file to know which model to reconstruct -- see :func:_camera_model_field.
Unlike Kalibr's single-camera camchain, one MC-Calib file holds every camera in the rig,
so this takes the 0-based cam_id (matching camera_<cam_id> in the file, the same
indexing :func:save_mccalib_cameras writes).