flankechen / vuforia_stereo_rectify

stereo rectify for vuforia example

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

vuforia stereo rectify

this is sample code of warping background image in vuforia for stereo rectify. vuforia example provide two ways of accessing the camera image. While the first image class example leads low frame raw, we use the second approach, shader program warps the video background directly. The opencv precompute maps, lookup coordinate for warping is passed into the shader program as another texture. The result is cool. I achieve up to 60fps frame rate in my environment.

before: alt text

rectified: alt text

a more detail code explaination could be found on my blog

Installation

  1. /save_param/ keeps the calibration output files from opencv stereo calibration example like this, we only use the precompute maps calib_para.yml, make sure it's in CV_16S2 formate. change these files to your calibration reslut.
  2. I have two cameras with resolution 960*1080. Change this to yours in some of the codes and the vuforia setup xml.
  3. /opencv_dll/ is a sample opencv dll project, producing dlls for unity plugin. I use opencv to read the yml files and change the map from CV_16S2 to CV_32FC1. opencv 2.4.11 for win32 is used. recompile the dlls and copy them to the /assects/plugins/ folder if you have different environment(but vuforia could only works with Unity 32bit).

About

stereo rectify for vuforia example


Languages

Language:C# 87.6%Language:GLSL 5.8%Language:Java 3.8%Language:C++ 1.2%Language:Objective-C++ 0.9%Language:JavaScript 0.3%Language:C 0.3%Language:Objective-C 0.2%