fix: align calibration convention metadata and remove conversion path
This commit is contained in:
@@ -383,9 +383,9 @@ def apply_depth_verify_refine_postprocess(
|
||||
results[str(serial)]["depth_pool"] = pool_metadata
|
||||
|
||||
improvement = verify_res.rmse - verify_res_post.rmse
|
||||
results[str(serial)]["refine_depth"][
|
||||
"improvement_rmse"
|
||||
] = improvement
|
||||
results[str(serial)]["refine_depth"]["improvement_rmse"] = (
|
||||
improvement
|
||||
)
|
||||
|
||||
click.echo(
|
||||
f"Camera {serial} refined: RMSE={verify_res_post.rmse:.3f}m "
|
||||
@@ -1116,18 +1116,47 @@ def main(
|
||||
)
|
||||
|
||||
if ground_normal is not None:
|
||||
R_align: Mat33 = rotation_align_vectors(ground_normal, np.array([0, 1, 0]))
|
||||
logger.info(f"Computed alignment rotation for face '{target_face}'")
|
||||
target_axis = np.array([0, -1, 0])
|
||||
R_align: Mat33 = rotation_align_vectors(ground_normal, target_axis)
|
||||
logger.info(
|
||||
f"Computed alignment rotation for face '{target_face}' to target {target_axis}"
|
||||
)
|
||||
|
||||
alignment_meta = {
|
||||
"target_face": target_face,
|
||||
"ground_normal_before": ground_normal.tolist(),
|
||||
"target_axis": target_axis.tolist(),
|
||||
"alignment_rotation": R_align.flatten().tolist(),
|
||||
}
|
||||
|
||||
for serial, data in results.items():
|
||||
T_mean: Mat44 = np.fromstring(data["pose"], sep=" ").reshape(4, 4)
|
||||
T_aligned = apply_alignment_to_pose(T_mean, R_align)
|
||||
data["pose"] = " ".join(f"{x:.6f}" for x in T_aligned.flatten())
|
||||
logger.debug(f"Applied alignment to camera {serial}")
|
||||
|
||||
results["_meta"] = {
|
||||
"pose_convention": "world_from_cam",
|
||||
"frame_convention": "opencv_y_down",
|
||||
"auto_aligned": True,
|
||||
"gravity_direction_world": [0, 1, 0],
|
||||
"alignment": alignment_meta,
|
||||
}
|
||||
else:
|
||||
click.echo(
|
||||
"Warning: Could not determine ground normal. Skipping alignment."
|
||||
)
|
||||
results["_meta"] = {
|
||||
"pose_convention": "world_from_cam",
|
||||
"frame_convention": "opencv_y_down",
|
||||
"auto_aligned": False,
|
||||
}
|
||||
else:
|
||||
results["_meta"] = {
|
||||
"pose_convention": "world_from_cam",
|
||||
"frame_convention": "opencv_y_down",
|
||||
"auto_aligned": False,
|
||||
}
|
||||
|
||||
# 6. Save to JSON
|
||||
with open(output, "w") as f:
|
||||
|
||||
Reference in New Issue
Block a user