This commit is contained in:
Ankle committed 2026-09-10 17:06:56 +08:00
1 parent 714a2e1db2
commit f7a782dcef
5 files changed
+584 -73

No files matched your search

+13 -1
View File
@@ -525,7 +525,19 @@ def command_generate(args: argparse.Namespace) -> None:
f"相位响应={phase_response:.2f});"
f"请在纹理丰富且尽量远离摄像头的位置重新执行calibrate {axis}"
)
zoom = round((int(top_left["zoom"]) + int(bottom_right["zoom"])) / 2)
arithmetic_zoom = (int(top_left["zoom"]) + int(bottom_right["zoom"])) / 2
# The interactive wizard records the exact camera-reported zoom used for
# FOV measurement. Prefer it because many PTZ cameras expose quantized zoom
# positions and cannot reach the arithmetic mean exactly.
try:
zoom = int(state["scan_zoom"])
except (KeyError, TypeError, ValueError):
zoom = round(arithmetic_zoom)
if "scan_zoom" in state and zoom < math.ceil(arithmetic_zoom):
fail(
f"保存的scan_zoom={zoom}小于两个角点平均值{arithmetic_zoom:g};"
"请重新执行交互向导第四步"
)
pan_start, pan_end, pan_span, visual_pan_direction = scan_pan_range(
int(top_left["pan"]),
int(bottom_right["pan"]),