文本描述
砂轮的磨削性能和工件表面加工质量不仅取决于砂轮本身的结构特性,而且还取 决于砂轮表面的地貌特征。由于砂轮磨粒本身和工况的复杂性,砂轮地貌的定量检测 长期以来一直是磨削界期望解决的难题。本文在深入分析了以往砂轮地貌检测方法的 基础上,提出采用计算机双目视觉技术,对砂轮地貌的定量检测开展可行性探索研究。 报告完成的主要工作归纳如下: 1. 设计了磨粒模型双目图像采集装置。该装置能够实现被测物体的精确平移。 2. 研究了数字图像预处理算法。主要包括数字图像的灰度化算法、二值化算法 和边缘检测算法,并分析了各种算法的适用场合和优缺点,最后对各种算法进行了编 程验证。 3. 推导并编制了双目视觉匹配算法。在灰度模板匹配算法中,采用灰度差曲线 (Ds 曲线)确定了匹配窗口大小,获得了良好的特征点匹配效果。 4. 针对砂轮磨粒模型,应用双目视觉高度检测程序计算了求取物体的出露高度, 与实测高度值进行了对比,结果表明计算误差在允许的范围内。为计算机双目视觉技 术在砂轮地貌检测中的应用提供了科学依据。 关键词:砂轮地貌,双目视觉,检测,匹配,出露高度双目视觉技术在砂轮地貌检测中的可行性研究 II Abstract During grinding, the machining performance of the tools and the surface quality of the workpiece are decided not only by the structure property but also by the topography of the grinding wheel under certain processing parameters. Due to the complexities of the grain shape and the working condition, the detection of grinding wheel topography has been a difficult problem for a long time. Detective research on the model of the protruding height of the grains by the means of binocular vision has been performed in this paper. The main work could be summarized as follows: 1. The device of shooting binocular images has been designed in order to obtain a pair of images of one special grain of the grinding wheel. It could ensure the move space precisely according to the demands of the ways of binocular vision. 2. Some pretreatment algorithms such as gray images algorithms, two value images algorithms, and edge detection algorithms have been discussed. Moreover, the disadvantages and merits of these algorithms have also been studied respectively. Finally, all these algorithms have been programmed to validate their efficiency. 3. Through the study of different algorithm of binocular vision matching, the gray template matching algorithm is selected. The optimum window size is obtained by a series of Ds curves. The result showed that the character points could be matched perfectly in the corresponding right digital image. 4. The algorithm of the protruding height of grain model has been verified experimentally. Algorithm code has been programmed and utilized to validate the algorithm of binocular vision by calculating the height of grain. The experimental results indicate that the error is in the accepted range. The means of binocular vision is proved to be succeededly engaged in the detection of grinding wheel topography. Key words: Grinding wheel topography, Binocular vision, Detection, Matching, Protruding height of grain南京航空航天大学硕士学位报告 III 目 录 第一章 绪论...................................................... 1 1.1 计算机视觉在尺寸检测中的应用现状 .............................. 1 1.1.1 计算机视觉检测的分类..................................... 1 1.1.2 视觉检测方法............................................. 2 1.2 双目视觉理论的应用研究现状 .................................... 2 1.3 课题研究的目的和意义 .......................................... 3 1.4 本课题开展的主要工作 .......................................... 5 第二章 数字图像处理分析的常用基础技术 ............................ 6 2.1 数字图像的邻域 ................................................ 6 2.2 三元色 RGB 的概念 .............................................. 6 2.3 图像的灰度处理 .................................................7 2.3.1 基本概念 ..................................................7 2.3.2 程序实现 ..................................................8 2.4 阈值计算及二值化 ...............................................9 2.4.1 基本概念 ..................................................9 2.4.2 程序实现.................................................10 2.5 边缘检测处理 ..................................................11 2.5.1 图像边缘的概念 ...........................................12 2.5.2 边缘检测的概念和一些常用检测算子.........................12 2.5.3 算法实现.................................................13 2.5.4 边缘检测算法的转化与实现.................................16 2.6 本章小结 ......................................................22 第三章 双目视觉理论及特征匹配算法实现............................23 3.1 双目视觉原理概述 ..............................................23 3.2 成像坐标的基本知识 ............................................24 3.2.1 成像变换 ................................................24 3.2.2 摄像机定标 ..............................................25 3.2.3 世界坐标与摄像机坐标重合时的摄像机模型 ..................25 3.2.4 透镜成像原理 ............................................26 3.3 平行双目中的成像 ..............................................27双目视觉技术在砂轮地貌检测中的可行性研究 IV 3.4 匹配算法的选择 ................................................29 3.4.1 模板匹配的基本概念.......................................29 3.4.2 模板匹配算法.............................................30 3.4.3 模板匹配算法的简化.......................................32 3.4.4 窗口尺寸大小的优化.......................................32 3.5 本章小结 ......................................................33 第四章 双目视觉理论在砂轮磨粒模型高度检测中的初步应用 ............34 4.1 数字图像的采集 ................................................34 4.2 软件总体设计与实施方案 ........................................34 4.2.1 程序设计语言选择与设计环境需求...........................34 4.2.2 Jbuilder7.0 的图形用户界面(GUI)制作 ......................35 4.2.3 软件系统结构.............................................37 4.2.4 方案与实施步骤...........................................38 4.2.5 设计要点及注意事项.......................................39 4.3 程序的编写 ....................................................39 4.3.1 系统界面概述.............................................39 4.3.2 主要算法设计.............................................40 4.4 试验结果及讨论 ................................................43 4.4.1 确定匹配窗口大小........................................44 4.4.2 磨粒模型高度求取主要步骤................................44 4.4.3 磨粒模型高度试验结果....................................45 4.4.4 试验结果分析............................................46 4.5 双目视觉技术在砂轮磨粒出露高度检测中的初步应用................46 4.6 本章小结......................................................49 第五章 结论与展望................................................50 5.1 总结和所取得的主要结论........................................50 5.2 双目视觉技术应用的展望........................................51