樱桃小番茄腋芽去除点定位方法研究

2016-10-27 02:03李建平喻擎苍季明东朱松明
农业机械学报 2016年9期
关键词:腋芽角点樱桃

王 萌 李建平 喻擎苍 季明东 朱松明

(1.浙江大学生物系统工程与食品科学学院, 杭州 310058; 2.浙江理工大学信息学院, 杭州 310018)



樱桃小番茄腋芽去除点定位方法研究

王萌1李建平1喻擎苍2季明东1朱松明1

(1.浙江大学生物系统工程与食品科学学院, 杭州 310058; 2.浙江理工大学信息学院, 杭州 310018)

为实现对樱桃小番茄腋芽去除点的精确定位,用蓝色LED光源对目标植株腋芽部位进行照射染色,区分目标植株与背景,提取获得图像的RGB颜色空间B通道分量,分割后得到完整目标图像;通过快速傅里叶变换(FFT),使用低通滤波器去除毛刺和噪声,保留基本轮廓特征;由形态学膨胀算法突出腋芽两侧特征点,通过Shi-Tomasi角点检测算法,找到目标图像角点,再经过特征点判别算法,找到特征点,由此判别腋芽存在与否,定位腋芽去除点,最后摘除腋芽。实验结果表明,腋芽识别成功率为93.94%,腋芽摘除成功率为88.9%,能够满足自动去除的要求。

樱桃小番茄; 腋芽; 去除点定位; 蓝光染色; 角点检测

引言

樱桃小番茄具有较高的经济价值,温室内种植时,需要每隔20 d左右摘除从主茎与侧枝基部之间长出的腋芽,以减少新生腋芽的营养消耗。

目前腋芽采用人工摘除,在大规模种植时,需要投入大量人力,生产成本高。使用摘芽机器人自动摘除腋芽,可减少用工量,且可全天候工作,及时摘除樱桃小番茄腋芽。

为自动摘除腋芽,需要机器人具有自动识别腋芽的能力。为此,需要解决两个关键问题,一是对采集到的图像进行分割。国内外收获机器人通过颜色特征,使用不同的颜色空间识别柑橘、苹果和橄榄[1-4];PAYNE等[5-6]在人工光源辅助下采集接近成熟的芒果图像,利用其在YCbCr颜色空间中的颜色和形状纹理特征识别芒果个数;FONT等[7]借助人工光源采集成熟葡萄图像,在RGB颜色空间,通过计算葡萄表面的球面反射峰值确定葡萄个数;徐惠荣等[8-12]通过颜色模型或灰度特征分割图像,再根据形状特征寻找目标;毛罕平、袁挺等[13-14]利用近红外光谱和可见光谱反射,分割出植物果实。二是从图像中确定腋芽去除点。张铁中等[15-16]用图形学和解析几何方法从图像中提取南瓜幼苗的生长点;吕谷来等[17]提出了利用侧视拍摄的幼苗图像,通过细化和计数像素点,计算砧木高度并提取砧木的抓取点。

由于去芽机器人的作业对象是樱桃小番茄的腋芽,其颜色特征与周围枝干相似,难以利用前述方法进行识别。为了使包含腋芽的目标图像与背景有较显著差别,易于进行图像分割,本文采用蓝色LED光源,对目标植株进行照射染色,在RGB颜色空间进行分割,通过快速傅里叶变换去除图像中的噪声和毛刺,利用形态学分析和角点检测方法找到特征点,识别出腋芽并定位腋芽去除点,最后通过安装在六自由度机械臂末端的气动剪摘除腋芽。

1 试验材料与图像采集系统

试验材料使用荷兰金满园樱桃小番茄植株,试验时植株生长天数为60 d,腋芽长度为3~10 cm。

图像采集系统如图1所示,选用MVC3000B型彩色数字工业摄像头(北京微图图像公司)采集图像;选用1个波长为430 nm的蓝光LED灯为光源,功率为3 W;选用1个光照传感器(广州龙戈电子科技公司),最大量程65 536 lx,测量精度为1%;选用1个KS109型超声波测距传感器,量程为3~10 m,精度为2 mm;软件应用NI公司的LabVIEW 2009、Vision Assistant 1.0和OpenCV 2.4。

图1 图像采集系统示意图Fig.1 Sketch map of image acquisition system1.光照传感器 2.蓝色LED光源 3.工业摄像头 4.樱桃小番茄植株 5.超声波测距传感器 6.气动剪 7.六自由度机械臂

图1中,l是摄像头镜头与樱桃小番茄主茎的距离,当l=13 cm时,无叶片遮挡且获得的图像完整。

2 图像采集与处理

2.1蓝色光源染色与图像获取

图像采集时,为突出目标,减少背景干扰,使用蓝色LED光源对目标进行照射染色(图2a),使其与周围枝干、叶片有颜色差异,提取RGB颜色空间中蓝色通道(B通道)的分量图(图2b)。通过对其灰度图纵坐标值进行对数变换,发现峰谷较为明显(图2d),选取最小谷底值为阈值[18-19]进行分割,得到完整的目标图像(图2c),但图像存在噪声和毛刺。

图2 蓝色光源照射采集的图像Fig.2 Image of blue light source illumination

2.2毛刺去除

利用二维快速傅里叶变换(FFT)将阈值分割后的图像转换为频谱图,并将图像低频部分集中在频谱图中心,高频部分向外延伸[20-21]。由于图像的基本外形轮廓特征在低频部分,噪声和毛刺处于高频部分。使用低通滤波器,将频谱图中高频部分过滤,留下低频部分。滤波器传递函数计算式为

(1)

其中

fc=λfmax

(2)

式中C(f)——低通滤波器传递函数

f——频率fc——截止频率

fmax——图像中的最大频率

λ——通过率,%

设置通过率作为区分高频与低频的阈值,通过率从图像中最大频率fmax的100%(未滤波)逐次递减,滤波后再进行FFT逆变换。通过对多幅图像处理发现,通过率λ为2.8%时,滤波效果最好,噪声与毛刺消失,基本保留了原图像的轮廓(图3)。

当原图中毛刺较粗或过于密集时,滤波后的目标物体边缘会产生起伏和形变,如图3a所示,但并不影响后续处理。

图3 图像低通滤波效果Fig.3 Results in low-pass filter

2.3角点检测

角点是轮廓上高曲率的点,是重要的局部特征。宗泽等[22]通过茎叶角点计算玉米株叶倾角,杨蜀秦等[23]利用角点检测算法识别籽粒尖端。

腋芽分别与主茎、侧枝形成两个夹角,夹角的顶点就是角点,两个角点连线中点即为腋芽去除点。图像中也会存在其他角点,为便于区别,把由腋芽与主茎、侧枝形成的角点,称为腋芽的特征点,将其他角点称为干扰点。

使用7×7十字结构元素,对低通滤波后的图像进行膨胀运算,增大特征点的曲率(图4)。提高角点检测算法的阈值,降低算法敏感性,可排除一部分曲率较低的干扰点,保留包括特征点在内的高曲率角点。用Shi-Tomasi角点检测算法[24]对图4进行遍历,阈值设定为0.4,检测到4个角点。其中,角点A、B为干扰点,角点Pl、Pr为特征点。从所有角点中提取出特征点Pl、Pr,做进一步的判别。

图4 角点检测结果Fig.4 Corner detection results

2.4特征点判别

根据主茎和腋芽的直径,设定Δxmin=1.3 mm、Δxmax=2 mm、Δymax=2 mm。

为了判别特征点,将检测出的角点存入数组A[P1(x1,y1),P2(x2,y2), …,Pn-1(xn-1,yn-1),Pn(xn,yn)]。若数组中只有1个点,可判定无腋芽;如果输出2个或2个以上角点,则将所有角点两两成对根据判定条件分别进行判别:若无成对符合条件的特征点,说明不存在腋芽;若有一对符合条件的特征点,说明存在唯一腋芽;若有多对符合条件的特征点,说明存在多个腋芽。

2.5腋芽去除点确定

当成功提取到一对或多对特征点时,可得到腋芽去除点的位置,即

(3)

式中xc、yc——去除点的坐标值

2.6腋芽去除

去除腋芽前需将图像坐标转换为世界坐标,因此,需对摄像头进行标定。标定结果:焦距为(455.848 89,456.544 61);主点为(113.877 53,120.542 51);像素点倾斜度为零;镜头畸变系数矩阵为[-0.175 27-0.195 28-0.002 11-0.003 840.000 0]。

去芽机器人运行时,先通过机械臂上的测向机构自动确定樱桃小番茄侧枝方向,摄像头绕主茎旋转到由樱桃小番茄主茎、侧枝与腋芽所组成平面的正面,避免腋芽被主茎或侧枝遮挡。如图5所示,将机械臂的基坐标系ObXbYbZb作为世界坐标系原点。根据各关节的角度和长度得到末端坐标为(xm,ym,zm),气动剪的坐标为(xm,ym-15,zm+190),摄像头坐标为(xm,ym+45,zm+175)。通过摄像头内、外参数和距离l得到腋芽去除点的世界坐标(xo,yo,zo)后,控制机械臂末端执行器上的气动剪,在腋芽去除点处剪断腋芽。

图5 坐标与尺寸关系Fig.5 Relationship between coordinates and dimensions

3 试验与分析

在试验中,采集了132幅图像,其中有腋芽的图像90幅,无腋芽的图像42幅。

通过对有腋芽的图像进行处理,能够正确识别出82幅图像有腋芽生长;无腋芽的图像正确识别42幅。腋芽识别成功率为93.94%。

将机器视觉自动定位确定的腋芽去除点与人眼观察得到的腋芽生长点进行对比后发现,两点坐标平均距离为9.37 mm(最大值为16.98 mm,最小值为3.2 mm),原因是经过膨胀运算后,虽然突出了特征点,却使目标图像发生形变,令腋芽去除点的位置相对于生长点向外延伸(图6a),图6c为摘除腋芽后的留茬长度。按照农艺要求,腋芽留茬在1 cm左右,符合要求。

图6 试验结果Fig.6 Experimental results

试验中,90个有腋芽样本,成功识别出82个样本,成功摘除腋芽的有80个样本,摘除成功率为88.9%。

个别情况下,腋芽与侧枝之间夹角过小时(图6b),经膨胀运算后,两特征点水平距离和垂直距离均大于判别算法中Δxmax和Δymax,导致无法识别出腋芽。经统计,这种情况出现概率不足2%。另一种情况是腋芽过于细小,2个特征点X轴向距离小于Δxmin,可待腋芽长大后进行识别。

4 结论

(1)采用蓝色LED光源对目标染色,能够解决樱桃小番茄枝干与背景颜色相似而不易被区分的问题;提取B通道分量,取灰度直方图最小谷底值为阈值进行图像分割,实现对樱桃小番茄侧枝基部图像的完整采集。

(2)通过快速傅里叶变换将图像转换为频域图,再使用低通滤波器滤波,通过率λ为2.8%时,可有效去除噪声和毛刺,保留枝干的基本特征,便于图像后续处理。

(3)利用形态学膨胀运算凸显腋芽特征点,再用Shi-Tomasi角点检测算法,可准确检测出图像上包括特征点在内的所有角点位置,防止算法遗漏特征点,造成判别失败。

(4)使用特征点判别条件可识别是否生长腋芽,准确定位腋芽去除点。在试验中,判别腋芽成功率达到了93.94%;腋芽摘除成功率为88.9%,满足农业要求。

1BULANON D M, KATAOKA T. Fruit detection system and an end effector for robotic harvesting of Fuji apples [J]. Agricultural Engineering International: CIGR Journal, 2010, 12(1): 203-210.

2KONDO N, MONTA M, OGAWA Y. Cutting providing system and vision algorithm for robotic chrysanthemum cutting sticking system [C]∥Proceeding of the International Workshop on Robotics and Automated Machinery Bio-productions, 1997: 7-12.

3CHOIK, LE E G, HAN Y J, et al. Tomato maturity evaluation using color image analysis [J]. Transactions of the ASAE, 1995, 38(1): 171-176.

4GABRIEL GATICA C, STANLEY BEST S, JOSE’ CERONI, et al. A new method for olive fruits recognition [C]∥Proceedings of International Conference on Progress in Pattern Recognition, Image Analysis, Computer Vision and Applications, 2011: 646-653.

5PAYNE A B, WALSH K B, SUBEDI P P, et al. Estimation of mango crop yield using image analysis—Segmentation method [J]. Computers and Electronics in Agriculture, 2013,91: 57-64.

6PAYNE A B, WALSH K B, SUBEDI P P, et al. Estimating mango crop yield using image analysis using fruit at stone hardening’ stage and night time imaging [J]. Computers and Electronics in Agriculture, 2014,100: 160-167.

8徐惠荣,叶尊忠,应义斌. 基于彩色信息的树上柑橘识别研究[J]. 农业工程学报, 2005, 21(5): 98-101.

XU Huirong, YE Zunzhong, YING Yibin. Identification of citrus fruit in a tree canopy using color information [J]. Transactions of CSAE, 2005, 21(5): 98-101. (in Chinese)

9赵海波,周向红. 基于计算机视觉的番茄催熟与正常熟识别[J]. 农业工程学报, 2011, 27(2): 355-359.

ZHAO Haibo, ZHOU Xianghong. Recognition of artificial ripening tomato and nature mature tomato based on computer vision [J]. Transactions of the CSAE, 2011, 27(2): 355-359. (in Chinese)

10李斌,WANG Ning,汪懋华,等. 基于单目视觉的田间菠萝果实识别[J]. 农业工程学报,2010,26(10):345-349.

LI Bin, WANG Ning, WANG Maohua, et al. In-field pineapple recognition based on monocular vision [J]. Transactions of CSAE, 2010, 26(10): 345-349. (in Chinese)

11毛亮,薛月菊,孔德运,等. 基于稀疏场水平集的荔枝图像分割算法[J]. 农业工程学报,2011,27(4):345-349.

MAO Liang, XUE Yueju, KONG Deyun, et al. Litchi image segmentation algorithm based on sparse field level set [J]. Transactions of CSAE, 2011, 27(4): 345-349. (in Chinese)

12熊俊涛,邹湘军,陈丽娟,等. 基于机器视觉的自然环境中成熟荔枝识别[J]. 农业机械学报,2011,42(9):162-166.

XIONG Juntao, ZOU Xiangjun, CHEN Lijuan, et al. Recognition of mature litchi in natural environment based on machine vision [J]. Transactions of the Chinese Society for Agricultural Machinery, 2011, 42(9): 162-166. (in Chinese)

13毛罕平,李明喜. 基于多源机器视觉信息融合的番茄目标匹配[J]. 农业工程学报,2009, 25(10): 142-147.

MAO Hanping, LI Mingxi. Tomato target matching based on multi-sensors machine vision information fusion [J]. Transactions of the CSAE, 2009, 25(10): 142-147. (in Chinese)

14袁挺,李伟,谭豫之,等.温室环境下黄瓜采摘机器人信息获取[J].农业机械学报, 2009, 40(10): 151-155.

YUAN Ting, LI Wei, TAN Yuzhi, et al. Information acquisition for cucumber harvesting robot in greenhouse [J]. Transactions of the Chinese Society for Agricultural Machinery, 2009, 40(10): 151-155. (in Chinese)

15张铁中,魏剑涛. 蔬菜嫁接机器人视觉系统的研究(I):用图像形态学方法检测瓠瓜苗生长点[J]. 中国农业大学学报,1999,4(4):45-47.

ZHANG Tiezhong, WEI Jiantao. Study on vision system of vegetable grafting robot (I): searching for growth point of cucurbit seedling with morphological method [J]. Journal of Chinese Agricultural University, 1999, 4(4): 45-47. (in Chinese)

16张铁中,魏剑涛. 蔬菜嫁接机器人视觉系统的研究(II):用解析几何方法检测南瓜苗生长点[J]. 中国农业大学学报,1999,4(4):48-50.

ZHANG Tiezhong, WEI Jiantao. Study on vision system of vegetable grafting robot (II): searching for growth point of pumpkin seedling with geometrical method [J]. Journal of Chinese Agricultural University, 1999, 4(4): 48-50. (in Chinese)

17吕谷来,李建平,李锵,等. 基于机器视觉的砧木定位识别方法[J]. 浙江大学学报:工学版,2011,45(10):1766-1770.

LÜ Gulai, LI Jianping, LI Qiang, et al. Method for rootstock position recognition based on machine vision [J]. Journal of Zhejiang University:Engineering Science, 2011, 45(10): 1766-1770. (in Chinese)

18PREWITT J M S, MENDELSOHN M L. The analysis of cell images [J]. Annals of the New York Academy of Sciences, 1966, 128(3): 1035-1053.

19GLASBEY C A. An analysis of histogram-based thresholding algorithms [J]. Cvgip Graphical Models and Image Processing, 1993,55: 532-537.

20RAO K R, KIM D H, HWANG J J. 快速傅立叶变换:算法与应用[M]. 万帅,杨付正,译. 北京:机械工业出版社,2010.

21苗中华,沈一筹,王小华,等. 自然环境下重叠果实图像识别算法与试验[J]. 农业机械学报,2016,47(6):21-26.

MIAO Zhonghua, SHEN Yichou, WANG Xiaohua, et al. Image recognition algorithm and experiment of overlapped fruits in natural environment[J]. Transactions of the Chinese Society for Agricultural Machinery, 2016,47(6):21-26. (in Chinese)

22宗泽, 张雪, 郭彩玲, 等. 基于骨架提取算法的作物表型参数提取方法[J]. 农业工程学报, 2015, 31(增刊2): 180-185.

ZONG Ze, ZHANG Xue, GUO Cailing, et al. Crop phenotypic parameters extraction method based on skeleton extraction algorithm [J]. Transactions of the CSAE, 2015, 31(Supp.2): 180-185. (in Chinese)

23杨蜀秦,宁纪锋,何东健.基于Harris算子的籽粒尖端识别方法[J]. 农业机械学报, 2011, 42(3): 166-169.

YANG Shuqin, NING Jifeng, HE Dongjia. Identification of tip cap of agricultural kernel based on Harris algorithm [J]. Transactions of the Chinese Society for Agricultural Machinery, 2011, 42(3): 166-169. (in Chinese)

24SHI J, TOMASI C. Good features to track[C]∥Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 1994: 593-600.

25张成梁,李蕾,董全成,等. 基于颜色和形状特征的机采棉杂质识别方法[J]. 农业机械学报,2016,47(7):28-34.

ZHANG Chengliang, LI Lei, DONG Quancheng, et al. Recognition method for machine-harvested cotton impurities based on color and shape features[J]. Transactions of the Chinese Society for Agricultural Machinery, 2016,47(7):28-34. (in Chinese)

Positioning Method of Axillary Bud Removal Point for Cherry Tomato

Wang Meng1Li Jianping1Yu Qingcang2Ji Mingdong1Zhu Songming1

(1.CollegeofBio-systemsEngineeringandFoodScience,ZhejiangUniversity,Hangzhou310058,China2.SchoolofInformaticsandElectronics,ZhejiangSci-TechUniversity,Hangzhou310018,China)

The existence of axillary buds of cherry tomato growing between stem and branches will waste nutrients, resulting in a decrease in production. So they should be removed regularly. At present, they are removed manually, which increases the cost of production greatly. Using robots instead of by hands can reduce the costs. The key issue was the position of cherry tomato buds growing point detected by machine vision. An image processing method based on blue light staining was proposed. A monocular camera assisted with ultrasonic displacement sensor was used for capturing images and getting the 3D coordinate of axillary bud growing point. It was difficult to segment image, because the color of the axillary buds, branches and stems of cherry tomato was same to those of background. A blue LED light source was used to irradiate the axillary buds in order to dye the buds blue. The background was the other tomato plants whose color was green, so it was easy to extract the object from image. The image collected was complete, when the distance between the LED light source and the plant was 13 cm.Bcomponent image in RGB spatial domain was a gray image and its histogram was bimodal. The gray value was selected as a threshold, and then the image was segmented, the outline of the object could be gotten clearly. However, there were burrs on the edge of the outline, so the gray image should be translated into frequency-domain diagram by fast Fourier transform (FFT). A low pass filter was used to filter out the burrs at high frequency, and the outline at low frequency was retained. The cutoff frequency was set to 2.8% of the maximum frequency of the image. After the inverse transformation, the burrs could be removed completely. Deformation would occur at the edge of the contour, but it did not affect the subsequent processing. The corner points at both ends of the axillary bud were key feature points. In order to highlight the characteristics of the key feature points, the morphological dilation of image was processed by the 7×7 cross structure element. Then all the corners on the image were found out by using the Shi-Tomasi corner detection algorithm. A discriminant condition was set after analyzing the growth characteristics of cherry tomato axillary buds. Then all the corners were iterated over, if there were two corners in accordance with the discriminant requirement, then the two points were the key feature points, and the mid-point of the two points was the axillary bud growth point. If there was not a couple of corners meet the requirement, then there was no axillary bud growth. If there were two couples corner points meet the discriminant requirement, it showed that there were two buds. There were errors between the axillary bud growth points located by the images and actual points. The error could be accepted since it was within 1 cm. 90 images of cherry tomato plants with axillary buds growing were identified, 82 images could be detected the axillary bud successfully, the correct recognition rate was 93.94%. After the removal of axillary buds, stubble length less than 1 cm accounted for 88.9%.

cherry tomato; axillary bud; location of removal point; blue-light coloration; corner detection

10.6041/j.issn.1000-1298.2016.09.004

2016-03-14

2016-04-01

国家自然科学基金面上项目(51375460)和浙江省科技厅公益技术应用研究计划项目(2014C32105)

王萌(1982—),男,博士生,主要从事农业机器人研究,E-mail: 10913005@zju.edu.cn

李建平(1962—),男,教授,博士生导师,主要从事农业机械与自动化研究,E-mail: jpli@zju.edu.cn

TP391.41

A

1000-1298(2016)09-0023-06

猜你喜欢
腋芽角点樱桃
生长素调控植物腋芽发育的研究进展
樱桃肉,让年味飘香
茶树带腋芽茎段组织培养研究
一树樱桃带雨红
基于FAST角点检测算法上对Y型与X型角点的检测
仲丁灵对西瓜腋芽内源激素的影响
甘蔗腋芽外植体生长影响因素分析
吃不到的樱桃
基于边缘的角点分类和描述算法
基于圆环模板的改进Harris角点检测算法