This commit is contained in:
i
2026-04-21 21:37:43 +08:00
parent 9eddab636f
commit 081de766cb
+22 -1
View File
@@ -622,7 +622,10 @@ class FetchParamsWorker(QThread):
pass pass
params["device"] = {"serial_number": sn} params["device"] = {"serial_number": sn}
tmp = Path(tempfile.gettempdir()) / f"orbbec_params_{sn}_{params['color']['width']}x{params['color']['height']}.json" tmp = Path(tempfile.gettempdir()) / (
f"SN{sn}_RGB{params['color']['width']}x{params['color']['height']}@{params['color']['fps']}"
f"_D{params['depth']['width']}x{params['depth']['height']}@{params['depth']['fps']}.json"
)
tmp.write_text(json.dumps(params, indent=2, ensure_ascii=False), encoding="utf-8") tmp.write_text(json.dumps(params, indent=2, ensure_ascii=False), encoding="utf-8")
self.params_ready.emit(params, str(tmp)) self.params_ready.emit(params, str(tmp))
except Exception as exc: except Exception as exc:
@@ -1277,6 +1280,24 @@ class MainWindow(QMainWindow):
f"[参数获取] RGB {params['color']['width']}x{params['color']['height']} " f"[参数获取] RGB {params['color']['width']}x{params['color']['height']} "
f"/ Depth {params['depth']['width']}x{params['depth']['height']}" f"/ Depth {params['depth']['width']}x{params['depth']['height']}"
) )
# 在日志区打印参数详情
c = params["color"]
d = params["depth"]
ci = c["intrinsic"]
di = d["intrinsic"]
ext = params["extrinsic"]
R = np.array(ext["rot"]).reshape(3, 3)
t = np.array(ext["transform"])
self._append_d2c_log("--- Camera Parameters ---")
self._append_d2c_log(f" RGB : {c['width']}x{c['height']} @ {c['fps']}fps {c['format']}")
self._append_d2c_log(f" fx={ci['fx']:.4f} fy={ci['fy']:.4f} cx={ci['cx']:.4f} cy={ci['cy']:.4f}")
self._append_d2c_log(f" Depth : {d['width']}x{d['height']} @ {d['fps']}fps {d['format']}")
self._append_d2c_log(f" fx={di['fx']:.4f} fy={di['fy']:.4f} cx={di['cx']:.4f} cy={di['cy']:.4f}")
self._append_d2c_log(f" scale={d['scale']:.6f} mm/unit")
self._append_d2c_log(f" Extrinsic R : {R[0].tolist()}")
self._append_d2c_log(f" {R[1].tolist()}")
self._append_d2c_log(f" {R[2].tolist()}")
self._append_d2c_log(f" Extrinsic t : {t.tolist()} (mm)")
self._fetch_worker = None self._fetch_worker = None
def _resolve_params_file(self) -> str | None: def _resolve_params_file(self) -> str | None: