【编者按】:网学网自动化PLC相关毕业设计为您提供基于OpenCV的螺丝刀尺寸检测参考,解决您在基于OpenCV的螺丝刀尺寸检测学习中工作中的难题,参考学习。
论文编号:ZD1088 论文字数:13958,页数:29
摘 要
本系统主要是用USB摄像头采集螺丝刀的样本图像,然后对图像进行边缘检测,提取边缘,最后对边缘进行处理,得到螺丝刀的直径。
本系统利用OpenCV的视频读写函数捕获USB摄像头,采集螺丝刀的样本图像。将采集到的图像进行灰度转换,即24位的真彩图转化为8位的灰度图。然后对得到的灰度图进行canny边缘检测。得到比较清晰完整的螺丝刀轮廓。找出轮廓像素在图像中的坐标,计算出螺丝刀的像素直径。再对摄像头进行标定,找出没个像素所对应得实际此寸。最后将螺丝刀的像素直径转换为实际的直径,显示给用户。该系统还可以支持指定位置检测,计算平均直径的均值检测和保存检测结果的功能。多次测试表明本系统具有较高的测试精度与测试可靠性。
关键词: 边缘检测;OpenCV;图像处理
Abstract
This system mainly uses USB camera samples the image of screwdriver. Then, it will detect the edge of the image to extract the outline of the screwdriver. Finally, it will measure the outline to get the screwdriver’s diameter.
The system uses OpenCV reading and writing functions of OpenCV to capture USB camera, and collects sampleing image of screwdriver. After which it convers the image collected by USB camera to grayscale, that is turning 24-bit true color picture into 8-bit grayscale picture. Then the system will process the grayscale picture by canny edge detection so as to get a clear, complete outline of the driver and calculate the diameter of the screwdriver which is measured by pixels. Next step is Re-calibrateing the camera to find the corresponding inch to eatch pixel,by which ,Finally,it can get the actual diameter, and show it to the user. The system also can support the specified location detection, calculating average diameter and the function of preservation the measuring result. Several tests has shown that the system has high accuracy and reliability.
Keywords: Edge Detection;OpenCV;Image Processing
目 录
摘要…………………………………………………………………………….....……………..I
1 绪论…………………………………………………………………………………………..1
1.1 引言………………………………………………………………………….……1
1.2 数字图像处理技术发展与应用……………………………………………………......1
1.3 数字图像处理技术的的主要特点………………………………………………………2
1.4 数字图像处理技术在工件检测中的应用………………………………………………3
2 OpenCV及其在图像处理中的应用……………………………………………………4
2.1 OpenCV简介……………………………………………………………………..4
2.1.1 功能描述………………………………………………………………………..4
2.1.2 OpenCV的安装………………………………………………………………….4
2.1.3 OpenCV在图像处理中的应用………………………………………………..5
3 螺丝刀检测中的关键技术研究…………………………………………………………6
3.1 图像预处理…………………………………………………………………………6
3.1.1 图像的灰度变换………………………………………………………………..6
3.1.2 图像的二值化………………………………………………………………....7
3.1.3 图像的灰度变化和边缘检测…………………………………………………10
3.1.4 图像的去噪处理……………………………………………………………….10
3.2 canny边缘检测………………………………………………………………...12
4 螺丝刀检测的软件检测…………………………………………………….........……14
4.1 功能分析与操作界面设计………………………………………………………………...14
4.2 启动画面的实现…………………………………………………………………………...15
4.3 采集图像功能的实现……………………………………………………………………...15
4.4 开始检测功能的实现……………………………………………………………………...16
4.5 功能分析与操作界面设计………………………………………………………………...18
4.6 继续检测功能的实现……………………………………………………………………...19
4.7 定点检测功能的实现……………………………………………………………………...19
4.8 保存功能的实现…………………………………………………………………………...21
4.9 均值测量功能的实现……………………………………………………………………..21
4.10 像素对应尺寸的标定……………………………………………………………………..22
5 总结……………………………………………………………………………………….23
致谢…………………………………………………………………………………………...24
参考文献………………………………………………………………………………………...25