中国机械工程 ›› 2025, Vol. 36 ›› Issue (11): 2783-2791.DOI: 10.3969/j.issn.1004-132X.2025.11.037
• 工程前沿 • 上一篇
收稿日期:2024-07-16
出版日期:2025-11-25
发布日期:2025-12-09
通讯作者:
陈晓荣
作者简介:吴洪臣,男,2001年生,硕士研究生。研究方向为图像处理与机器视觉。E-mail:wuhongchen3@163.com基金资助:
Hongchen WU(
), Xiaorong CHEN(
), Baiyang LI
Received:2024-07-16
Online:2025-11-25
Published:2025-12-09
Contact:
Xiaorong CHEN
摘要:
针对传统检测手段难以深入工件内部进行三维量化分析的问题,提出一种基于多线程半全局立体匹配(M-SGSM)的双目视觉检测方法。首先采用张正友标定法获取双目内窥镜参数,并对图像进行畸变矫正与极线矫正;然后设计多线程区域叠加分割策略优化立体匹配算法,提高视差图计算效率,生成三维彩色点云;最后,提出自标定面积测量法结合欧氏空间距离计算实现三维量化分析。实验结果表明,优化后立体匹配算法计算效率提高约30%,所提检测方法生成的三维点云结构清晰,欧氏距离测量误差小于3%,面积测量误差小于1.5%。该方法为工件内部三维检测提供了高效高精解决方案。
中图分类号:
吴洪臣, 陈晓荣, 李柏杨. 多线程半全局立体匹配工件内部检测方法[J]. 中国机械工程, 2025, 36(11): 2783-2791.
Hongchen WU, Xiaorong CHEN, Baiyang LI. Multi-threaded Semi-global Stereo Matching Method for Internal Inspection of Workpieces[J]. China Mechanical Engineering, 2025, 36(11): 2783-2791.
| 参数 | 左相机 | 右相机 |
|---|---|---|
| 内参矩阵 | ||
| 旋转矩阵 | ||
| 平移矩阵 | ||
| 畸变系数 | k1=0.087 | k1=0.068 |
| k2=-0.269 | k2=-0.198 | |
| k3=0.146 | k3=0.080 | |
| p1=0.000 093 | p1=0.000 249 | |
| p2=-0.000 984 | p2=-0.001 224 | |
表1 左右相机内外参数与畸变系数
Tab.1 Left and right camera internal and external parameters and distortion coefficients
| 参数 | 左相机 | 右相机 |
|---|---|---|
| 内参矩阵 | ||
| 旋转矩阵 | ||
| 平移矩阵 | ||
| 畸变系数 | k1=0.087 | k1=0.068 |
| k2=-0.269 | k2=-0.198 | |
| k3=0.146 | k3=0.080 | |
| p1=0.000 093 | p1=0.000 249 | |
| p2=-0.000 984 | p2=-0.001 224 | |
| 名称 | 配置信息 |
|---|---|
| 操作系统 | Windows 11 64位 |
| 编程语言 | C++ 11 |
| 编译器 | Microsoft Visual Studio 2017 |
| CPU | Intel Core i7-13700H |
| GPU | NVIDA RTX 4060 Laptop (8G) |
表2 实验环境
Table.2 Experimental environment
| 名称 | 配置信息 |
|---|---|
| 操作系统 | Windows 11 64位 |
| 编程语言 | C++ 11 |
| 编译器 | Microsoft Visual Studio 2017 |
| CPU | Intel Core i7-13700H |
| GPU | NVIDA RTX 4060 Laptop (8G) |
| 测试对象 | SSIM | PSNR/dB | 计算时间t/ms | ||||||
|---|---|---|---|---|---|---|---|---|---|
| SGBM | BM | AD-Census | SGBM | BM | AD-Census | SGBM | BM | AD-Census | |
| Art | 0.537 | 0.324 | 0.826 | 11.423 | 8.697 | 19.936 | 40.085 | 3.083 | 2844 |
| Books | 0.687 | 0.364 | 0.891 | 11.571 | 9.330 | 21.118 | 39.667 | 2.980 | 2900 |
| Moebius | 0.660 | 0.415 | 0.882 | 13.284 | 10.552 | 20.696 | 38.869 | 3.986 | 2788 |
| Laundry | 0.647 | 0.281 | 0.823 | 11.247 | 8.917 | 21.618 | 37.542 | 5.233 | 2660 |
表3 SGBM、BM、AD-Census在MiddleBurry数据集上的对比
Tab.3 Comparison of SGBM, BM, AD-Census on the MiddleBurry dataset
| 测试对象 | SSIM | PSNR/dB | 计算时间t/ms | ||||||
|---|---|---|---|---|---|---|---|---|---|
| SGBM | BM | AD-Census | SGBM | BM | AD-Census | SGBM | BM | AD-Census | |
| Art | 0.537 | 0.324 | 0.826 | 11.423 | 8.697 | 19.936 | 40.085 | 3.083 | 2844 |
| Books | 0.687 | 0.364 | 0.891 | 11.571 | 9.330 | 21.118 | 39.667 | 2.980 | 2900 |
| Moebius | 0.660 | 0.415 | 0.882 | 13.284 | 10.552 | 20.696 | 38.869 | 3.986 | 2788 |
| Laundry | 0.647 | 0.281 | 0.823 | 11.247 | 8.917 | 21.618 | 37.542 | 5.233 | 2660 |
测试 对象 | 时间/ms | |||
|---|---|---|---|---|
| SGBM | BM | AD-Census | M-SGSM | |
| Art | 40.085 | 3.083 | 2844 | 23.436 |
| Books | 39.667 | 2.980 | 2900 | 28.084 |
| Moebius | 38.869 | 3.986 | 2788 | 22.235 |
| Laundry | 37.542 | 5.233 | 2660 | 22.797 |
表4 各算法在时间上的对比
Tab.4 Comparison of each algorithm in time
测试 对象 | 时间/ms | |||
|---|---|---|---|---|
| SGBM | BM | AD-Census | M-SGSM | |
| Art | 40.085 | 3.083 | 2844 | 23.436 |
| Books | 39.667 | 2.980 | 2900 | 28.084 |
| Moebius | 38.869 | 3.986 | 2788 | 22.235 |
| Laundry | 37.542 | 5.233 | 2660 | 22.797 |
| 测量类型 | 测量对象 | 实际值 | 测量结果 | 平均相对 误差/% | ||||
|---|---|---|---|---|---|---|---|---|
| 测量1 | 测量2 | 测量3 | 测量4 | 测量5 | ||||
| 长度测量/mm | 等边三角形边长 | 6.000 | 5.766 | 5.958 | 5.753 | 5.833 | 5.996 | 2.373 |
| 圆直径 | 8.000 | 7.917 | 7.910 | 7.876 | 7.923 | 7.916 | 1.145 | |
| 大三角长边 | 24.469 | 23.875 | 24.063 | 24.107 | 24.333 | 24.134 | 1.498 | |
| 大三角中边 | 19.256 | 18.784 | 18.758 | 18.763 | 18.793 | 19.200 | 2.058 | |
| 大三角短边 | 18.655 | 18.588 | 18.484 | 18.347 | 18.352 | 18.310 | 1.280 | |
| 面积测量/mm2 | 椭圆形 | 89.512 | 90.276 | 90.022 | 91.309 | 91.045 | 90.374 | 1.221 |
| 云朵形 | 76.751 | 75.771 | 75.468 | 76.235 | 78.605 | 77.032 | 1.281 | |
表5 三维测量结果
Tab.5 3D measurement results
| 测量类型 | 测量对象 | 实际值 | 测量结果 | 平均相对 误差/% | ||||
|---|---|---|---|---|---|---|---|---|
| 测量1 | 测量2 | 测量3 | 测量4 | 测量5 | ||||
| 长度测量/mm | 等边三角形边长 | 6.000 | 5.766 | 5.958 | 5.753 | 5.833 | 5.996 | 2.373 |
| 圆直径 | 8.000 | 7.917 | 7.910 | 7.876 | 7.923 | 7.916 | 1.145 | |
| 大三角长边 | 24.469 | 23.875 | 24.063 | 24.107 | 24.333 | 24.134 | 1.498 | |
| 大三角中边 | 19.256 | 18.784 | 18.758 | 18.763 | 18.793 | 19.200 | 2.058 | |
| 大三角短边 | 18.655 | 18.588 | 18.484 | 18.347 | 18.352 | 18.310 | 1.280 | |
| 面积测量/mm2 | 椭圆形 | 89.512 | 90.276 | 90.022 | 91.309 | 91.045 | 90.374 | 1.221 |
| 云朵形 | 76.751 | 75.771 | 75.468 | 76.235 | 78.605 | 77.032 | 1.281 | |
| [1] | 何宝凤, 丁思源, 魏翠娥, 等. 三维表面粗糙度测量方法综述[J]. 光学精密工程, 2019, 27(1): 78-93. |
| HE Baofeng, DING Siyuan, WEI Cuie, et al. Review of Measurement Methods for Areal Surface Roughness[J]. Optics and Precision Engineering, 2019, 27(1): 78-93. | |
| [2] | 那一鸣, 胡超, 邱业余, 等. 基于机器视觉的汽车车门三维定位引导 [J]. 中国机械工程, 2024, 35(9): 1677-1687. |
| NA Yiming, HU Chao, QIU Yeyu, et al. Three-dimensional Positioning Guidance of Automobile Doors Based on Machine Vision[J]. China Mechanical Engineering, 2024, 35(9): 1677-1687. | |
| [3] | 易怀安,赵欣佳,唐乐,等.基于彩色图像奇异值熵指标的磨削表面粗糙度视觉测量方法[J].中国机械工程,2021,32(13):1577-1583. |
| YI Huaian, ZHAO Xinjia, TANG Le, et al. Vision Mearsurement Method for Ground Surface Roughness Based on Color Image Singular Value Entropy Index [J]. China Mechanical Engineering, 2021, 32(13): 1577-1583. | |
| [4] | 曹旭明, 冯浩, 曹利钢, 等. 基于机器视觉螺栓类零件参数在线质检系统 [J]. 控制工程, 2021, 28(6): 1187-1194. |
| CAO Xuming, FENG Hao, CAO Ligang, et al. Online Quality Inspection System for Bolt Parts Parameters Based on Machine Vision [J]. Control Engineering of China, 2021, 28(6): 1187-1194. | |
| [5] | 马大智, 于斌超, 张彦泽, 等. 基于双目视觉的大型高反光构件测量系统 [J]. 应用光学, 2021, 42(4): 577-585. |
| MA Dazhi, YU Binchao, ZHANG Yanze, et al. Measurement System for Large-scale High Reflective Component Based on Binocular Vision[J]. Journal of Applied Optics, 2021, 42(4): 577-585. | |
| [6] | HughesBaker.Remote Visual Inspection[EB/OL].Houston: Baker Hughes,2024[2025-06-11].. |
| [7] | SCHÖLLY FIBEROPTIC GMBH.FLEXIVISO@100 INSPECTIONS[EB/OL].Freiburg:SCHÖLLY, 2022[2025-06-11].. |
| [8] | Olympus.IPLEX NX Olympus's Most Advanced Industrial Videoscope[EB/OL].Tokyo:Olympus,2016[2025-06-11].. |
| [9] | 周富强, 王晔昕, 柴兴华, 等. 镜像双目视觉精密测量技术综述 [J]. 光学学报, 2018, 38(8): 59-67. |
| ZHOU Fuqiang, WANG Yexin, CHAI Xinghua, et al. Review on Precise Measurement Technology Based on Mirror Binocular Vision [J]. Acta Optica Sinica, 2018, 38(8): 59-67. | |
| [10] | FIRMANSYAH I, YAMAGUCHI Y, TMARU-YAMA, et al. FPGA-Based Stereo Matching for Crop Height Measurement Using Monocular Camera [J]. Microprocess and Microsystems, 2024, 108: 105063. |
| [11] | SHAHBAZI M, SOHN G, THEO J. High-density Stereo Image Matching Using Intrinsic Curves [J]. ISPRS Journal of Photogrammetry and Remote Sensing, 2018, 146: 373-388. |
| [12] | 张泽琳, 曹星, 王蕾, 等. 基于改进SGM的废旧机械零件彩色三维重建方法 [J]. 激光与光电子学进展, 2024, 61(12): 114-124. |
| ZHANG Zelin, CAO Xing, WANG Lei, et al. Color 3D Reconstruction Method of Used Machinery Parts Based on Improved SGM [J]. Laser & Optoelectronics Progress, 2024, 61(12): 114-124. | |
| [13] | WANG Yina, GU Mengjiao, ZHU Yufeng, et al. Improvement of AD-Census Algorithm Based on Stereo Vision [J]. Sensors, 2022, 22(18): 6933. |
| [14] | GUO Junguang, GU Feifei, YE Yuping, et al. An Accurate Speckle 3D Reconstruction System Based on Binocular Endoscope[C]∥2021 IEEE International Conference on Real-time Computing and Robotics (RCAR). Xining, 2021: 703-708. |
| [15] | HAMID M S, MANAP N A, HAMZAH R A, et al. Stereo Matching Algorithm Based on Deep Learning: a Survey [J]. Journal of King Saud University: Computer and Information Sciences, 2022, 5(34): 1663-1673. |
| [16] | YU Hao, ZHOU Changjiang, ZHANG Wei . et al. A Three-dimensional Measurement Method for Binocular Endoscopes Based on Deep Learning[J]. Frontiers of Information Technology & Electronic Engineering, 2022, 23(4):653-660. |
| [17] | TAHMASEBI M, HUQ S, MEEHAN K, et al. DCVSMNet: Double Cost Volume Stereo Matching Network [J]. Neurocomputing, 2024,618: 129002. |
| [18] | YAN Long, ZHAO Xingfang, DU Huiqiu. Research on 3D Measuring Based Binocular Vision[C]∥2014 IEEE International Conference on Control Science and Systems Engineering. Yantai, 2014: 18-22. |
| [19] | HUANG Wei, MIAO Huisi, JIAO Shuming, et al. A Planar Constraint Optimization Method to Improve Camera Calibration for Imperfect Planar Targets[J]. Optics and Lasers in Engineering, 2024,180: 108273 . |
| [20] | ZHANG Xiaowen, Tiegang LYU, DAN Wang, et al.High-precision Binocular Camera Calibration Method Based on a 3D Calibration Object[J]. Applied Optics, 2024, 63(10): 2667-2682. |
| [21] | ZHANG Zhengyou. Flexible Camera Calibration by Viewing a Plane from Unknown Orientations[C] ∥Proceedings of the Seventh IEEE International Conference on Computer Vision. Kerkyra, 1999: 666-673. |
| [22] | HIRSCHMULLER H. Stereo Processing by Semiglobal Matching and Mutual Information[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2008, 30(2): 328-341. |
| [23] | MOSTEGEL C, RUMPLER M, FRAUN-DORFER F, et al. Using Self-contradiction to Learn Confidence Measures in Stereo Vision[C]∥Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. Las Vegas, 2016: 4067-4076. |
| [24] | MIANGOLEH S M H, DILLE S, MAI L, et al. Boosting Monocular Depth Estimation Models to High-resolution via Content-adaptive Multi-resolution Merging[C]∥ Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. Nashville, 2021: 9680-9689. |
| [1] | 梅杰, 覃嘉锐, 陈定方, 陈昆, . 基于视觉同时定位与地图构建的水下图像增强式视觉三维重建方法[J]. 中国机械工程, 2024, 35(02): 268-279. |
| [2] | 宇文旋1;赵明明2;陈龙2 . 无人车鱼眼双目深度提取研究[J]. 中国机械工程, 2019, 30(13): 1577-1584. |
| [3] | 张洪鑫;王明珠;仇浩然;姜金刚. 基于单目图像序列的铸件三维重建方法[J]. 中国机械工程, 2018, 29(23): 2799-2803,2814. |
| [4] | 同志学;赵涛;贺利乐;王消为. 基于双目视觉的工程车辆定位与行驶速度检测[J]. 中国机械工程, 2018, 29(04): 423-428. |
| [5] | 张浩, 孙见君, 马晨波, 涂桥安. 机械密封端面形貌的三维重建及其表征[J]. 中国机械工程, 2017, 28(11): 1287-1291,1299. |
| [6] | 杨志光, 张永林, 谢经明, 陈幼平. 基于双目视觉和约束条件的行人目标定位[J]. 中国机械工程, 2016, 27(23): 3171-3175. |
| [7] | 王玉亮, 刘飞, 沈建新, 刘贤喜. 基于单目视觉的视网膜三维重建技术研究[J]. 中国机械工程, 2016, 27(18): 2477-2481. |
| [8] | 柯丰恺, 陈幼平, 谢经明, 张代林. 基于凸松弛优化算法的相机内外参数标定[J]. 中国机械工程, 2016, 27(05): 634-639,657. |
| [9] | 周兴林, 李程, 刘汉丽, 蒋难得, 张云, 胡怡玮. 基于双目视觉的车辆行驶跑偏在线自动检测系统[J]. 中国机械工程, 2015, 26(1): 130-134. |
| [10] | 崔晓川, 邾继贵, 隆昌宇. 基于全局控制网的三维形貌测量方法[J]. 中国机械工程, 2013, 24(22): 3009-3013. |
| [11] | 熊维;李文龙;尹周平. 双目PMP视觉测量中立体匹配方法的设计与实现[J]. 中国机械工程, 2013, 24(19): 2635-2640,2646. |
| [12] | 王殿君. 双目视觉在移动机器人定位中的应用[J]. 中国机械工程, 2013, 24(09): 1155-1158. |
| [13] | 吴丹妮, 伍铁军. 基于机器视觉的虚拟雕刻轨迹跟踪系统研究 [J]. 中国机械工程, 2010, 21(23): 2821-2825. |
| [14] | 张辉;张丽艳;韦虎;. 双目立体测量系统标定的三步法[J]. J4, 2009, 20(16): 0-2015. |
| [15] | 刘琼;秦现生;应申舜;贺峰. 双目视觉测量系统结构参数设计及精度分析[J]. J4, 2008, 19(22): 0-2649. |
| 阅读次数 | ||||||
|
全文 |
|
|||||
|
摘要 |
|
|||||