Abstract:Abstract: Growth parameters measurement of plants is an important aspect of crop growth monitoring, crop yield forecast and weeds detection. Since artificial measurements are always inefficient and inaccurate, more advanced technique of automatic measurement is required. Three-dimensional (3D) reconstruction can locate the real spatial position of target inside the view based on stereo vision techniques, which plays an important role in growth parameters measurement of plants. As field plants have similar features, the farmland scene is very difficult to be reconstructed completely in 3D space. Stereo matching is the key aspect of 3D reconstruction of farmland scene, which is usually time-consuming and low-accuracy. In order to solve the difficulty of 3D reconstruction of farmland and enhance the accuracy of stereo matching for farmland image, a new method based on Rank transformation was presented in this paper. The presented 3D reconstruction method consisted of 2 modules which were stereo matching and 3D cloud point reconstruction. The stereo matching module comprised grayscale transformation and disparity calculation. To reflect complete features of farmland scene, the weighted average method was used to image gray processing from color space to greyscale. Since the grayscale image is very sensitive to image noise, the Rank transformation result of grayscale image is set to matching primitive, which can increase the robustness of matching primitive against shadows, uneven illumination and other image noises. To save time and calculate dense disparity map, a region matching algorithm based on normalized sum of absolute difference (NSAD) measurement function was adopted to obtain the optimum disparity. The 3D cloud point reconstruction was composed of 3D coordinate calculation and color rendering. As the binocular camera used was assembled with 2 parallel and uniform monocular cameras, 3D coordinates of farmland scene were computed based on the parallel ranging method. Intrinsic and extrinsic parameters of the binocular camera were obtained with Zhang's calibration method. Global 3D coordinate of cloud point was obtained after being transformed from the camera coordinate system, which could describe the practical position in the farmland. After obtaining 3D points cloud of farmland image, the 3D reconstruction of interested region of total scene was accomplished. To test the accuracy of presented stereo matching algorithm, standard images of Teddy, Aloe and Cones, which were downloaded from the Middlebury website, were used to calculate disparity maps. The simple sum of absolute difference (SAD) stereo matching algorithm based on grayscale image was used as a contrast. The window sizes of the Rank transformation, the measurement function and the SAD algorithm were assigned as 5×5 pixel, 11×11 pixel and 11×11 pixel, respectively. Results of stereo matching test validate that the presented algorithm is accurate enough, which decreases bad matching ratios by 5.63% compared to the SAD algorithm. Images of farmland scene of cotton in different situations were used to test the presented 3D reconstruction method. Due to the limited view of the binocular camera, top regions of obtained disparity maps contained some errors. To reduce the effect of disparity errors, the regions with the depth less than 6.8 m on farmland scene were set to the interested region. Results of 3D reconstruction test showed that geometrical parameters such as the height and width of crop and weed were close to practical measurements. Moreover, the average relative error of total tested items was 3.81%. Although, only cotton farmland image is tested, the presented method will be efficient for more varieties of crops. The presented 3D reconstruction method of farmland scene is accurate and robust in the situations of weeds and shadows, which is available to measure outside geometrical parameters of plants for further crop growth monitoring and weed detection research.