ds_msp.adapt¶
Model conversion — re-express a calibrated model's parameters in another camera family. See Convert between models for task recipes and Are two models the same camera? for why this is possible at all.
ds_msp.adapt ¶
Model conversion ("adapter"): convert calibrated params between models.
convert_best ¶
convert_best(source: CameraModel, *, width: int, height: int, candidates: Optional[Sequence[Type[CameraModel]]] = None, target_rms: float = 3.0, n_samples: int = 2000, n_restarts: int = 6, max_fov_deg: Optional[float] = None) -> Tuple[Optional[CameraModel], dict, List[Tuple[Optional[CameraModel], dict]]]
Convert source to the simplest target model meeting target_rms.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
CameraModel
|
The calibrated source model to convert. |
required |
width
|
int
|
Image size for sampling and reporting. |
required |
height
|
int
|
Image size for sampling and reporting. |
required |
candidates
|
sequence of model classes
|
Capability-ordered ladder to try. Defaults to :func: |
None
|
target_rms
|
float
|
Reprojection-RMS tolerance in pixels. The first candidate at or under this value is returned. |
3.0
|
n_samples
|
int
|
Forwarded to :func: |
2000
|
n_restarts
|
int
|
Forwarded to :func: |
2000
|
max_fov_deg
|
int
|
Forwarded to :func: |
2000
|
Returns:
| Type | Description |
|---|---|
(model, report, all_results)
|
|
Source code in ds_msp/adapt/autoselect.py
default_ladder ¶
Capability-ordered target models, simplest (fewest params) first.
Source code in ds_msp/adapt/autoselect.py
reprojection_report ¶
reprojection_report(source, target, width: int, height: int, n_samples: int = 2000, max_fov_deg: Optional[float] = None, gt_params: Optional[ndarray] = None) -> dict
Measure how well target reproduces source over the image.
Returns a dict with rms/max/median pixel error, sample counts, FOV coverage,
and (if gt_params given) parameter error. max_fov_deg restricts the
evaluated region to match a narrower target (e.g. pinhole/RadTan), so the
report reflects the region the target is meant to cover rather than being
dominated by unrepresentable peripheral rays.
Source code in ds_msp/adapt/evaluate.py
sample_image_grid ¶
Regular grid of pixel centers, aspect-ratio preserving (FCA-style).
Returns (M, 2) float64 pixels with M ≈ n_samples.