diff --git a/AppAlgo/stereo_bolt_delivery/ABI_FINGERPRINT.txt b/AppAlgo/stereo_bolt_delivery/ABI_FINGERPRINT.txt index 0ae42067..ee1f77e1 100644 --- a/AppAlgo/stereo_bolt_delivery/ABI_FINGERPRINT.txt +++ b/AppAlgo/stereo_bolt_delivery/ABI_FINGERPRINT.txt @@ -1,17 +1,17 @@ -# ABI fingerprint: RK3588 selected4 release -# generated: 2026-07-10 +# ABI fingerprint: RK3588 mainline selected4 release +# generated: 2026-07-14 [artifacts] lib/libstereo_bolt.so SHA256: - 39517a349fffc1be3da9ce565bbc5b1bde0b131a365a49eec65ec549e5e6d885 -weights/obb_plus_halcon_seg_1024_fp16.rknn SHA256: - 4db0d4b30526a4e71d63fb4c0e6ecb2b735eb756636f79e8b1a1462781cd1e72 + 5e7884a9f68ba389105d2af17f57482f4a15c2953f7845ead636653ae2d0aebd +weights/model_20260713T084621+0000_c732327c.rknn SHA256: + b9ed3b46c416919dc969637a7093cf01312eda91320066e40e33daad56d9f169 [target] ELF 64-bit LSB shared object Machine: ARM AArch64 Minimum glibc: GLIBC_2.35 -Build ID: 14a8822d90f2e5334d2f3ec4c632972047df992d +Build ID: 79fbed2add268e6ceadad58e1e8f93731c844907 [exported C symbols] sb_create @@ -37,8 +37,6 @@ libgcc_s.so.1 libc.so.6 ld-linux-aarch64.so.1 -[ABI note] -StereoBoltParamsC appends selected4 support-plane fields at the tail. -The library uses struct_size to accept the previous shorter struct and fills -new fields with legacy-safe defaults. Output structs and exported function -signatures are unchanged. +[compatibility] +The exported C symbol list is exactly identical to the 2026-07-10 selected4 +delivery. No AI Studio Runtime wrapper library is required or referenced. diff --git a/AppAlgo/stereo_bolt_delivery/CHANGELOG.txt b/AppAlgo/stereo_bolt_delivery/CHANGELOG.txt index 82b47e49..4331eef3 100644 --- a/AppAlgo/stereo_bolt_delivery/CHANGELOG.txt +++ b/AppAlgo/stereo_bolt_delivery/CHANGELOG.txt @@ -1,49 +1,33 @@ -CHANGELOG - libstereo_bolt selected4 delivery -================================================ +CHANGELOG - libstereo_bolt mainline delivery +============================================= -## 2026-07-10 selected4-v2 +2026-07-14 mainline-selected4-v3 +--------------------------------- +- Promoted the selected4 axial top-to-support-plane measurement route to the + default product path. +- Removed the AI Studio Runtime wrapper route. Windows uses OpenCV DNN directly; + RK3588 uses RKNN Runtime directly. +- Switched the mainline ONNX/RKNN model to model_20260713T084621+0000_c732327c + with a 0.50 confidence threshold. +- Kept the published C ABI unchanged. The new and 2026-07-10 libraries export + the exact same nine sb_* symbols. +- Windows: 29/29 unit tests passed; all 79 stereo pairs from 7.3 were executed. + Strict precise success was 24/79, complete center/top was 53/79 and ranging + returned a result on 79/79. Acceptance frames 19/20/28/43 all passed 8/8. +- Cross-built for AArch64 with GCC 11, glibc 2.35 contract and standard OpenCV + 4.5 SONAMEs. No platform-wrapper shared object appears in NEEDED. +- RK3588 package-local manifest/dependency check passed. Frames 19/20/28/43 + passed both the YAML file path and explicit-model buffer/ranging path at 8/8; + the captured log ends with PACKAGE_REVERIFY_PASS. -Packaging and acceptance: -- Added the eight original 12 MP BMP files for frames 19, 20, 28 and 43 - under validation/inputs/. -- Added validation/run_selected4.sh for package-local manifest, dependency, - precise-interface and ranging-interface verification on RK3588. -- Updated installation commands so no external sample path is required. -- Added validation/selected4_package_reverify.log captured on RK3588 while - running only the files extracted from this delivery package. -- Added the explicit config/config.rk3588.selected4.top_plane.yaml alias, - SELECTED4_PROVENANCE.txt and an RK3588 c_example_centerline binary. -- The one-click test now exercises both sb_create(YAML) and sb_create_ex(model - bytes) before accepting the package. -- Fixed c_example_centerline to preserve its success return code before freeing - the result structure; its previous post-free check incorrectly returned 3 - after printing a successful eight-bolt result. +2026-07-10 selected4-v2 +----------------------- +- Packaged the original 19/20/28/43 image pairs and a package-local dual-entry + RK3588 acceptance script. +- Exercised both sb_create(YAML) and sb_create_ex(model bytes). -## 2026-07-09 selected4-v1 - -Scope: -- Fixed validation set: frames 19, 20, 28 and 43 from the 7.3 stereo data. -- New RKNN model: obb_plus_halcon_seg_1024_fp16.rknn. -- Precise and ranging interfaces use the same four stereo pairs for acceptance. - -Algorithm and interface: -- Complete cap far/near edge-pair evidence now outranks an isolated one-eye - gradient when selecting the bolt top. -- Cap-pair stereo tolerance scales with bolt width; candidates outside the - original trusted band remain explicitly suspect. -- Plane height is measured along the fitted bolt axis to the support-plane - intersection. The selected4 plane-anchor standard-deviation gate is 20 mm. -- StereoBoltParamsC appends support-plane controls at the tail. struct_size - keeps callers using the previous shorter struct compatible. - -RK3588 acceptance: -- Frames 19/20/28/43: left YOLO=8, right YOLO=8, pairs=8, - precise bolts=8 and ranging bolts=8 for every frame. -- Local WSL tests: 28/28 passed. -- Exact logs and input hashes are under validation/. - -## Historical baseline retained - -- 2026-07-01 v4: precise partial-output contract rejects left-only product heights. +Historical baseline retained +---------------------------- +- 2026-07-09 selected4-v1: selected4 top evidence and support-plane axial height. +- 2026-07-01 v4: precise partial-output contract rejects left-only heights. - 2026-07-01 v3: stable OBB-axis ranging summary and pairing-swap repair. -- 2026-06-30 v2: OBB model route and optional plane-skip optimization. diff --git a/AppAlgo/stereo_bolt_delivery/DELIVERY.md b/AppAlgo/stereo_bolt_delivery/DELIVERY.md index 4a739f58..93ccf8c5 100644 --- a/AppAlgo/stereo_bolt_delivery/DELIVERY.md +++ b/AppAlgo/stereo_bolt_delivery/DELIVERY.md @@ -1,124 +1,107 @@ -# RK3588 四帧优化版交付说明 +# RK3588 螺栓测量主线路交付说明 -## 交付范围 +## 交付定位 -本包是针对 `7.3` 数据集第 19、20、28、43 帧固化的 RK3588/AArch64 版本。 -验收条件为每帧: +本包将原“四组图特化”实现升级为当前主线路。算法高度定义为:螺杆三维顶点沿拟合轴线,到轴线与局部支撑平面交点的距离。 -- 左眼 YOLO OBB = 8 根。 -- 右眼 YOLO OBB = 8 根。 -- 双目配对 = 8 根。 -- 精测接口输出 = 8 根。 -- 测距接口输出 = 8 根。 +推理后端只保留原有两条直接路线: -本包不声称已在其他帧或其他相机装配上完成泛化验收。 +- Windows:OpenCV DNN 直接加载 ONNX。 +- RK3588:RKNN Runtime 直接加载 RKNN。 -## 固定版本 +本包不包含、也不依赖 AI Studio Runtime 平台封装层。公共 C ABI、输出结构和函数签名保持不变。 -- `lib/libstereo_bolt.so` - SHA256: `39517a349fffc1be3da9ce565bbc5b1bde0b131a365a49eec65ec549e5e6d885` -- `weights/obb_plus_halcon_seg_1024_fp16.rknn` - SHA256: `4db0d4b30526a4e71d63fb4c0e6ecb2b735eb756636f79e8b1a1462781cd1e72` -- YOLOv8n OBB, 1 class `bolt`, input `1024x1024`, RKNN FP16 -- 标定:`calib/stereo_calib_20260621_202857_ascii.xml` -- 配置:`config/config.rk3588.12mp.yaml` -- 四帧优化配置:`config/config.rk3588.selected4.top_plane.yaml` - -上述两个配置文件内容完全相同;后者是本版本的规范名称。算法库、配置、模型、 -板端源码哈希及双入口验收关系见 `SELECTED4_PROVENANCE.txt`。 - -## 算法路线 +## 主线算法 ```text stereo rectify --> RKNN YOLO OBB left/right +-> YOLO OBB left/right -> stereo ROI pairing -> 2D bolt centerline and top endpoint -> sparse stereo 3D centerline --> SGBM support-plane fitting +-> local SGBM support-plane fitting -> centerline/plane intersection --> bolt height and adjacent distances +-> axial bolt height and adjacent distances ``` -顶点定义:螺杆中线与顶部端面近侧连续边缘的交点。完整的端面远/近边缘对优先于单眼孤立梯度点; -宽容度候选会标为 `suspect`,不伪装成高置信度。 +主线参数: -高度定义:从三维顶点沿拟合螺杆轴线,到轴线与拟合支撑平面交点的距离。 +- `plane_use_sgbm: true` +- `height_from_plane: true` +- `plane_height_along_axis: true` +- `plane_anchor_max_foot_gap_std_mm: 20.0` +- `plane_sgbm_scale: 0.25` +- `plane_max_samples: 40000` +- YOLO input `1024x1024`, confidence `0.50`, IoU `0.45` -## C ABI +## 固定交付件 -公共头文件只有 `include/stereo_bolt/c_api.h`。主要接口: +- 算法库:`lib/libstereo_bolt.so` + - SHA256 `5e7884a9f68ba389105d2af17f57482f4a15c2953f7845ead636653ae2d0aebd` + - AArch64 Build ID `79fbed2add268e6ceadad58e1e8f93731c844907` +- RKNN 模型:`weights/model_20260713T084621+0000_c732327c.rknn` + - SHA256 `b9ed3b46c416919dc969637a7093cf01312eda91320066e40e33daad56d9f169` +- 配置:`config/config.rk3588.mainline.yaml` + - SHA256 `d9157898f966927b38cbe4d9531baa9ea514c28153001654d1e2d5c2c4ad14de` +- 标定:`calib/stereo_calib_20260621_202857_ascii.xml` + - SHA256 `751e376ef074a4627f95256cac2ba8ea6b96dec2f672689fc5e3cf9b5cb205b4` +- 公共头文件:`include/stereo_bolt/c_api.h` + - SHA256 `61a56da934fe4ed1fb7e98a4d145aeaf1789c56a8494ccc9bec193cf9701c163` -```c -StereoBoltCtx* sb_create_ex(const StereoBoltCalibC*, - const StereoBoltModelC*, - const StereoBoltParamsC*); +## 接口兼容 -sb_status_t sb_process_bolt_module_buffers( - StereoBoltCtx*, - const uint8_t* left, int lw, int lh, int lstride, - const uint8_t* right, int rw, int rh, int rstride, - int channels, int expected_count, StereoBoltModuleResultC* out); - -sb_status_t sb_range_bolt_binned( - StereoBoltCtx*, - const uint8_t* left, int lw, int lh, int lstride, - const uint8_t* right, int rw, int rh, int rstride, - int channels, StereoBoltRangeSummaryC* out, - StereoBoltRangeBoltC* bolts, int max_bolts); -``` - -### `sb_create_ex` 四帧参数 - -```c -StereoBoltParamsC p = sb_default_params(); -p.wd_z_min_mm = 900.0; -p.wd_z_max_mm = 4000.0; -p.plane_use_sgbm = 1; -p.height_from_plane = 1; -p.plane_height_along_axis = 1; -p.plane_anchor_max_foot_gap_std_mm = 20.0; -p.plane_sgbm_scale = 0.25; -p.plane_max_samples = 40000; -``` - -新平面参数均追加在 `StereoBoltParamsC` 尾部。库依据 `struct_size` 兼容旧版较短的输入结构; -旧调用方不会被强制开启平面测高。 - -兼容的文件方式: - -```c -StereoBoltCtx* ctx = sb_create("config/config.rk3588.12mp.yaml"); -``` - -## RK3588 验证结果 - -| 帧 | 左YOLO | 右YOLO | 配对 | 精测 | 测距 | 代表距离/mm | 结果 | -|---:|---:|---:|---:|---:|---:|---:|---| -| 19 | 8 | 8 | 8 | 8 | 8 | 2298.843 | PASS | -| 20 | 8 | 8 | 8 | 8 | 8 | 2286.521 | PASS | -| 28 | 8 | 8 | 8 | 8 | 8 | 2555.266 | PASS | -| 43 | 8 | 8 | 8 | 8 | 8 | 1893.487 | PASS | - -使用本包内图像和一键脚本得到的完整板端输出: -`validation/selected4_package_reverify.log`。构建目录的原始验收输出另保留为 -`validation/selected4_validation_final.log`。 -四组左右眼原始图像已放入 `validation/inputs/`;文件名、大小和 SHA256 见 -`validation/input_sha256.csv`,也受整包 `MANIFEST_SHA256.txt` 校验保护。 - -## 包内容 +导出的 9 个 C 符号与 `stereo_bolt_delivery_selected4_20260710` 完全一致: ```text -lib/ algorithm and bundled runtime libraries -include/stereo_bolt/c_api.h public C ABI -weights/ selected4 RKNN model -calib/ stereo calibration -config/ selected4 file-based config -example/ minimal C consumer -validation/ board validator, one-click script, logs and four stereo pairs -SELECTED4_PROVENANCE.txt algorithm/config/model provenance and exact hashes -ABI_FINGERPRINT.txt binary ABI and hashes -INSTALL_3588.md install and verification commands +sb_create +sb_create_ex +sb_default_params +sb_destroy +sb_last_error +sb_free_bolt_module_result +sb_process_bolt_module_files +sb_process_bolt_module_buffers +sb_range_bolt_binned ``` -`confidence=0` 为 `trusted`,`confidence=1` 为 `suspect`。调用方必须保留该分级,不应把 `suspect` 改写为高置信度结果。 +生产集成继续使用原接口。`StereoBoltParamsC` 通过 `struct_size` 兼容较短的旧调用方结构;本次没有改变任何已发布函数签名或输出结构布局。 + +## 验证边界 + +Windows 对 `7.3` 全部 79 组图像做了真实执行:测距入口 79/79 找到结果,完整 center/top 53/79,严格精测成功 24/79。选定的 19/20/28/43 四帧均为 8 检测、8 配对、8 精测成功。详细结果见 `validation/WINDOWS_7_3_VALIDATION_SUMMARY.md`。 + +因此,本包对四帧验收集做了完整固定验收,但不能把 24/79 的全量结果表述为已经完成全场景泛化。其余失败主要为数量不符、配对失败和测量失败,仍需要后续数据/算法迭代。 + +RK3588 真机从本包独立解压执行的结果如下;两种入口均为 4/4 PASS: + +| 帧 | 左/右检测 | 配对 | 精测 | 测距 | 显式入口代表距离/mm | +|---:|---:|---:|---:|---:|---:| +| 19 | 8/8 | 8 | 8 | 8 | 2306.606 | +| 20 | 8/8 | 8 | 8 | 8 | 2286.189 | +| 28 | 8/8 | 8 | 8 | 8 | 2554.382 | +| 43 | 8/8 | 8 | 8 | 8 | 1890.147 | + +真机原始输出保存在 `validation/mainline_package_reverify.log`,SHA256 为 `3faf413b9503400f3e89a8928108ec8bba1eb165d5e1160fd353edede74eb810`。 + +板端一键验收脚本同时覆盖: + +1. `sb_create(YAML)` + 文件接口。 +2. `sb_create_ex(model bytes)` + buffer 精测接口 + 测距接口。 +3. 包内 MANIFEST 和动态依赖闭包。 + +本次脚本返回码为 0,末行已出现 `PACKAGE_REVERIFY_PASS`。 + +## 目录 + +```text +lib/ 主算法库、RKNN 与 OpenCV 运行库 +include/stereo_bolt/c_api.h 公共 C ABI +weights/ 主线 RKNN 模型 +calib/ 双目标定 +config/ RK3588 主线配置 +example/ 纯 C 接入示例 +validation/ 双入口验收器、日志和四组原图 +ABI_FINGERPRINT.txt ELF/ABI 指纹 +SELECTED4_PROVENANCE.txt 算法、模型、配置与构建来源 +INSTALL_3588.md 安装和复验命令 +``` diff --git a/AppAlgo/stereo_bolt_delivery/INSTALL_3588.md b/AppAlgo/stereo_bolt_delivery/INSTALL_3588.md index 82224f82..2830ddc5 100644 --- a/AppAlgo/stereo_bolt_delivery/INSTALL_3588.md +++ b/AppAlgo/stereo_bolt_delivery/INSTALL_3588.md @@ -1,73 +1,47 @@ # RK3588 安装与验证 -## 要求 +## 环境 -- CPU: AArch64 RK3588 -- OS: Ubuntu 22.04, glibc >= 2.35 -- NPU 驱动已安装 -- OpenCV 4.5.0 和 `librknnrt.so` 已随包放在 `lib/` +- AArch64 RK3588 +- Ubuntu 22.04 / glibc >= 2.35 +- 可用的 RKNN NPU 驱动 +- 不需要安装系统 OpenCV;标准 SONAME 的 OpenCV 4.5.0 和 `librknnrt.so` 已包含在 `lib/` +- 不需要 AI Studio Runtime ## 解包 ```bash -tar xzf stereo_bolt_delivery_selected4_20260710.tar.gz -cd stereo_bolt_delivery_selected4_20260710 +tar xzf stereo_bolt_delivery_mainline_20260714.tar.gz +cd stereo_bolt_delivery_mainline_20260714 export LD_LIBRARY_PATH="$(pwd)/lib:${LD_LIBRARY_PATH:-}" -chmod +x validation/selected4_delivery_validate validation/run_selected4.sh +chmod +x validation/c_example_centerline \ + validation/selected4_delivery_validate \ + validation/run_selected4.sh ``` -## 依赖检查 +## 完整性与依赖 ```bash -uname -m -# expected: aarch64 - +sha256sum -c MANIFEST_SHA256.txt ldd lib/libstereo_bolt.so | grep "not found" -# expected: no output - -sha256sum lib/libstereo_bolt.so \ - weights/obb_plus_halcon_seg_1024_fp16.rknn +# 第二条命令预期无输出 ``` -期望哈希: +关键文件预期 SHA256: ```text -39517a349fffc1be3da9ce565bbc5b1bde0b131a365a49eec65ec549e5e6d885 lib/libstereo_bolt.so -4db0d4b30526a4e71d63fb4c0e6ecb2b735eb756636f79e8b1a1462781cd1e72 weights/obb_plus_halcon_seg_1024_fp16.rknn +5e7884a9f68ba389105d2af17f57482f4a15c2953f7845ead636653ae2d0aebd lib/libstereo_bolt.so +b9ed3b46c416919dc969637a7093cf01312eda91320066e40e33daad56d9f169 weights/model_20260713T084621+0000_c732327c.rknn +d9157898f966927b38cbe4d9531baa9ea514c28153001654d1e2d5c2c4ad14de config/config.rk3588.mainline.yaml ``` -## 调用 - -生产环境推荐: - -1. 用 `sb_default_params()` 初始化 `StereoBoltParamsC`。 -2. 按 `DELIVERY.md` 设置四帧平面参数。 -3. 用 `sb_create_ex()` 传入标定矩阵、RKNN字节和参数。 -4. 12MP Mono8 原图调用 `sb_process_bolt_module_buffers()`。 -5. 2x2 binned Mono8 图像调用 `sb_range_bolt_binned()`。 -6. 每帧检查返回码、`success/found`、数量与 `confidence`。 - -离线可使用: - -```c -StereoBoltCtx* ctx = sb_create("config/config.rk3588.selected4.top_plane.yaml"); -``` - -要求当前工作目录为解包根目录,使配置中的 `calib/` 和 `weights/` 相对路径可解析。 - ## 四帧板端复验 -一键脚本先用 `validation/c_example_centerline` 验证规范四帧YAML的 `sb_create()` -路径,再用 `validation/selected4_delivery_validate` 验证 `sb_create_ex()`、精测和测距路径; -两者的算法调用都走公共 C ABI。 -四组左右眼原始图像已放在 `validation/inputs/`,文件哈希同时记录于 -`validation/input_sha256.csv` 和整包 `MANIFEST_SHA256.txt`。 - ```bash -validation/run_selected4.sh +bash validation/run_selected4.sh ``` -每帧应出现: +脚本会分别执行 YAML 文件接口和显式模型 buffer 接口,并检查 19、20、28、43 四帧。每帧应包含: ```text PRECISE ... success=1 yolo_left=8 yolo_right=8 pairs=8 bolts=8 @@ -75,5 +49,18 @@ RANGE ... found=1 bolts=8 status=ok VERDICT=PASS ``` -验收程序必须通过本包 `lib/` 中的 `.so` 运行,不应加载系统中的另一份 `libstereo_bolt.so`。 -脚本返回码为 `0` 且最后一行是 `PACKAGE_REVERIFY_PASS` 才表示整包验收通过。 +最终必须出现: + +```text +=== PACKAGE_REVERIFY_PASS === +``` + +## 原接口调用 + +文件入口保持不变: + +```c +StereoBoltCtx* ctx = sb_create("config/config.rk3588.mainline.yaml"); +``` + +生产 buffer 入口仍使用 `sb_create_ex()`、`sb_process_bolt_module_buffers()` 和 `sb_range_bolt_binned()`;调用方只需继续包含 `include/stereo_bolt/c_api.h`。配置中的模型和标定路径均相对于解包根目录解析。 diff --git a/AppAlgo/stereo_bolt_delivery/MANIFEST_SHA256.txt b/AppAlgo/stereo_bolt_delivery/MANIFEST_SHA256.txt index 80844ac4..b30fab78 100644 --- a/AppAlgo/stereo_bolt_delivery/MANIFEST_SHA256.txt +++ b/AppAlgo/stereo_bolt_delivery/MANIFEST_SHA256.txt @@ -1,15 +1,13 @@ -5841f97fbee3588bc46d0be475cadf62daabf70acfe861c8df6b8bb9b457fac0 ABI_FINGERPRINT.txt -ed812399471c2c1175c05464aaeb91af11abefca5518a264eb24a86786e953af CHANGELOG.txt -fcdcf495c25f7061157099fea2910152f9f67f839fd51d295a559e473619437b DELIVERY.md -56f97990ab8cf20da86c70b264b12c5627b32cfe723651376578efebcbe9ba76 DEPENDENCIES.md -33bb0937be783f2640756ea918283259aa6c998e9829459281aedc35b07b43f6 INSTALL_3588.md -be5ee392a1cb23289dd2b78da8fd7db31f27075ca9faa8196e1d0dd7628d5e74 SELECTED4_PROVENANCE.txt +89c6f612e52836a859c85149b07235920605f20a5b4283cd2862535d04674b7b ABI_FINGERPRINT.txt 751e376ef074a4627f95256cac2ba8ea6b96dec2f672689fc5e3cf9b5cb205b4 calib/stereo_calib_20260621_202857_ascii.xml -6b184643f2f7366784c69070d8d91c48224ef5b10f823db3669f7794e70e2688 config/config.rk3588.12mp.yaml -6b184643f2f7366784c69070d8d91c48224ef5b10f823db3669f7794e70e2688 config/config.rk3588.selected4.top_plane.yaml +5f95e521e6def0422c85a1e838a9bfea8e27c3966d62fa68c0c1e7eca15e8817 CHANGELOG.txt +d9157898f966927b38cbe4d9531baa9ea514c28153001654d1e2d5c2c4ad14de config/config.rk3588.mainline.yaml +ca089bc3f0d6df0dbb580dd8142482eef691bb31639940f5679fd122e1df8583 DELIVERY.md +56f97990ab8cf20da86c70b264b12c5627b32cfe723651376578efebcbe9ba76 DEPENDENCIES.md afe649708e932b0792f6a14f1c4cb4b26c9f37b7c074f65ebb4ff2e08bc8c0db example/CMakeLists.txt a1dc401e981cec1ad998f70e0e30742860b6e946923e0779b3fa075b474fd6d3 example/main.c -daec54740b01bf9cbabb35c385cc7d466919682f451f4a87aa4aed1c83509752 include/stereo_bolt/c_api.h +61a56da934fe4ed1fb7e98a4d145aeaf1789c56a8494ccc9bec193cf9701c163 include/stereo_bolt/c_api.h +81a2eeeb282ec2656be19cf20e3f48e342a09e4520fdfff665e182ccd822c5fd INSTALL_3588.md 1a7af6af1e5a85091a8f9bf1878cdb34241cc27ea07953a44275e35e0a9b261a lib/libopencv_calib3d.so.4.5 aa68e645c38b3aa83889407653a5bd6467dd066a3409da9309ea943cb634dc9c lib/libopencv_core.so.4.5 6ad9d2668ec996903e5c16f6b71017f90d6ca494b0e6b53435a6d899ba786633 lib/libopencv_dnn.so.4.5 @@ -18,8 +16,9 @@ d101fbd9259265823a57955ca3200f2ee287ff97675aa464fa5395338be485b2 lib/libopencv_ 95499c6aa8367802cb8edf1157dc8cfa2d39458b81d8b94c48330ac4df23b927 lib/libopencv_imgcodecs.so.4.5 c910fad80ca0bb88751fe445e270e0e2d02d5d5e4a0dbea4ddecc7d2d9578df4 lib/libopencv_imgproc.so.4.5 d31fc19c85b85f6091b2bd0f6af9d962d5264a4e410bfb536402ec92bac738e8 lib/librknnrt.so -39517a349fffc1be3da9ce565bbc5b1bde0b131a365a49eec65ec549e5e6d885 lib/libstereo_bolt.so -83ac931940e9d41317659cce51b62f949d6613ec3f5861a43f81ed2ba3b1d7fa validation/c_example_centerline +5e7884a9f68ba389105d2af17f57482f4a15c2953f7845ead636653ae2d0aebd lib/libstereo_bolt.so +f38487a339214db6472bf0710a4de8792072edf94da9cbbe8fd547859263c13e SELECTED4_PROVENANCE.txt +59bccb6c248b447de17849ed42c7f3155753420b46f9a15e99df4bce32f6c5ec validation/c_example_centerline f905c1476734d0be268a33862d82255f54104bdb6211428ac3f72ff6340d1bf3 validation/c_example_centerline.c 9d33f942045c39408b7086ff1108f3593e5056b9eb82e023880f7f377fe69890 validation/input_sha256.csv b5b68722ef7cefb79d75f698838bfe869f8f1bc611290a34237bd0ec51616afc validation/inputs/left_19.bmp @@ -30,9 +29,9 @@ b5b68722ef7cefb79d75f698838bfe869f8f1bc611290a34237bd0ec51616afc validation/inp 019276576ff18d925d204aa7a1b149194a66b6e45a0382561087941fb18e772c validation/inputs/right_20.bmp 28676009b052c88bf4555f9073df019dac1ad2e240d591e74b51596dd91038b3 validation/inputs/right_28.bmp d833e99a5cc468e860ce553ba0e8e2c4441d93a0584ad44190dbdbc3abf6f2a7 validation/inputs/right_43.bmp -171a3ae990eed9db922fa53194b9c64dae2f35499caf7a2de3fad243ce89b5e6 validation/run_selected4.sh -5478b00694670607e0b670d76fcf60a42c71d02085902c8b098faa311d12d313 validation/selected4_delivery_validate -465bf5b8d5492881f0c8b0e868c865dcb0db4fe8e2018ff4565e6b68b6e8da5a validation/selected4_delivery_validate.cpp -5f5e022dd2b4f86e2c9a34f707010d8f6687fb3e7d032c2c311a8b9af4d964a5 validation/selected4_package_reverify.log -525fca05145e2bc44c8548fc7bf763ae0133adb2b4c7fb77143a35c0fbcbab6c validation/selected4_validation_final.log -4db0d4b30526a4e71d63fb4c0e6ecb2b735eb756636f79e8b1a1462781cd1e72 weights/obb_plus_halcon_seg_1024_fp16.rknn +3faf413b9503400f3e89a8928108ec8bba1eb165d5e1160fd353edede74eb810 validation/mainline_package_reverify.log +6a5bc63ef045917a81d0a3e0cab2c45943b129e81c182eef6a942a89be23ff6f validation/run_selected4.sh +78911c1b12b6c91dcc0f4b36e94eedd5868d3b9dd3b1f069dc0558cae7e4be47 validation/selected4_delivery_validate +863ed4022dd57806ba5ee8d59ded703ae9b86a835328eafc2fc218319cb7fbd8 validation/selected4_delivery_validate.cpp +ccf250e6e7d0bfb4b6d06200009b570a96b2fad0236b30ed032e510bba839a10 validation/WINDOWS_7_3_VALIDATION_SUMMARY.md +b9ed3b46c416919dc969637a7093cf01312eda91320066e40e33daad56d9f169 weights/model_20260713T084621+0000_c732327c.rknn diff --git a/AppAlgo/stereo_bolt_delivery/SELECTED4_PROVENANCE.txt b/AppAlgo/stereo_bolt_delivery/SELECTED4_PROVENANCE.txt index 7f596ce8..4fc06423 100644 --- a/AppAlgo/stereo_bolt_delivery/SELECTED4_PROVENANCE.txt +++ b/AppAlgo/stereo_bolt_delivery/SELECTED4_PROVENANCE.txt @@ -1,84 +1,79 @@ -RK3588 SELECTED4 TOP + SUPPORT-PLANE RELEASE PROVENANCE -======================================================= +RK3588 MAINLINE SELECTED4 RELEASE PROVENANCE +============================================ Release identity ---------------- -Name: selected4-top-plane-rk3588-v2 -Validated stereo frames: 19, 20, 28 and 43 -Acceptance target per frame: left YOLO=8, right YOLO=8, pairs=8, +Name: mainline-selected4-direct-rknn-v3 +Date: 2026-07-14 +Fixed board acceptance frames: 19, 20, 28 and 43 +Acceptance per frame: left YOLO=8, right YOLO=8, pairs=8, precise bolts=8 and ranging bolts=8. +Algorithm route +--------------- +Stereo rectification -> direct YOLO OBB -> stereo ROI pairing -> 2D centerline +and top -> sparse stereo 3D axis -> local SGBM support-plane -> axis/plane +intersection -> axial height. + +Backends: +- Windows: OpenCV DNN directly, ONNX model. +- RK3588: RKNN Runtime directly, RKNN model. +- AI Studio Runtime wrapper: removed from source, build and delivery. + Algorithm library ----------------- File: lib/libstereo_bolt.so -SHA256: 39517a349fffc1be3da9ce565bbc5b1bde0b131a365a49eec65ec549e5e6d885 +SHA256: 5e7884a9f68ba389105d2af17f57482f4a15c2953f7845ead636653ae2d0aebd ELF: AArch64 -Build ID: 14a8822d90f2e5334d2f3ec4c632972047df992d +Build ID: 79fbed2add268e6ceadad58e1e8f93731c844907 +Cross toolchain: aarch64-linux-gnu GCC 11 +Minimum glibc contract: GLIBC_2.35 +OpenCV contract: standard libopencv_*.so.4.5 SONAMEs -The packaged file is byte-identical to the RK3588 build output at -/home/linaro/stereo_bolt/build-selected4-rk3588/src/libstereo_bolt.so. -The board build sources were byte-compared with the Windows workspace: +Model/config/calibration +------------------------ +Model: weights/model_20260713T084621+0000_c732327c.rknn +SHA256: b9ed3b46c416919dc969637a7093cf01312eda91320066e40e33daad56d9f169 +Backend/task/input: RKNN / YOLO OBB / 1024x1024 +Confidence/IoU: 0.50 / 0.45 -src/centerline_match1d.cpp - 8fea4c07f1ba0b5aafb5cf2ed9a337b60c725a626f29ae75a1a6e5ebe2087600 -src/centerline_measure.cpp - 36b8c84e6f1a25fcb4ad05a57bb0cf521eb2e999451ce3d2b2ed3ea6754dbfa5 -src/c_api.cpp - 89fff5766127308d03b9a238f956ef8f732492cbf1dd1229aac87c947fbc5cb0 - -The binary contains the selected4 top-selection routes: -- left_cap_pair_right_gradient_agree -- left_gradient_right_cap_pair_agree -- top_suspect_cap_near_edge_stereo_wide - -These routes prioritize complete cap far/near edge evidence over an isolated -one-eye gradient. The reported 2D top is the bolt centerline intersection with -the selected near-side top-cap edge. This behavior is compiled into the shared -library; it is not selected by a YAML switch. - -Selected4 support-plane configuration -------------------------------------- -Canonical file: config/config.rk3588.selected4.top_plane.yaml -Compatibility alias: config/config.rk3588.12mp.yaml -Both files are byte-identical. -SHA256: 6b184643f2f7366784c69070d8d91c48224ef5b10f823db3669f7794e70e2688 - -Required measurement values: -- plane_use_sgbm: true -- height_from_plane: true -- plane_height_along_axis: true -- plane_anchor_max_foot_gap_std_mm: 20.0 -- plane_sgbm_scale: 0.25 -- plane_max_samples: 40000 - -The sb_create_ex validator injects the exact same values through -StereoBoltParamsC. The C API wiring for these values is part of the packaged -libstereo_bolt.so. - -RKNN model and calibration --------------------------- -Model: weights/obb_plus_halcon_seg_1024_fp16.rknn -SHA256: 4db0d4b30526a4e71d63fb4c0e6ecb2b735eb756636f79e8b1a1462781cd1e72 -Backend/task/input: RKNN / YOLO OBB / 1024x1024 FP16 -Confidence threshold: 0.25 +Config: config/config.rk3588.mainline.yaml +SHA256: d9157898f966927b38cbe4d9531baa9ea514c28153001654d1e2d5c2c4ad14de +Measurement: SGBM plane enabled, height from plane enabled, height along axis +enabled, plane anchor gap std <= 20.0 mm, SGBM scale 0.25, max samples 40000. Calibration: calib/stereo_calib_20260621_202857_ascii.xml SHA256: 751e376ef074a4627f95256cac2ba8ea6b96dec2f672689fc5e3cf9b5cb205b4 -Package-local acceptance paths ------------------------------- -validation/run_selected4.sh runs both paths on all four packaged stereo pairs: +Validators +---------- +validation/c_example_centerline +SHA256: 59bccb6c248b447de17849ed42c7f3155753420b46f9a15e99df4bce32f6c5ec +Calls sb_create(YAML) and sb_process_bolt_module_files(). -1. validation/c_example_centerline uses sb_create() with the canonical YAML, - then sb_process_bolt_module_files(). It must print success=1 bolts=8. - RK3588 binary SHA256: - 83ac931940e9d41317659cce51b62f949d6613ec3f5861a43f81ed2ba3b1d7fa - Packaged source: validation/c_example_centerline.c - Source SHA256: - f905c1476734d0be268a33862d82255f54104bdb6211428ac3f72ff6340d1bf3 -2. validation/selected4_delivery_validate uses sb_create_ex() with the packaged - calibration and RKNN bytes, then checks both the precise buffer API and the - ranging API. Each frame must print VERDICT=PASS. +validation/selected4_delivery_validate +SHA256: 78911c1b12b6c91dcc0f4b36e94eedd5868d3b9dd3b1f069dc0558cae7e4be47 +Calls sb_create_ex(model bytes), sb_process_bolt_module_buffers() and +sb_range_bolt_binned(). Uses the same 0.50 confidence as the YAML route. -The script also verifies MANIFEST_SHA256.txt and all dynamic dependencies. A -zero exit code plus PACKAGE_REVERIFY_PASS is the release acceptance condition. +RK3588 package-local acceptance +------------------------------- +Board: RK3588 AArch64 / Ubuntu 22.04 +Result: frames 19/20/28/43 passed both entry paths with 8 detections per eye, +8 stereo pairs, 8 precise measurements and 8 ranging bolts. +Terminal marker: PACKAGE_REVERIFY_PASS +Log: validation/mainline_package_reverify.log +SHA256: 3faf413b9503400f3e89a8928108ec8bba1eb165d5e1160fd353edede74eb810 + +ABI compatibility +----------------- +Exact exported C symbol set, unchanged from the 2026-07-10 package: +sb_create +sb_create_ex +sb_default_params +sb_destroy +sb_last_error +sb_free_bolt_module_result +sb_process_bolt_module_files +sb_process_bolt_module_buffers +sb_range_bolt_binned diff --git a/AppAlgo/stereo_bolt_delivery/config/config.rk3588.12mp.yaml b/AppAlgo/stereo_bolt_delivery/config/config.rk3588.12mp.yaml deleted file mode 100644 index 21ede64d..00000000 --- a/AppAlgo/stereo_bolt_delivery/config/config.rk3588.12mp.yaml +++ /dev/null @@ -1,243 +0,0 @@ -# ============================================================ -# 双目相机螺栓测量系统配置文件 (C++ port) -# -# 这是 Python 项目 e:/02_Modules/StereoVisionBoltMeasurement/config.yaml -# 的镜像。两者必须保持参数一致——任何一边改值,另一边同步。 -# 数据路径用 Python 项目的绝对路径(见 paths 段末尾)。 -# ============================================================ - -# ---------- 工作距离 ---------- -# 从标定推导视差范围,替代 SGBM 固定 [288,1024]。 -# z_min=1200 → disp_max≈1089,覆盖近处螺杆(disp~1060)。 -working_distance: - z_min_mm: 900 - z_max_mm: 4000 - -# ---------- 图像基本参数 ---------- -image: - width: 4096 - height: 3000 - channels: 1 - expected_dtype: "uint8" - allowed_extensions: [".tiff", ".tif", ".bmp", ".png"] - -# ---------- 图像输入自检 ---------- -image_validation: - min_max_value: 10 - max_saturation_ratio: 0.20 - -# ---------- ChArUco 标定板参数 ---------- -charuco: - rows: 9 - cols: 9 - square_length_mm: 50.0 - marker_length_mm: 37.0 - dict_id: 11 # DICT_6X6_1000 - min_corners_per_image: 30 - -# ---------- 标定模块参数 ---------- -calibration: - source: "xml" - xml_path: "calib/stereo_calib_20260621_202857_ascii.xml" - min_image_pairs: 15 - max_skip_ratio: 0.30 - max_single_rms: 0.40 - max_stereo_rms: 0.80 - expected_baseline_range: [80, 600] - use_fix_intrinsic: true - -# ---------- 校正模块参数 ---------- -# alpha=1.0 是硬约束,详见 CLAUDE.md 隐式决策 #1。 -rectification: - alpha: 1.0 - interpolation: "cubic" - validation_feature_count: 500 - validation_match_count: 10 - epipolar_inlier_threshold_pixel: 5.0 - min_epipolar_inlier_count: 3 - max_epipolar_error_pixel: 5.0 - min_valid_roi_ratio: 0.25 - -# ---------- SGBM 立体匹配参数 ---------- -# min_disparity / num_disparities 依赖 f_rect·B;如标定改了必须重算。 -# 当前值假设 f_rect≈3190, B≈235mm(alpha=1.0 下)。 -sgbm: - min_disparity: 288 - num_disparities: 736 - block_size: 5 - P1: 600 - P2: 2400 - disp12_max_diff: 1 - uniqueness_ratio: 10 - speckle_window_size: 100 - speckle_range: 2 - pre_filter_cap: 63 - mode: "SGBM_3WAY" - -# ---------- WLS 滤波 ---------- -wls: - lambda_value: 8000.0 - sigma_color: 1.5 - -# ---------- 视差自检 ---------- -disparity_validation: - min_valid_pixel_ratio: 0.10 - min_disparity_range: 50 - max_nan_ratio: 0.90 - -# ---------- 点云参数 ---------- -# z_min_mm / z_max_mm / expected_wd_range are FALLBACK only — when run_pipeline / -# c_api are wired (the standard path) SceneRuntime derives the real reachable -# Z range from (f_rect, baseline, sgbm.min_disparity, sgbm.num_disparities) and -# overrides these values per frame. See docs/L_100_SCENE_HANDOFF.md §6.2 and -# include/stereo_bolt/scene_runtime.hpp. Keep the fallback values conservative -# enough to cover every supported workpiece distance. -pointcloud: - z_min_mm: 600 - z_max_mm: 3000 - expected_wd_range: [600, 3000] - min_num_points: 50000 - max_z_std_mm: 800 - min_bbox_extent_x_mm: 200 - min_bbox_extent_y_mm: 100 - sor_nb_neighbors: 30 - sor_std_ratio: 2.0 - voxel_downsample_min_points: 500000 - voxel_size_mm: 0.5 - roi_mask: - enabled: false - method: "hsv_threshold" - hsv_lower: [0, 0, 210] - hsv_upper: [180, 50, 255] - morph_close_kernel: 15 - dilate_px: 100 - min_area_ratio: 0.02 - -# ---------- 2D 检测(左图分割) ---------- -# mask_method: 决定 foam_mask(支撑面像素 mask) 怎么算 -# "brightness" — 亮度阈值 + 最大连通域(只对原始低曝光泡沫板场景有效; -# rectify ROI 外恒为 0,所以 mask 会等于 ROI 矩形) -# "ransac" — 在 dense xyz_map 上 RANSAC 找主导平面, -# 把"到平面 < ransac.distance_thresh_mm"的像素当 mask -# 默认 "brightness" 保 parity_tests 不变,新工业数据用 "ransac" -bolt_detect_2d: - mask_method: "ransac" - foam_brightness_threshold: 70 - foam_morph_open_kernel: 21 - foam_dilate_px: 0 - bbox_margin_px: 60 - bolt_morph_close_kernel: 15 - bolt_min_area_px: 800 - min_bolts: 1 - max_bolts: 0 - bolt_exclude_dilate_px: 0 # 硬约束:默认 0,详见 CLAUDE.md 隐式决策 #5 - ransac: - distance_thresh_mm: 8.0 # 点到平面距离 < 此值即视为 inlier(3σ 容忍下, - # frame 100 residual_std≈2.6 mm) - max_iterations: 200 - min_inlier_ratio: 0.15 # 兜底:inlier 占比过低视作失败,自动回退 - sample_stride: 4 # xyz_map 下采样步长(每 4×4 像素取 1 个 RANSAC 候选) - morph_close_kernel_px: 9 # mask 后处理:闭运算填洞 + 最大连通域 - -# ---------- 参考平面 (SVD on foam mask) ---------- -plane: - max_residual_std_mm: 15.0 - max_normal_to_axis_deg: 60 - outlier_rejection_iterations: 5 - outlier_mad_k: 2.5 - -# ---------- 支撑面几何门 ---------- -# plane fit 后、bolt extract 前执行。把 bolt 的 3D 中心投影到主支撑面 -# inlier OBB, 超出 OBB 超过 margin_mm 的检测会被剔除并打印 WARN。 -# margin_mm 独立于 bolt.expected_diameter_mm, 避免混杂不同尺寸螺杆时 -# 几何门随螺杆规格隐式变宽/变窄。 -support_gate: - enabled: true - margin_mm: 10.0 - -# ---------- 螺栓几何先验 ---------- -# 主路径(run_pipeline / c_api)对每颗 bolt 先跑 bbox_projection 得 h_est, -# 然后 extract 内的 height 过滤改用 max(h_est × 1.3, h_est + 20 mm), -# validate_measurements 改用 |measured - h_est| < bolt.height_tolerance_mm。 -# 下面的 max_height_mm / extract_height_filter_mm 只剩 fallback 作用 —— 当 -# bbox_projection 失败、h_est 不可得时才走全局上限。 -# 工件外形规格(expected_diameter_mm)仍是真正的先验,保留。 -bolt: - min_height_mm: 5.0 - max_height_mm: 250.0 # fallback ceiling (used only when h_est is unavailable) - extract_height_filter_mm: 200.0 # fallback filter (same condition) - height_tolerance_mm: 60.0 # |measured - h_est| 允许差;触发 validate_measurements 失败 - expected_diameter_mm: 16.0 - min_points_per_bolt: 50 - max_axis_plane_angle_deg: 30 - extract_fallback: "bbox_projection" # 'none' | 'bbox_projection'; 后者用 YOLO bbox + 平面法向反解高度,处理 SGBM 在窄/反光螺杆上失败的情况 - -# ---------- 几何测量 ---------- -measurement: - top_extraction_method: "percentile_on_axis" - top_percentile: 0.99 - plane_use_sgbm: true - # true: 高度 = 螺杆顶点到支撑平面的法向距离; false: 高度 = 顶点到可见底沿拟合轴的长度 - height_from_plane: true - plane_height_along_axis: true - plane_anchor_max_foot_gap_std_mm: 20.0 - plane_sgbm_scale: 0.25 - plane_max_samples: 40000 - -# ---------- Diagnostics ---------- -diagnostics: - enabled: true - blind_strip_warn_ratio: 0.25 - min_roi_pointcloud_coverage_ratio: 0.001 - -# ---------- YOLO 螺栓检测 ---------- -# 注意 C++ 端走 ONNX:先在 Python 把 best_v4_finetune.pt 导出 .onnx。 -# dilate 量原本写成像素(50/30),跟距离和分辨率耦合。改成毫米后由 -# scene_runtime.cpp 在运行时用 pixels_per_mm(= f / Z_repr)换算成像素, -# 不同工作距离 / 不同镜头不再需要手调。 -yolo: - enabled: true - model_path: "weights/obb_plus_halcon_seg_1024_fp16.rknn" - backend: "rknn" - task: "obb" - imgsz: 1024 - conf: 0.25 - dead_zone_min_valid_pts: 50 - dead_zone_bbox_dilate_mm: 24.0 # = expected_diameter_mm × 1.5; 算 valid_xyz 前把 bbox 膨胀,救窄/反光螺杆 - foam_bbox_dilate_mm: 16.0 # = expected_diameter_mm × 1.0; foam_mask 从 YOLO bbox 减去前用的膨胀量 - - # Experimental: keep sparse-global YOLO bolts only when right YOLO + local LR check pass. - local_stereo_fallback: - enabled: true - min_valid_points: 50 - -# ---------- 评估通过判据 ---------- -evaluation: - height_max_mm: 2.0 - height_p95_mm: 1.5 - pair_max_mm: 2.0 - pair_p95_mm: 1.5 - repeatability_std_max_mm: 1.0 - matching_max_distance_mm: 50.0 - -# ---------- 流水线行为 ---------- -pipeline: - fail_fast: true - resume_from_checkpoint: true - parallel_frames: false - save_intermediate: false - -# ---------- 日志 ---------- -logging: - level: "INFO" - log_to_file: true - log_file: "outputs/logs/pipeline.log" - -# ---------- 路径 ---------- -# 项目自带数据集在 data/ 下,跟 Python 工程完全脱钩。 -paths: - calibration_dir: "data/calib" - test_dir: "E:/01_Projects/01_InProgress/hongchuang_bolt_detect_2026/image/0627-bolt-12mp" - groundtruth_csv: "data/groundtruth.csv" - output_dir: "outputs/macro257" - stereo_params_yaml: "outputs/macro257/stereo_params.yaml" diff --git a/AppAlgo/stereo_bolt_delivery/config/config.rk3588.yaml b/AppAlgo/stereo_bolt_delivery/config/config.rk3588.yaml index 3038bb12..b02bc561 100644 --- a/AppAlgo/stereo_bolt_delivery/config/config.rk3588.yaml +++ b/AppAlgo/stereo_bolt_delivery/config/config.rk3588.yaml @@ -177,7 +177,7 @@ measurement: top_extraction_method: "percentile_on_axis" top_percentile: 0.99 plane_use_sgbm: true - # true: 高度 = 螺杆顶点到支撑平面的法向距离; false: 高度 = 顶点到可见底沿拟合轴的长度 + # 主线定义:螺杆顶点沿拟合轴线到支撑平面的交点距离。 height_from_plane: true plane_height_along_axis: true plane_anchor_max_foot_gap_std_mm: 20.0 @@ -201,7 +201,7 @@ yolo: backend: "rknn" task: "obb" imgsz: 1024 - conf: 0.25 + conf: 0.50 dead_zone_min_valid_pts: 50 dead_zone_bbox_dilate_mm: 24.0 # = expected_diameter_mm × 1.5; 算 valid_xyz 前把 bbox 膨胀,救窄/反光螺杆 foam_bbox_dilate_mm: 16.0 # = expected_diameter_mm × 1.0; foam_mask 从 YOLO bbox 减去前用的膨胀量 diff --git a/AppAlgo/stereo_bolt_delivery/include/stereo_bolt/c_api.h b/AppAlgo/stereo_bolt_delivery/include/stereo_bolt/c_api.h index 831692ec..433fc1d2 100644 --- a/AppAlgo/stereo_bolt_delivery/include/stereo_bolt/c_api.h +++ b/AppAlgo/stereo_bolt_delivery/include/stereo_bolt/c_api.h @@ -65,6 +65,9 @@ typedef struct { StereoBoltModuleRoiC left_roi; StereoBoltModuleRoiC right_roi; double height_mm; + /* Physical height endpoint. In support-plane height mode this is the + * centerline/datum-plane intersection, so |top_xyz-foot_xyz| equals the + * reported axial height. */ StereoBoltPoint3d foot_xyz; StereoBoltPoint3d top_xyz; StereoBoltModuleLine3dC centerline; diff --git a/AppAlgo/stereo_bolt_delivery/lib/libstereo_bolt.so b/AppAlgo/stereo_bolt_delivery/lib/libstereo_bolt.so index dcdb9333..048a8b0c 100644 Binary files a/AppAlgo/stereo_bolt_delivery/lib/libstereo_bolt.so and b/AppAlgo/stereo_bolt_delivery/lib/libstereo_bolt.so differ diff --git a/AppAlgo/stereo_bolt_delivery/validation/WINDOWS_7_3_VALIDATION_SUMMARY.md b/AppAlgo/stereo_bolt_delivery/validation/WINDOWS_7_3_VALIDATION_SUMMARY.md new file mode 100644 index 00000000..73423bc7 --- /dev/null +++ b/AppAlgo/stereo_bolt_delivery/validation/WINDOWS_7_3_VALIDATION_SUMMARY.md @@ -0,0 +1,31 @@ +# Windows 7.3 全量验证摘要 + +- 日期:2026-07-14 +- 数据:`7.3` 全部 79 组双目图像 +- 后端:OpenCV DNN 直接加载 `model_20260713T084621+0000_c732327c.onnx` +- 阈值:confidence 0.50,期望螺栓数 8 +- 高度:三维顶点沿拟合螺杆轴线,到轴线/局部 SGBM 支撑平面交点的距离 +- 单元测试:29/29 PASS + +## 汇总 + +| 指标 | 结果 | +|---|---:| +| 测距入口 found | 79/79 | +| 完整 center/top | 53/79 | +| 严格精测 success | 24/79 | +| 检出数量正好为 8 | 26/79 | +| 19/20/28/43 四帧精测 | 4/4,每帧 8 根 | + +失败原因计数:`count_mismatch=26`、`pairing_failed=15`、`measurement_failed=14`。 + +严格成功帧:1, 2, 3, 4, 5, 6, 7, 15, 19, 20, 21, 22, 28, 29, 34, 36, 37, 43, 44, 49, 54, 60, 61, 66。 + +## 四帧轴向高度(mm) + +- 19:188.573, 189.837, 185.532, 185.495, 179.350, 196.637, 194.677, 194.563 +- 20:193.177, 190.347, 184.390, 184.689, 190.018, 191.536, 192.582, 196.692 +- 28:189.841, 197.338, 195.061, 183.737, 175.843, 177.208, 171.662, 189.185 +- 43:209.407, 206.103, 204.961, 206.985, 196.889, 205.353, 207.920, 211.450 + +结果图和 CSV 位于 Windows 工程输出目录 `outputs/win_7_3_mainline_20260714/`。本摘要明确保留全量失败情况;四帧验收通过不等于 79 帧全量泛化已经完成。 diff --git a/AppAlgo/stereo_bolt_delivery/validation/c_example_centerline b/AppAlgo/stereo_bolt_delivery/validation/c_example_centerline index 7f7582c9..f94b5336 100644 Binary files a/AppAlgo/stereo_bolt_delivery/validation/c_example_centerline and b/AppAlgo/stereo_bolt_delivery/validation/c_example_centerline differ diff --git a/AppAlgo/stereo_bolt_delivery/validation/inputs_test/1_leftImage.bmp b/AppAlgo/stereo_bolt_delivery/validation/inputs_test/1_leftImage.bmp deleted file mode 100644 index 26491347..00000000 Binary files a/AppAlgo/stereo_bolt_delivery/validation/inputs_test/1_leftImage.bmp and /dev/null differ diff --git a/AppAlgo/stereo_bolt_delivery/validation/inputs_test/1_rightImage.bmp b/AppAlgo/stereo_bolt_delivery/validation/inputs_test/1_rightImage.bmp deleted file mode 100644 index bcf87491..00000000 Binary files a/AppAlgo/stereo_bolt_delivery/validation/inputs_test/1_rightImage.bmp and /dev/null differ diff --git a/AppAlgo/stereo_bolt_delivery/validation/inputs_test/2_leftImage.bmp b/AppAlgo/stereo_bolt_delivery/validation/inputs_test/2_leftImage.bmp deleted file mode 100644 index f6cabf30..00000000 Binary files a/AppAlgo/stereo_bolt_delivery/validation/inputs_test/2_leftImage.bmp and /dev/null differ diff --git a/AppAlgo/stereo_bolt_delivery/validation/inputs_test/2_rightImage.bmp b/AppAlgo/stereo_bolt_delivery/validation/inputs_test/2_rightImage.bmp deleted file mode 100644 index 21f77628..00000000 Binary files a/AppAlgo/stereo_bolt_delivery/validation/inputs_test/2_rightImage.bmp and /dev/null differ diff --git a/AppAlgo/stereo_bolt_delivery/validation/inputs_test/3_leftImage.bmp b/AppAlgo/stereo_bolt_delivery/validation/inputs_test/3_leftImage.bmp deleted file mode 100644 index 54cafb38..00000000 Binary files a/AppAlgo/stereo_bolt_delivery/validation/inputs_test/3_leftImage.bmp and /dev/null differ diff --git a/AppAlgo/stereo_bolt_delivery/validation/inputs_test/3_leftImage_r.bmp b/AppAlgo/stereo_bolt_delivery/validation/inputs_test/3_leftImage_r.bmp deleted file mode 100644 index 6540ead8..00000000 Binary files a/AppAlgo/stereo_bolt_delivery/validation/inputs_test/3_leftImage_r.bmp and /dev/null differ diff --git a/AppAlgo/stereo_bolt_delivery/validation/inputs_test/3_rightImage.bmp b/AppAlgo/stereo_bolt_delivery/validation/inputs_test/3_rightImage.bmp deleted file mode 100644 index 8e54499d..00000000 Binary files a/AppAlgo/stereo_bolt_delivery/validation/inputs_test/3_rightImage.bmp and /dev/null differ diff --git a/AppAlgo/stereo_bolt_delivery/validation/inputs_test/3_rightImage_r.bmp b/AppAlgo/stereo_bolt_delivery/validation/inputs_test/3_rightImage_r.bmp deleted file mode 100644 index 16584264..00000000 Binary files a/AppAlgo/stereo_bolt_delivery/validation/inputs_test/3_rightImage_r.bmp and /dev/null differ diff --git a/AppAlgo/stereo_bolt_delivery/validation/inputs_test/推流图.png b/AppAlgo/stereo_bolt_delivery/validation/inputs_test/推流图.png deleted file mode 100644 index 84ed4125..00000000 Binary files a/AppAlgo/stereo_bolt_delivery/validation/inputs_test/推流图.png and /dev/null differ diff --git a/AppAlgo/stereo_bolt_delivery/validation/run_selected4.sh b/AppAlgo/stereo_bolt_delivery/validation/run_selected4.sh index 292bb508..ac4eb8da 100644 --- a/AppAlgo/stereo_bolt_delivery/validation/run_selected4.sh +++ b/AppAlgo/stereo_bolt_delivery/validation/run_selected4.sh @@ -7,7 +7,7 @@ cd "$package_root" export LD_LIBRARY_PATH="$package_root/lib:${LD_LIBRARY_PATH:-}" -echo "=== RK3588 selected4 package validation ===" +echo "=== RK3588 selected4 mainline package validation ===" echo "arch=$(uname -m)" if [[ "$(uname -m)" != "aarch64" ]]; then echo "warning: this delivery binary targets aarch64" >&2 @@ -28,7 +28,7 @@ for frame in 19 20 28 43; do echo "--- CONFIG FRAME $frame ---" set +e config_output="$(validation/c_example_centerline \ - config/config.rk3588.selected4.top_plane.yaml \ + config/config.rk3588.mainline.yaml \ "validation/inputs/left_${frame}.bmp" \ "validation/inputs/right_${frame}.bmp" 8 2>&1)" config_rc=$? @@ -45,7 +45,7 @@ for frame in 19 20 28 43; do echo "--- FRAME $frame ---" validation/selected4_delivery_validate \ calib/stereo_calib_20260621_202857_ascii.xml \ - weights/obb_plus_halcon_seg_1024_fp16.rknn \ + weights/model_20260713T084621+0000_c732327c.rknn \ "validation/inputs/left_${frame}.bmp" \ "validation/inputs/right_${frame}.bmp" \ "$frame" 8 diff --git a/AppAlgo/stereo_bolt_delivery/validation/selected4_delivery_validate b/AppAlgo/stereo_bolt_delivery/validation/selected4_delivery_validate index 7d465248..f23f8681 100644 Binary files a/AppAlgo/stereo_bolt_delivery/validation/selected4_delivery_validate and b/AppAlgo/stereo_bolt_delivery/validation/selected4_delivery_validate differ diff --git a/AppAlgo/stereo_bolt_delivery/validation/selected4_delivery_validate.cpp b/AppAlgo/stereo_bolt_delivery/validation/selected4_delivery_validate.cpp index 7ba2f78a..ccf70ab6 100644 --- a/AppAlgo/stereo_bolt_delivery/validation/selected4_delivery_validate.cpp +++ b/AppAlgo/stereo_bolt_delivery/validation/selected4_delivery_validate.cpp @@ -88,7 +88,7 @@ int main(int argc, char** argv) { model.size = model_bytes.size(); model.backend = SB_YOLO_BACKEND_RKNN; model.imgsz = 1024; - model.conf = 0.25f; + model.conf = 0.50f; model.iou = 0.45f; StereoBoltParamsC params = sb_default_params(); diff --git a/AppAlgo/stereo_bolt_delivery/weights/obb.rknn b/AppAlgo/stereo_bolt_delivery/weights/obb.rknn index ff2a5d65..4f7217c2 100644 Binary files a/AppAlgo/stereo_bolt_delivery/weights/obb.rknn and b/AppAlgo/stereo_bolt_delivery/weights/obb.rknn differ diff --git a/Device b/Device index 9d4d2a22..76d33caa 160000 --- a/Device +++ b/Device @@ -1 +1 @@ -Subproject commit 9d4d2a2239b837c8934d1b1c76e3cab3810ff350 +Subproject commit 76d33caae885f1b47eec264f65f8e5f76cc131d0