提出了一种基于矩保持法获取彩色目标深度信息的新方法;算法首先通过改变摄像机的镜头焦距获得同一景物的两幅散焦程度不同的RGB图像;然后利用色差sobel算子将RGB图像转换为灰度边缘图像;根据矩保持法分别计算两幅图像边缘区域面积与整个图像面积的比值,进而得到景物的深度.算法不要求图像的准确聚焦,而且充分利用了图像的全部彩色信息,避免了使用灰度图像产生的信息丢失;实验结果表明该方法能够快速准确地获得目标的深度信息,方法实用有效。
A new method is presented for depth measurement based on moment-preserving principle. Two defocused RGB images of the same scene are obtained by changing the camera focus, then by using color difference sobel operator, the RGB images are converted into gray edge images. The ratios between the edge region and the entire gray edge images are calculated separately using moment-preserving principle, then the depth of scene can be calculated. The method requires no focus image and fully utilize the whole color information thus avoiding the lose of information caused by gray images. The experiment results showed that the method is effective and can obtained the depth of object rapidly and accurately.