[关键词]
[摘要]
为了给采棉机器人提供运动参数,设计了一套双目视觉测距装置以定位棉株。对获取的左右棉株图像进行经背景分割等预处理。求取其在8个尺度下的高斯图,通过尺度不变特征转换SIFT(scale invariant feature transform)算法在相邻高斯差分图中提取出SIFT关键点;计算每个高斯图中关键点邻域内4×4个种子点的梯度模值,得到128维特征向量。分割右图关键点构成的128维空间,得到二叉树;利用最优节点优先BBF(best bin first)算法在二叉树中寻找到172个与左图对应的粗匹配点。由随机采样一致性RANSAC(random sample consensus)算法求出基础矩阵F,恢复极线约束,剔除误匹配,得到分布在11朵棉花上的151对精匹配。结合通过标定和F得到的相机内外参数,最终重建出棉花点云的三维坐标。结果表明,Z轴重建结果比较接近人工测量,平均误差为0.039 3 m,能够反映棉花间的相对位置。
[Key word]
[Abstract]
Rapid development of mechanization in agriculture has made it possible to lower the manual labor hour and increase efficiency at the same time.In order to provide the mechanical arm of the cotton picking robot with the needed movement locus parameters, a cotton distance measuring device based on binocular vision with a full implementation of SIFT(scale invariant feature transform) algorithm was introduced, which realized the positioning of all 11 pieces of cotton planted.Under indoor environment, the cotton images were captured with the control of projector flashlight and the unneeded backgrounds were segmented.Turn the RGB images into gray scale and enhance the gray value to make the cotton more obvious, and after sharpening the edges, the pretreatments of cotton images were finished.Blur the images through Gaussian filter with 8 different scales, calculate the DoG(difference of Gaussian) of Gaussian images and acquire the extrema of 26 neighboring pixels within neighboring scales, and thus SIFT key points were detected, all these key points were invariant to rotation, translation, zoom and affine, which was suitable for the match of cotton images.Calculate the gray gradient modulus value of the 4×4 seed points in 8 directions within the key point neighborhood, and the 128 dimensional SIFT descriptor of each key point was acquired.As to all the SIFT key points in the right image, select the dimension with the maximum variance, and calculate the median value of this dimension, find its corresponding key point and split the other key points according to the median value, repeat this step and the binary tree was built.As to every SIFT key point in the left image, search its potential matches(probably more than one) in the binary tree of the right image until its leaf node was found; save the brother nodes found along the path, establish priority sequence with BBF(best bin first) and expand from the brother nodes to their leaves, find the nearest and second nearest neighbors according to the similarity degree of the 128 dimensional key points between the potential matches until the sequence was empty or the algorithm exceeded its 200 times constraint.Thus 172 pairs of rough cotton matches of key points in 2 images were acquired, but there was still a possibility that there might be wrong matches among rough matches.In order to eliminate the wrong matches, estimate fundamental matrix with RANSAC (random sample consensus) algorithm and recover epipolar geometry constraint; during each sampling, use 8 point algorithm to compute an initial fundamental matrix, calculate the distance from every point to its corresponding epipolar line and count the ones within the threshold as inliers.Repeat this step and choose the fundamental matrix with the most inliers or the least error(in case there were more than one fundamental matrix with the same inlier number) as the final output fundamental matrix, and the corresponding inliers were called refined cotton matches.Using the RANSAC algorithm we got 151 pairs of refined cotton matches, and there were no wrong matches in the refined matches, which helped make the results of cotton three dimensional(3D) reconstruction more accurate.Calibrate the camera to get its intrinsic matrix, and then get essential matrix according to fundamental matrix and intrinsic matrix through transformation.Split essential matrix and the camera′s external rotation matrix and translation vector were acquired.To this point, inputs needed for cotton 3D reconstruction were all ready, and they were 151 pairs of refined matches of cotton, intrinsic matrix, external rotation matrix and translation vector.Put these inputs into the equations and 2D cotton image coordinates could be transformed into 3D coordinates, and the 3D reconstruction of cotton point cloud on the plant was realized.At last the 3D coordinate values of every cotton were obtained and their centroid coordinate values were calculated.Result showed that all 11 pieces of cotton were all successfully 3D positioned, with an average error of 0.039 3m compared with manual measurement, which proves the calculated data are valid and this binocular vision system is reliable enough for practical application.
[中图分类号]
S24;TP242.6
[基金项目]