数字图像处理——隐形眼镜缺陷检测算法
摘 要:本文致力于寻找出一种具有较强鲁棒性的检测隐形眼镜边缘缺陷的方法。本文针对图像中物体几何形状的特殊性,提出了一种基于霍夫变换的缺陷检测算法,并在低噪声图像的缺陷检测中取得了不错的效果。在此过程中,本文还分别对残缺图像、大缺陷图像以及含椒盐噪声的图像进行了实验,仅通过改变预处理的一些步骤就可达到相同的检测效果,验证了该算法的鲁棒性。
关键词:霍夫变换;边缘检测;缺陷检测;机器视觉;图像处理
Abstract: This paper aims to find a robust method to detect the edge defects of contact lenses. In this paper, a defect detection algorithm based on Hough transform is proposed according to the particularity of object geometry in the image, and good results are obtained in the defect detection of low noise image. In this process, experiments are carried out on incomplete images, large defect images and images with salt and pepper noise. The same detection effect can be achieved only by changing some steps of preprocessing, which verifies the robustness of the algorithm.
Key Words: Hough transform; edge detection; defect detection; machine vision; image processing
目录
摘要
随着现代工业的发展,基于机器视觉的缺陷检测方法在工业生产中有着极大的应用空间。然而在实际的缺陷检测过程中,由于硬件设施的局限性与环境的复杂性,不得不考虑各种例如相机畸变、信号传输或者灰尘污染等实际问题带来的干扰。本文主要考虑了三种干扰情况:图像残缺,大缺陷物件,椒盐噪声[4]。这三类情况对算法鲁棒性的要求都相对较高。因此,开发一种满足较强鲁棒性的缺陷检测算法,是亟待解决的关键问题。
隐形眼镜图像缺陷检测方法
理想图像的缺陷检测
图1为一张存在缺陷的隐形眼镜图像,隐形眼镜的右下角存在缺陷。需要将缺陷检测出来,首先应该确定缺陷的定义。
由图像可知,图像中半径与其他边缘点不同的地方即为缺陷。检测问题就可以转化为如何求得隐形眼镜的圆心与半径。本文采用霍夫变换圆检测方法来确定圆心与半径,并取得了不错的实验效果。

图1 存在缺陷的隐形眼镜图像
由于霍夫变换输入的是图像的二值化边缘图,由此需要先对图像进行一点预处理,将隐形眼镜的边缘提取出来。对于图1,笔者采用了Prewitt算子提取边缘信息。Prewitt算子是一种一阶微分算子,利用像素点上下左右邻点灰度差,在边缘处达到极值检测边缘,对噪声具有平滑的作用。
对数字图像 f ( x , y ) f\left(x,y\right) f(x,y),有如下公式:
G ( i ) = ∣ [ f ( i − 1 , j − 1 ) + f ( i − 1 , j ) + f ( i − 1 , j + 1 ) ] − [ f ( i + 1 , j − 1 ) + f ( i + 1 , j ) + f ( i + 1 , j ) + f ( i + 1 , j + 1 ) ] ∣ ( 1 ) G\left(i\right)=\left|\left[f\left(i-1,j-1\right)+f\left(i-1,j\right)+f\left(i-1,j+1\right)\right]-\left[f\left(i+1,j-1\right)+f\left(i+1,j\right)+f\left(i+1,j\right)+f\left(i+1,j+1\right)\right]\right| (1) G(i)=∣[f(i−1,j−1)+f(i−1,j)+f(i−1,j+1)]−[f(i+1,j−1)+f(i+1,j)+f(i+1,j)+f(i+1,j+1)]∣(1)
G ( j ) = ∣ [ f ( i − 1 , j + 1 ) + f ( i , j + 1 ) + f ( i + 1 , j + 1 ) ] − [ f ( i − 1 , j − 1 ) + f ( i , j − 1 ) + f ( i + 1 , j − 1 ) ] ∣ ( 2 ) G\left(j\right)=\left|\left[f\left(i-1,j+1\right)+f\left(i,j+1\right)+f\left(i+1,j+1\right)\right]-\left[f\left(i-1,j-1\right)+f\left(i,j-1\right)+f\left(i+1,j-1\right)\right]\right| (2) G(j)=∣[f(i−1,j

最低0.47元/天 解锁文章
524





