Integration of stereo vision system calibration and kinematic calibration for an autonomous kiwifruit harvesting system

Stereo vision system and manipulator are two major components of an autonomous fruit harvesting system. In order to raise the fruit-harvesting rate, stereo vision system calibration and kinematic calibration are two significant processes to improve the positional accuracy of the system. This article reviews the mathematics of these two calibration processes and presents an integrated approach for acquiring calibration data and calibrating both components of an autonomous kiwifruit harvesting system. The calibrated harvesting system yields good positional accuracy in the laboratory tests, especially in harvesting individual kiwifruit. However, the performance is not in line with the outcomes in the orchard field tests due to the cluster growing style of kiwifruit. In the orchard test, the calibrations reduce the fruit drop rate but it does not impressively raise the fruit harvesting rate. Most of the fruit in the clusters remain in the canopy due to the invisibility of the stereo vision system. After analyzing the existing stereo vision system, a future visual sensing system research direction for an autonomous fruit harvesting system is justified.


Introduction
The growing New Zealand kiwifruit industry has achieved export sales of $2.599 billion NZD during the 2020/21 season (Zespri 2020) and the revenue is expected to be $6 billion NZD by 2030 (NZKGI 2020). With this rapid growth, kiwifruit growers are experiencing challenges associated with labour shortages and rising labour costs. Labour shortages have become apparent during the 2018 harvesting season, as declared by the New Zealand Ministry of Social Development of an official seasonal labour shortage of 1200 people for six weeks (Msd 2018). This shortage is likely to worsen with a projected 7000 more seasonal workers required for the kiwifruit industry by 2027 (NZKGI 2018). The second problem is rising labour costs. Pruning, thinning, and picking wages make up approximately half of the total orchard working expenses based on a 2011/12 orchard model. The New Zealand minimum wage has significantly increased recently. The Government has largely increased the minimum wage by 2021 (Statistics New Zealand 2018). Of the 2021 labour expenses, pruning wages are the greatest at $9,700 NZD/ha, followed by picking wages at $3,922 NZD/ha (Mpi 2021).
Robotics and automation in agriculture can play a key role in the long-term solution to both the labour shortage and rising labour cost. As a result, an autonomous kiwifruit harvesting system is developed in-house as shown in Fig. 1. The configuration parameters of this harvesting system can be found in references (Williams et al. 2019(Williams et al. , 2020. The system consists of four identical modules. Each module has a robot and a stereo vision system. The robot has a manipulator for moving the gripper, which grabs the kiwifruit and a corrugated tube for delivering the kiwifruit to the container. Although each module has a stereo vision system, it is not just dedicated to the robot of that module. The information gathered by the stereo vision system in each module will be merged together by a scheduler, which assigns the fruit to be harvested to each robot. This approach can fully utilize the resources to complete the task with the minimum time.
This autonomous kiwifruit harvesting system has been employed for fruit harvesting in various kiwifruit orchards. The harvesting task by robot in an orchard is quite similar to the pick and place operation in the manufacturing environment, but it is more challenging due to uncontrollable dynamic conditions in orchards. For instance, no two canopies are the same, the robot base is not fixed as it has to navigate the orchards with many obstacles to delicately grab and place a fruit.
One of the significant factors that affects the economic viability of the system is the successful harvesting rate of the total detached fruit. All the fruit left in the canopy and dropped on the ground are considered unsuccessful harvesting, and thus, dropped kiwifruit during harvesting have a significant impact on the orchard profit. Fruit drop study is commissioned to investigate the number and causes of unsuccessful harvesting. A total of 1456 harvesting attempts under various operation conditions in ten hours of video footage is watched and recorded manually. The attempts are categorized into picked, dropped and unharvested as listed in Table 1.
The main reason for fruit left in the canopy and dropping on the ground is position error between the gripper and the fruit location. This is a combination of inaccuracies due to fruit localization by the stereo vision system, kinematics of the robot and the coordination between the vision system and the robot. Calibration is one of the approaches to remedy these inaccuracies.
This article presents an integrated approach to obtain the calibration data and perform these calibration processes for the autonomous kiwifruit harvesting system so that its positional errors are reduced. Field tests are carried out in the kiwifruit orchard. The performance of the calibrated harvesting system has shed light on future visual sensing system research for an autonomous fruit harvesting system.

Related work
Various robots are developed for harvesting different fruits such as tomatoes (Liu et al. 2015), strawberry (Xiong et al. 2020), apples (Silwal et al. 2017), kiwifruit (Mu et al. 2020) etc. These robots are demonstrated in the lab environment and they are prototypes for design concept proofs. Most of them are just one robot arm with a camera for sensing a target fruit. They are not fully autonomous to sense over hundreds of fruits in the canopy simultaneously and determine the harvesting order.
In order to develop an industrial scale autonomous harvesting system, harvesting speed and successful harvesting rate are two major factors to be considered. The system should have multiple robot arms to perform the harvesting task simultaneously so that the harvesting speed is  1 3 comparable with the manual harvesting speed. This implies that the canopy view captured by the sensing system such as a set of stereo vision systems must be as much as possible, since an autonomous robotic system for kiwifruit harvesting must first perceive and then correctly position the gripper precisely to perform a task. Furthermore, a scheduler is required for efficient fruit assignment to each robot. The information flow for harvesting kiwifruit with four modules is outlined in Fig. 2. The harvesting robotic system is positioned under the canopy to capture the kiwifruit distribution. The canopy is imaged by both camera L and R of the stereo vision system in each module. Since the images obtained from the cameras are distorted due to the lens geometrics, the images will be undistorted before the kiwifruit are detected based on the calyx recognition by using a fully convolution neural network (FCNN). The positions of the detected kiwifruit are calculated with respect to the world frame. These positions from each module are fed into a scheduler so that all the fruit positions are merged. Then the kiwifruit is assigned to each robot arm for harvesting based on the minimum distance between the fruit and the current gripper position. Once the kiwifruit picking order is scheduled, the corresponding fruit position with respect to the world frame is transformed to the robot base frame. For each fruit position, the joint parameters are computed by inverse kinematics. The arm attempts to drive the gripper to harvest the kiwifruit when it receives the joint parameters sequentially.
The high successful harvesting rate refers to positioning the gripper accurately to the target kiwifruit for detachment from the canopy. When there is a discrepancy between the gripper position and the actual kiwifruit position, the fruit may not be correctly grabbed. These errors in the system have a negative impact on the successful harvest rate which determine the economic viability of the robotic system. A common approach for mitigating the positional inaccuracies is through calibration so that positional difference between the commended position and the actual position is reduced. Stereo vision system calibration, kinematic calibration and world-robot base frame transformation estimation are the major calibrations for reducing the positional inaccuracies. A stereo vision system consists of two cameras for sensing the depth information of a point. The computation is only related to the image locations in two cameras with their intrinsic and extrinsic parameters (Feng and Fang 2021). As a result, camera calibration is needed to obtain these parameters prior to the stereo vision system calibration. A pinhole camera model is used for modelling a camera (Brown 1971) which relates a 3D point with its image location on the image plane by a projection matrix. The pinhole camera model is not directly applicable when the camera lens causes a nonlinear distortion in the image. A simplified polynomial model (Tsai 1987;Zhang 2016) is used for image undistortion so that the computation efficiency can be raised. The parameters of this model have to be estimated together with the camera intrinsic and extrinsic parameters using Levenberg-Marquardt Algorithm (Zhang 2016;Moré 1987). The calibration process is equivalent to estimating the projection matrix using a set of 3D calibration points and their corresponding image locations. Various methods are employed to acquire the calibration points from a calibration tool (Tsai 1987;Zhang 2016).
Calibrating a stereo vision system refers to estimating the relative position and orientation of one camera with respect to the other camera. This can be determined from their orientations and positions obtained in the individual camera calibration procedures (Zhang et al. 2009;Cui et al. 2016). On the other hand, this information is also completely described by the epipolar geometry of the stereo vision system (Zhang 1998) which relates the image locations on the right and left image plane of a 3D point by a fundamental matrix. The orientation and position of one camera expressed in the other camera coordinate frame can be obtained directly from the fundamental matrix (Zhang 2016). Furthermore, stereo camera calibrations are also developed based on the neutral network relating the 3D point with its image location (Memon and Khan 2010). It is not necessary to model the distortion separately in this approach, but the noise and instabilities are also included in the network.
The major error in the position and orientation of the end-effector is due to the robot component tolerances and clearances which are termed geometric variation. The error can be expressed in terms of the geometric variation through the kinematic model of a robot. Kinematic calibration is a process of obtaining the geometric variation of a robot so that the error of the end-effector position and orientation is minimized. The kinematic model of a robot depends upon its mechanical structure. For instance, it can be obtained by using Denavit-Hartenberg parameters (Rocha et al. 2011). On the other hand, the non-geometric parameters such as the manipulator stiffness (Lightcap et al. 2008) and the compliance in the joints can also be included in the kinematic model (Nubiola and Bonev 2013). As a set of calibration points is needed for calibration, various methods are proposed to acquire these points. These include dial gauges (Xu and Mills 1999), laser trackers (Park et al. 2008) and 3-D camera (Motta et al. 2001) etc.
In summary, the modelling of various calibrations with the calibration data leads to a system of linear equations. In order to eliminate the noise influence, this system of linear equations is overdetermined. The research focuses on the autonomous robotic system accuracy including the coverage of the process and component models, computation efficiency of solving the system of equations and approaches of acquiring calibration data so that the error accumulation can be minimized.

Mathematical models for calibration
The mathematics for formalizing the calibration of the stereo vision system, kinematic and integration of both systems are briefed. Figure 3 depicts the configuration of a module which is part of the autonomous kiwifruit harvesting system. The robot has a manipulator and a gripper while the stereo vision system consists of two cameras R and L. There are four coordinate frames. F w is the world frame, F b is the robot base frame, F r and F l are the frame of camera R and L respectively. Furthermore, the frame F r of camera R is also the stereo vision system frame. The relationships among these four frames F w , F b , F r and F l are: A point Q located on the xy plane of world frame F w has a position vector Q w = x w y w 0 T . Its image q is on the image plane which is at the focal length f along the z axis of the camera frame F r . It has a position vector q r = u r v r T and q l = u l v l T on the image plane of camera R and L with point o r and o l as the origin of the pixel frame respectively. The principal point, where the optical axis pierces the image plane, is at o x , o y from the origin o.
The stereo vision system calibration is split into two parts. The calibrations are performed on the cameras in the stereo vision system and the system itself.

Camera calibration
Camera calibration is to obtain the intrinsic and extrinsic parameters of the cameras. The intrinsic parameter matrix is which consists of the pixel focal lengths f x and f y of the camera (focal length f) in x and y direction of the image plane. The extrinsic parameters are the orientations and positions of the cameras.
Consider a point on the xy plane of the world frame F w so that its z coordinate is zero. Camera R is at an orientation r w R = r w r 1 r w r 2 r w r 3 and a position r w t The point Q at x w , y w , 0 in the world frame is related to its image q at (u, v) in the pixel frame on the image plane as where s is a scale factor and H = h 1 h 2 h 3 is the homography projection matrix and h T i is the i-th row of homography H . The pixel coordinates (u, v) are un-distorted using Levenberg-Marquardt algorithm (Weng et al. 1992). The homography H is computed by stacking Eq. (3) for each calibration point Q i w (i = 1, 2, …, n ) from a single view yields a system of homogenous equations where A h is a n × 9 coefficient matrix and h = homography H can be estimated by solving Eq. (4). On the other hand, the homography H can also be expressed as The intrinsic parameter matrix K and extrinsic parameters r w R and r w t of a camera can be decomposed from homography H using a number of m (m ≥ 2) views. Each view j has a different homography H j (and so do R j and t j ). However, K is the same for all views. The homography for each view, Letting w The extrinsic parameters for view j can be computed using

Stereo vision system calibration
The orientation and position of a camera in the stereo vision system relative to the other is estimated during the stereo vision system calibration process. As shown in Fig. 3, frame F r of camera R is the stereo vision system frame, l r R and l r t are the orientation and position of camera L expressed in the frame F r of camera R such that l r T = l r R l r t 0 1 . K r and (2)) of camera L and R respectively, then By substituting n pairs corresponding image points in Eq. (10), the components of fundamental matrix F can be formulated a set of homogenous equations where A f is a n × 9 coefficient matrix and f = . The estimated fundamental matrix F are obtained by solving Eq. (11) which also gives the essential matrix E . Consequently, the orientation l r R and position l r t of camera L expressed in the frame F r of camera R is calculated from E using single value decomposition.
where T x is the skew-symmetric matrix of l r t.

Kinematic calibration
The end-effector location Q b with respect to the robot base frame F b is expressed in terms of the robot geometric a and joint parameters , The position error ΔQ b of the end-effector due to a set of identified geometric variation Δa is given by where J is the Jacobian matrix of the kinematic model f . The kinematic calibration is to determine the robot geometric variation Δa so that the position error ΔQ b is eliminated.
Using a set of n end-effector locations at various corresponding joint parameters, Eq. (14) can be expressed in form of a set of homogeneous equations with geometric variation Δa = Δa 1 ⋯ Δa m T (where m is the number of identified geometric variations) and J i is the Jacobian matrix of kinematic Hence, the geometric variation Δa can be estimated by solving Eq. (15).

Integration calibration
The stereo vision system in the autonomous robotic system returns the coordinates of a target location with respect to its frame F r . These coordinates are transformed into the world frame F w by the transformation matrix r w T (obtained from the camera calibration) so that locations from various stereo vision systems are merged together in the world frame for harvesting scheduling. However, the robot control modules orientates and moves the end-effector to a target location expressed in the robot base frame F b . The world-robot base frame transformation is a process that binds the domain of locations (expressed in the world frame) perceived by the stereo vision system with the domain of end-effector target locations in robot base frame. These two tasks need to be integrated by a transformation matrix w b T , which is estimated based on a set of n calibration points.
A set of n points Q i ( ∀i = 1, ⋯ , n ) expressed in the world frame with position vector Q i w = x i w y i w z i w T , ∀i = 1, ⋯ , n and the robot base frame with position vector T , ∀i = 1, ⋯ , n are employed to establish the transformation matrix. A rigid correspondence between these two sets of coordinate expression (i.e. point Q i is always expressed as Q i b in robot base frame F b and Q i w in world frame F w ∀i = 1, ⋯ , n ) is assumed so that is the transformation matrix between the robot base frame and the world frame such that w b R = w b r 1 w b r 2 w b r 3 . Expanding Eq. (16) and stacking it for each n calibration point Q i (I = 1, 2, …, n ) gives a system of linear equations where A T is a 3n × 12 coefficient matrix and b t is a 3n × 1 can be estimated by solving Eq. (17). A summary of these calibrations are tabulated in Table 2. The column "Method" lists the methods to obtain the matrix in column "Outcome" using the equations listed in the "Equation" column.

Calibration
The autonomous kiwifruit harvesting system has a stereo vision system of two cameras as the sensor for localising kiwifruit, and a robotic arm for picking the kiwifruit as shown in Fig. 4. The manipulator consists of three major links and a wrist. These links are actuated by three servo motors installed at the base. At the HOME position of the robot, link 2 aligns with link 1 vertically. Link 3 is positioned horizontally, and the gripper is oriented vertically upward as shown in the figure. Figure 5 shows a schematic configuration of the kiwifruit harvesting robot. 1 , 2 and 3 are the joint parameters driving the link 1, 2 and 3 with link length are l 1 , l 2 and l 3 respectively. Parameter a j , b j and c j (j = 2, 3) are link lengths of the two four-bar linkages.
The orientation of the gripper 4 = − − � 3 . The coordinates of pick point Q are expressed in the robot base frame F b as where f (g, ) is the kinematic model of the robot with 2e 2 c 2 e 2 2 = a 2 2 + l 2 2 − 2a 2 l 2 cos 2 − 3 Fig. 4 The autonomous kiwifruit harvesting system

Fig. 5 A kiwifruit robot arm manipulator with two four bar linkages
The angle ′ 3 , and are shown in Fig. 5. The stereo vision system has two Basler ac1920-40uc USB 3.0 cameras with Kowa lens LM6HC F1.8 f6mm 1" format. The devices are installed in a way that two pairs of stereo cameras share two pairs of floodlight bars. Each consists of a 200 kW floodlight bar with 40 LEDs which illuminates the canopy with white light. A 3-D space measurement system is required to perform measurements that will quantify the magnitude of inaccuracies contributed by the stereo vision system and robot of the harvesting system.
Appropriate calibrations can be applied once these inaccuracies have been quantified. Figure 6a, b depict the setup of the measurement system. It consists of a frame holding a constraint plate which is above the robot and the stereo vision system. The constraint plate is connected to a subframe through a ball head so that its position and orientation are adjustable. Its height h is also adjustable using the adjusting unit. The constraint plate is made from an aluminiumacrylic composite sandwich material which has a flatness of = sin −1 a 3 sin e 3 + cos −1 e 2 3 + c 2 3 − b 2 3 2e 3 c 3 e 2 3 = a 2 3 + l 2 3 − 2a 3 l 3 cos 0.3 mm while suspended. A permanent marker and a dial gauge with resolution of 10 μm are installed at the end of the manipulator as shown in Fig. 6c. A small spring is placed under the marker so that it can be pressed against the constraint plate. The amount of compression is measured by the dial gauge. As the manipulator is moved to a measurement position, it leaves a mark indicating the marker position. The spring action of the marker is implemented so that the marker tip position can either be varied (higher or lower) across the constraint plate. Hence, the position of the marker can be measured with reference to the frame. Various calibration processes can be performed by attaching different calibration tools such as a checkerboard or a board with a grid of dots to the constraint plate. For instance, a checkerboard is used for camera calibration as depicted in Fig. 7a, b shows a board with a grid of dots attached to the constraint plate for stereo vision system calibration, kinematic calibration and integration calibration. The world frame (in red) is set at the centre of the calibration tool as shown.
As the robot moves back and forth, dots are drawn on the board fixed with the constraint plate. The board can then be removed from the frame and placed on a bench to measure the dot positions. Measurements are made by measuring the deviation in the x and y directions of the dots  Fig. 8a is used during the measurement process to get submillimetre resolution accuracy. An example measurement is shown in Fig. 8b (the optical magnifier is not quite aligned with the grid in this image as it is difficult to both align the magnifier and take an image simultaneously). The centre of the dot shown is estimated by measuring the position of the outside edges of the dot and using them to calculate a centrepoint. In this case the centre of the dot would be measured as 1.5 mm away from the reference line. The system performs dot position measurements for verifying the kinematic calibration and integration calibration.

Camera calibration
The cameras in the stereo vision system are calibrated individually to obtain their intrinsic and extrinsic parameters. A checkerboard (A1-80 mm squares-9 × 6 vertices, 10 × 7 squares) is installed on the constraint plate. The cameras are calibrated individually using 50 images taken at multiple orientations, covering the entire field of view of the cameras. The matrix H and D are estimated using Eqs. (4) and (7). Moreover, the intrinsic and extrinsic parameters are computed by Eqs. (8) and (9).

Stereo vision system calibration
The checkerboard is replaced by a board with a grid of dots (13 × 17 dots is spaced 50 mm apart in the x range of ± 400 mm and y range of ± 300 mm) for stereo vision system calibration. Images of the dots are captured by both cameras. The dots are detected using a simple colour filter that generates a black and white mask for both images based on pixels that meet the criteria of the filter. From these masks, the pixel locations of the centroid of the distinguished dots are calculated and are stored as a list of key-points. These key-points are then processed through the undistortion matrix of the stereo vision system and then matched between the left and right images. The fundamental matrix F and essential matrix E are then estimated using Eqs. (11) and (12). Consequently, the transformation matrix l r T of camera L with respect to the frame F r of camera R is obtained from the essential matrix E by single value decomposition.

Kinematic calibration
The board with a grid of dots is also used for kinematic calibration. The marker is driven by the manipulator so that it moves to each dot on the constraint plane sequentially.

Integration calibration
An array of dots Q i w x i w , y i w , z i w (∀i = 1, ⋯ , n) expressed in the world frame F w is used for calibrating the robot base and the stereo vision system integration. The endeffector with the marker is driven to each of these points and their corresponding joint parameters are recorded. The coordinates of this array of dots

Solving a system of linear equations
All the calibrations result in solving a system of equations such as Eqs. (4), (7), (11), (15) and (17) in the forms of When b = 0 such as Eqs. (4), (7) and (11), the solving of this system of homogeneous equation can be formulated as estimating x by A Loss function L x, is defined such that Taking derivative of L x, with respect to x yields an eigen value problem x is an eigen vector with smallest eigen value of matrix A T • A minimizing the Loss function L x, . Once variable x is estimated, the corresponding matrix can be obtained by re-arranging the components of variable x.
If b ≠ 0 , the equations are linear such as Eqs. (15) and (17) arrow is proportional to the error magnitude in radial and circumferential direction. The colour of the arrow is based on the measured z error, which is the depth of that data point, with purple being below the average depth and yellow being above.
In the stereo vision system verification, the sensed dot (measured dots) locations expressed in the world frame F w are calculated. The discrepancies between the sensed dots and the dots in the circular array are plotted in Fig. 9. The summary of the plot is tabulated in Table 3.
In the kinematic accuracy verification, the end-effector is driven to each point of the circular array. The joint parameters are recorded. The calculated end-effector location for each set of joint parameters is obtained from Eq. (18). The positional errors between these calculated locations and their corresponding dot locations in the circular array are plotted in Fig. 10. Figure 10a, b show the positional errors before and after the kinematic calibration. The summary of the plot is tabulated in Table 4.
The accuracy of integration calibration is verified by considering the hand-eye coordination accuracy of the autonomous harvesting system. A circular array of dots is sensed by the stereo vision system. The coordinates of the dots Q i r are computed and expressed in the stereo vision system coordinate frame F r . These coordinates are then transformed into the world frame F w to yield coordinates Q i w . By using the transformation matrix w b T , these dot coordinates are transformed to Q i b in the robot frame F b . The joint parameters i corresponding to each dot coordinate Q i b are obtained by inverse kinematics. Eventually, the end-effector is driven by these joint parameters i (∀i = 1, ⋯ , n) to mark the dots on the constraint plate. The differences between the original circular array of dots and the marker positions are plotted in Fig. 11. The results are summarized in Table 5.

Lab tests
Several tests are set up to check the performance of the autonomous kiwifruit harvesting system after calibrations using the fake kiwifruit in the laboratory as shown in Fig. 12a. As the kiwifruit tends to grow in cluster, the fake kiwifruit is arranged as individual fruit, three fruit clusters, two fruit cluster and seven fruit cluster as shown in Fig. 12b-e. The autonomous kiwifruit harvesting system is placed under the fruit which are hung on the lab ceiling. The fruit is localized by the stereo vision system and the corresponding joint parameters of the manipulator are then computed to drive the gripper in picking the fake kiwifruit. The outcomes are categorized into three categories of picked, dropped and unpicked as tabulated in Table 6.

Orchard tests
Orchard tests are conducted in the several commercial Hayward orchards to determine the performance of the calibrated harvesting system as shown in Fig. 13. Four bays of kiwifruit are harvested to determine the performance. Each bay is divided into several zones. At each zone, the harvesting system is instructed to pick the fruit that are visible by the stereo vision system. At the end of harvesting in a zone, fruit harvested and fruit dropped are manually picked and counted. Fruit left in the canopy is also manually harvested and counted. The harvesting processes are video recorded so that a more detailed analysis can be performed later. The results are summarized in Table 7 which are compared to the performance before calibration.

Discussion
The calibrations can be categorized into two parts. The stereo vision calibration and kinematic calibration. Stereo vision techniques use two cameras to view the same object. The orientations of both cameras installed in the stereo vision system are the same and the distance apart is known. However, these are hard to guarantee the accuracy due to manufacturing issues, especially the fixture holding the cameras. Such inaccuracies affect the extrinsic parameters of the cameras. The stereo vision system calibration is mainly to evaluate these parameters using a set of calibration points and to eliminate the unwanted noise. Since the cameras are operated under the optical principles, a linear model and a set of linear equations are employed to model the system except the lens distortion. The lens distortion is non-linear and this complicates the calibration process. The effects of lens distortion can be serious if it is not properly undistorted.
Different from stereo vision system calibration, kinematic calibration is performed to minimize the difference between the desired and actual gripper position. A kinematic model of a manipulator, which depends on its mechanical structure, is required for calibration. The kinematic model is usually a non-linear function due to the revolution joints. As a result, the kinematic calibration results in a system of non-linear equations and iterative processes are required to solve the equations.
In the kinematic calibration accuracy plot, those "crosses" around the plot centre at (0, 0) indicate that the r and θ coordinates of the commanded and actual positions are very close. In addition, the z coordinate differences are also close to zero. This shows that the assumption of approximating the gripper orientation to be vertical to simplify the inverse kinematic computation is feasible when the gripper is around its home position.
In fact, the plots in Figs. 9, 10, 11 show that the accuracy of the autonomous harvesting system is very high. This also reflects in the laboratory test. The successful picking rate for individual fake kiwifruit is 100%. Fig. 11 The accuracy of handeye coordination However, this rate drops when the fruit cluster size increases. The average picking rate drops from 100% for individual fruit to 67% for seven fruit clusters (with a minimum at 57% for three fruit clusters). The actual successful harvesting rate in the orchard test is even lower than that of the laboratory test results. The calibration improves the positioning of the gripper so that the number of entry failure, grip failure, target and non-target knockoffs, and fruit throws and drops are reduced. As a result, the fruit dropped percentage decreases from 24.6 to 10.7% after calibration. However, the successful harvesting rate just rises from 50.8 to 55%. This indicates that those fruits remain in the canopy instead of harvested as the percentage of fruit left in the canopy increases from 24.6 to 34.3%. This is due to the "offline" stereo vision system for sensing the canopy information, which refers to capturing the canopy once at the beginning of a harvesting cycle. The operation of the autonomous harvesting system at a specific zone under the canopy follows a harvesting cycle as shown in Fig. 14a. The stereo vision system on each module images the canopy. Then the fruits are detected and their positions in the world frame are located. The located fruit positions from each module are collated by a scheduler which assigns the target fruit for each robotic arm dynamically based on the principle of minimum distance with a set of rules for collision prevention. When the robot controller receives a target fruit location from the scheduler, the joint parameters are calculated and the manipulator drives the gripper to perform the harvesting. Then the next target fruit  for the robot will be determined by the scheduler until all target fruit in the scheduler are assigned. Then the autonomous harvesting system is moved to another zone. Reviewing the harvesting videos shows that most of the kiwifruit grow in clusters. These fruits are not at the same level. Some are at a level higher than the others. Before the calibration, once a fruit is harvested, the gripper usually knocks off the neighbouring fruit because of the position inaccuracy. After calibration, the position error is reduced. The fruit is correctly placed into the gripper and the neighbouring fruit are not knocked off. However, these fruits in the cluster are obstructed by the stereo vision system before harvesting. They are not visible to the stereo vision system and are not scheduled for harvesting. Hence, they remain in the canopy even though they are not knocked off. As an alternative, the harvesting cycle is re-run as a "sub-cycle" again to pick those fruit left in the canopy at that zone. This sub-cycle repeats until all the fruit are clear from the canopy (Williams et al. 2019). The flow charts of these processes are outlined in Fig. 14b. Hence, the harvesting time is increased depending upon how the kiwifruit grows clustery.
In order to increase the economic viability of the harvesting system, a real-time stereo vision system (Jin and Tang 2009;Matsumoto and Zelinsky 2000) is proposed Fig. 14 The harvesting cycle of the autonomous harvesting system at a specific location (a) The harvesting cycles using the "offline" stereo vision systems.
(b) The harvesting cycles using the "offline" stereo vision systems with "sub-cycles".
(c) The harvesting cycles using the "real-time" stereo vision systems. for the next development phase as depicted in Fig. 14c. With the real-time stereo vision system, the instantaneous canopy information is obtained, and the scheduler should update the harvesting order accordingly if an obstructed kiwifruit becomes visible. Furthermore, the target fruit allocation by the scheduler should also be based on evenly workload distribution to minimize the cycle harvesting time. This can be achieved by introducing competition among the robots while they are cooperating to complete the harvesting task. With the real-time stereo vision system, visual servoing control Hutchinson 2006, 2007) can also be implemented into the manipulator controller to achieve a more accurate fruit harvesting.

Conclusion
Video analysis is performed to investigate the reasons for high fruit drop rate during harvesting using an autonomous kiwifruit harvesting system. It is revealed that the position error between the gripper and the fruit is the main cause of fruit drop during harvesting. In order to reduce these position errors, an integrated approach for stereo vision system calibration and kinematics calibration is proposed for the autonomous kiwifruit harvesting system.
A measurement system is set up to acquire the data for both calibrations and verifications. Laboratory tests and orchard tests are arranged to investigate the performance of the harvesting system in real application environments. Based on the measurements after these calibrations, it is found that the position error of the harvesting system is greatly reduced. This is actually reflected in the high successful picking rate (100%) in the laboratory test of picking individual fake kiwifruit. The fruit dropped rate is also greatly improved in the real orchard tests because of the position error reduction. However, the successful harvesting rate is not impressively improved as most of the fruit remain unharvested in the canopy even though they are not knocked off due to position error. This is mainly due to the fact that canopy information such as fruit distribution is obtained by the stereo vision system before harvesting starts. These fruits are not harvested because they are obstructed to the stereo vision system as they are hidden by their neighbouring fruit.
As a result, a real-time stereo vision system is required during harvesting to sense the dynamic environment of canopy information to increase the successful harvesting rate and economic viability. Nevertheless, this will complicate the harvesting scheduling and workload distribution among the robots. As the autonomous kiwifruit harvesting system consists of multiple robots, the harvesting task is cooperative and competitive. The robots cooperate to harvest the fruit and they compete with each other so that the harvesting is completed in a minimum of time.
Shen Hin Lim received his Ph.D. from University of New South Wales, Sydney in 2010. He is currently a senior lecturer in University of Waikato focussing on smart system development and control in horticulture field, and agri-robotics.
Professor Mike Duke is the Acting Dean and Dr. John Gallagher Chair in Engineering at the University of Waikato. He is a founding member of Waikato Robotics Automation and Sensing research group and he is active in New Zealand's research landscape.
Ye Chow Kuang received the B.Eng. degree (Hons.) in electromechanical engineering and the Ph.D. degree in non-invasive diagnostic techniques from the University of Southampton. He worked in the areas of machine intelligence, uncertainty modelling in engineering design, and automation. He is currently affiliated to the Waikato Robotic, Automation and Sensing Group as well as Artificial Intelligence Institute of the University of Waikato.
Michael Redstall received his master of engineering in electronic engineering from University of Waikato. His research interest is robotics.
Canaan Ting received his master of engineering in mechanical engineering from University of Waikato. His research interest is robotics.