feat(cli): add depth verify/refine outputs and tests
- Retrieve depth + confidence measures from SVOReader when depth enabled - Compute depth residual metrics and attach to output JSON - Optionally write per-corner residual CSV via --report-csv - Post-process refinement: optimize final pose and report pre/post metrics - Add unit tests for depth verification and refinement modules - Add basedpyright dev dependency for diagnostics
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import numpy as np
|
||||
from typing import Dict, Tuple, Optional
|
||||
from typing import Dict, Tuple
|
||||
from scipy.optimize import minimize
|
||||
from .pose_math import rvec_tvec_to_matrix, matrix_to_rvec_tvec
|
||||
from .depth_verify import compute_depth_residual
|
||||
@@ -44,7 +44,7 @@ def depth_residual_objective(
|
||||
translation_diff = np.linalg.norm(param_diff[3:])
|
||||
regularization = regularization_weight * (rotation_diff + translation_diff)
|
||||
|
||||
return data_term + regularization
|
||||
return float(np.real(data_term + regularization))
|
||||
|
||||
|
||||
def refine_extrinsics_with_depth(
|
||||
@@ -55,7 +55,7 @@ def refine_extrinsics_with_depth(
|
||||
max_translation_m: float = 0.05,
|
||||
max_rotation_deg: float = 5.0,
|
||||
regularization_weight: float = 0.1,
|
||||
) -> Tuple[np.ndarray, dict]:
|
||||
) -> Tuple[np.ndarray, dict[str, float]]:
|
||||
initial_params = extrinsics_to_params(T_initial)
|
||||
|
||||
max_rotation_rad = np.deg2rad(max_rotation_deg)
|
||||
|
||||
Reference in New Issue
Block a user