From a6505573b9361ce4ab920ddc55f4bc6d86d7dfb4 Mon Sep 17 00:00:00 2001 From: huangxin Date: Tue, 21 Oct 2025 11:14:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20main/README.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main/README.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/main/README.md b/main/README.md index e53edcc..0a6d2d6 100644 --- a/main/README.md +++ b/main/README.md @@ -30,19 +30,21 @@ pip install opencv-python numpy rknnlite 您也可以直接调用 calculate_offset_from_image 函数,以便集成到其他项目中: 示例 1: 仅获取偏移量(不画图) -** + +```bash from calculate_offset import calculate_offset_from_image result = calculate_offset_from_image("your_image_path.jpg", visualize=False) if result['success']: print(f"Offset: DeltaX={result['dx_mm']:+.2f} mm, DeltaY={result['dy_mm']:+.2f} mm") else: print("Error:", result['message']) -** +``` 示例 2: 获取偏移量并保存可视化图 -** + +```bash from calculate_offset import calculate_offset_from_image result = calculate_offset_from_image("your_image_path.jpg", visualize=True) -** +``` 该函数返回一个包含下列字段的字典: @@ -51,4 +53,4 @@ result = calculate_offset_from_image("your_image_path.jpg", visualize=True) dy_mm: 垂直偏移(毫米) cx: 中心点 x 坐标(像素) cy: 中心点 y 坐标(像素) - message: 错误信息或成功提示 + message: 错误信息或成功提示 \ No newline at end of file