为解决传统边缘检测算法对大米图像边缘检测精度低以及对噪声敏感的问题,提出一种改进的Canny边缘检测算法。该方法首先采用非线性扩散滤波减少图像噪声,同时保持图像的边缘信息;在邻域梯度幅值计算中,考虑像素对角线方向的梯度,进一步抑制噪声的影响;最后采用最大类间方差法选取阈值,从而提高对不同图像的自适应性。通过对实验图像的分析表明,本文的改进算法运用到大米图像边缘提取中效果显著,满足大米质量检测和分级的要求。
In this paper,an improved canny edge detection algorithm was represented to solve traditional edge detection algorithm in rice edge detection which had low precision and noise sensitive.Firstly,nonlinear diffusion filter was used to wipe of noise efficiently and kept the edge information of the image.Secondly,gradient calculation of pixel diagonal direction was considered in the calculation of neighborhood gradient amplitude which further repressed the impact of noise.Thirdly,using average interclass variance could self-adaptively calculate the double thresholds for different images.The results of the experiment indicate that the improved algorithm not only can be applied to rice image edge detection but also has a better accuracy and precision in the edge detection.