巨志勇, 薛永杰, 张文馨, 翟春宇. 自适应阈值Prewitt的石榴病斑检测算法[J]. 农业工程学报, 2020, 36(8): 135-142. DOI: 10.11975/j.issn.1002-6819.2020.08.017
    引用本文: 巨志勇, 薛永杰, 张文馨, 翟春宇. 自适应阈值Prewitt的石榴病斑检测算法[J]. 农业工程学报, 2020, 36(8): 135-142. DOI: 10.11975/j.issn.1002-6819.2020.08.017
    Ju Zhiyong, Xue Yongjie, Zhang Wenxin, Zhai Chunyu. Algorithm for detecting pomegranate disease spots based on Prewitt operator with adaptive threshold[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2020, 36(8): 135-142. DOI: 10.11975/j.issn.1002-6819.2020.08.017
    Citation: Ju Zhiyong, Xue Yongjie, Zhang Wenxin, Zhai Chunyu. Algorithm for detecting pomegranate disease spots based on Prewitt operator with adaptive threshold[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2020, 36(8): 135-142. DOI: 10.11975/j.issn.1002-6819.2020.08.017

    自适应阈值Prewitt的石榴病斑检测算法

    Algorithm for detecting pomegranate disease spots based on Prewitt operator with adaptive threshold

    • 摘要: 针对传统识别方法对石榴外表病斑及石榴轮廓检测精准度不高、抗噪声能力不强以及存在伪边缘等问题。该文提出一种基于自适应阈值Prewitt算子的石榴病斑检测算法。采用双边滤波减少噪声干扰;通过高频强调滤波提高图像高频分量,增强局部细节;根据高斯噪声概率分布设置算子卷积掩膜元素权重,利用对称性将方向梯度两两组合,并计算其L2范数作为该像素点的梯度。对人工拍摄的607张石榴图像进行图像增强和边缘检测试验,加入椒盐噪声和高斯噪声进行抗噪性能测试。试验结果表明,该文算法对石榴病斑的识别正确率为98.24%,获得图像的峰值信噪比为43.72 dB,单张图像识别耗时为0.174 s。与已有研究相比,识别正确率提高6.68%~9.82%,峰值信噪比提高2.09~6.44 dB,平均耗时减少0.034~0.197 s。该研究具有较好的病害样本与非病害样本区分能力,可为田间环境下石榴病害预防提供参考。

       

      Abstract: Pomegranates are one of the economic fruits in China. The timely detection of pomegranate diseases and the corresponding preventive measures are important to increase crop yields and reduce economic losses. To tackle the issues that traditional edge detection operators usually resulted in low accuracy of the detection of pomegranate diseases and its contour, low anti-noise capability, and created false edges, this study presented an improved Prewitt operator with an adaptive threshold. Firstly, in the image pre-processing stage, the pending image was enhanced by high-frequency emphasize filter, and the high-frequency component, which represented to the details of the pomegranate sample in the image, was increased by the filter. On the contrary, the low-frequency component, which represented to the background of the pomegranate sample, was attenuated to facilitate the following image processing. Since the most original images contained the Gaussian noise, bilateral filtering was used to process the noise present in the image. The weighted average of the brightness values of adjacent pixels was used to represent the intensity of a pixel. The weighted average method was used based on Gaussian distribution. The weight calculation took into account both the Euclidean distance between the pixels and the radiation difference in the pixel range domain to better maintain edge feature information. Secondly, a fifth-order convolutional mask was proposed. The weights of the elements in the mask were set according to the properties of the Gaussian noise probability distribution to reduce the effect of noise on the algorithm. The weight of the central element of the convolutional mask was increased so that the edge information of the image had higher contrast. In terms of gradient calculation, eight direction templates were used to perform the convolutional operation of the image, then the gradient values of each direction were calculated. After that, the corresponding gradient values were obtained, and the gradient values of eight directions were combined into eight groups according to the rule of orthogonality. As a result, there was 90 degrees difference between each group of gradients. Then calculated the L2 norm of each set of gradients, and used the largest value of L2 norm as the gradient of the current pixel. It was shown that it was only necessary to calculate the convolutions in half the direction due to the convolutional results in opposite directions were inverse to each other. The gradients of the rest of the direction could be obtained by its symmetric property. The adaptive threshold was implemented through the minimum error method to decrease the probability of false detection and prune irrelevant details. The mean and variance of the target and background were calculated, meanwhile, the minimum error objective function was obtained according to the principle of the minimum error classification. The value that minimizes the objective function was taken as the optimal threshold. To demonstrate the effectiveness of the method in this paper, 607 test images were manually collected as samples in the natural environment from different angles and different illumination conditions. To further reduce the interference of light changes and suppress background noise, the pending images were converted into grayscale images. Therefore, the algorithm was tested using the converted grayscale images. The experimental results showed that the algorithm proposed in this study achieved a better definition at the edge of the lesion. Compared with the traditional edge detection operator, it achieved a higher recognition accuracy and lower running time. The peak signal to noise ratio of the obtained image was higher, and the obtained edge was complete and accurate. The algorithm proposed in this paper could quickly and accurately detect the area of pomegranate lesions, providing a fundamental reference for the future prevention of pomegranate diseases.

       

    /

    返回文章
    返回