在增强现实中,必须正确处理虚实物体之间的遮挡关系,给用户一个具有真实感的场景。探讨了一种虚实遮挡的实时处理方法,通过在真实遮挡物的表面设置标志物,利用基于标志物的单目视觉跟踪技术获取真实遮挡物轮廓与深度信息,快速确定虚实物体之间的遮挡关系,基于图形绘制中帧缓存技术,在模板缓存中生成遮挡面模板,并进行遮挡剔除处理。算法实现简便,处理速度快,能实现对移动遮挡物的实时处理。实验结果验证了该方法的有效性与实时性。
In augmented reality,the occlusion between virtual and real objects has to be handled correctly,so that users can look at the realistic scene.An approach for real-time occlusion handling was proposed.A pre-defined marker was attached on the surface of the real occluding object,and then the contour and depth of the real object was derived using a marker-based monocular vision tracking method.Based on framebuffer techniques in graphics,the occlusion mask of the real object was rendered into stencil buffer,which was used for occlusion culling as the occluder.The algorithm is easy to be implemented,with which the real-time occlusion handling for the movable real object can be achieved.Experimental results demonstrate the effectiveness and real time of the presented method.