Harvesting is the most time-consuming and laborious process in the production of agricultural fruits and vegetables.The shortage of labor and the increase in labor costs have led to an increase in costs of fruit and vegetable production.The emergence of harvesting robots has improved the production efficiency of fruits and vegetables.Researching harvesting robots is not only of practical significance,but also an inevitable trend of intelligent agriculture and unmanned agriculture.In this paper,a prototype harvesting robot is designed with tomatoes as the harvesting objects by using robot technology,computer vision and image processing.The main research contents and methods are as follows:(1)According to the operation characteristics and requirements of the tomato harvesting robot,the type for controller,robot arm,mobile vehicle and stereo vision system are selected,and the overall of the harvesting robot is designed.(2)The D-H modeling method is used to analyze the kinematics of the mechanical arm of the harvesting robot.The inverse kinematics solution is obtained by algebraic method,which aims to obtain the angles that each joint needs to be rotated.In order to enable the mechanical arm to run smoothly,the trajectory planning is performed in the joint space,and the linear parabolic mixed trajectory planning is compared with the quintic polynomial trajectory planning.(3)Common image denoising methods are compared,and the median filtering is selected according to the results.The color analysis of tomato images in RGB color space is carried out.Based on the analysis results,an OTSU segmentation algorithm based on color difference operator is designed.After morphological processing,the binary images of tomato are obtained.Then the individual fruit is successfully identified by edge detection and centroid extraction.For the overlapping fruits,the tomato region is firstly segmented by OTSU method based on the color difference operator and morphology,and the edge of the segmented color tomato image is detected by the canny operator,whose result performed XOR operation with the image processed by morphology.Corrosion processing after XOR operation can make the separation of covered fruit and uncovered fruit more obvious.For uncovered fruit,the contour is obtained by edge detection.For the covered fruit,the true contour is extracted by the combination of convex hull processing,flood filling and Hough line detection.Finally,the edge of fruits is fitted elliptically by using least square method,and the center of mass of the fruit is calculated.(4)The principle of camera imaging and the conversion relationship between image coordinates,camera coordinates and world coordinates are introduced.The principle of Zhang Zhengyou’s calibration method is described,and the binocular camera is calibrated by MATLAB.The internal parameters of the two cameras and the positional relationship between the two cameras are obtained by calibration.Distortion correction and stereo correction of binocular image using the relevant parameters obtained by calibration.A matching method based on centroid as a feature point is designed.By adding constraints,the centroid points of the same tomato can be mapped one-to-one in the left and right images,and the three-dimensional spatial information of the target tomato is obtained by using the spatial positioning principle.(5)The designed content is simulated and experimented.The experimental results show that the harvesting robot can pick up the tomato fruit placidly and has a high success rate,which verifies the correctness and feasibility of the whole system and related algorithms. |