"""Metric Refinement schemas (Component F09).""" from typing import Optional import numpy as np from pydantic import BaseModel from gps_denied.schemas import GPSPoint class AlignmentResult(BaseModel): """Result of aligning a UAV image to a single satellite tile.""" model_config = {"arbitrary_types_allowed": True} matched: bool homography: np.ndarray # (3, 3) gps_center: GPSPoint confidence: float inlier_count: int total_correspondences: int reprojection_error: float # Mean error in pixels class Sim3Transform(BaseModel): """Sim(3) transformation: scale, rotation, translation.""" model_config = {"arbitrary_types_allowed": True} translation: np.ndarray # (3,) rotation: np.ndarray # (3, 3) rotation matrix scale: float class ChunkAlignmentResult(BaseModel): """Result of aligning a chunk array of UAV images to a satellite tile.""" model_config = {"arbitrary_types_allowed": True} matched: bool chunk_id: str chunk_center_gps: GPSPoint rotation_angle: float confidence: float inlier_count: int transform: Sim3Transform reprojection_error: float class LiteSAMConfig(BaseModel): """Configuration for LiteSAM alignment.""" model_path: str = "mock_path" confidence_threshold: float = 0.7 min_inliers: int = 15 max_reprojection_error: float = 2.0 # pixels multi_scale_levels: int = 3 chunk_min_inliers: int = 30