Shader to undistort webcam video for AR Rift

This is for discussion and development of non-commercial open source VR/AR projects (e.g. Kickstarter applicable, etc). Contact MTBS admins at customerservice@mtbs3d.com if you are unsure if your efforts qualify.
Post Reply
doktor3d
One Eyed Hopeful
Posts: 4
Joined: Wed Feb 13, 2013 4:35 am

Shader to undistort webcam video for AR Rift

Post by doktor3d »

I am building an AR display using the Rift and attaching two webcams to the front. I have two 120 degree webcams and am texturing two planes in my Unity scene with live the video feed using WebCamTexture. The plane has the same 1:1.78 aspect ratio as the webcam feed.

However, simply projecting the webcam video onto this flat plane of course suffers from normal barrel distortion of cheap cameras. This distortion is particularly pronounced as the cameras have a wide (120 degree) field-of-view lens.

I assume a shader would be the best way to correct for this distortion. The other possibility would perhaps be projecting the webcam video onto a mesh geometry that is the inverse of the webcam lens distortion. However, the shader approach seems to be the more general solution.

Does anyone have any ideas to get started on this? I have calibrated my camera with OpenCV and so I have the camera's distortion coefficients.
Post Reply

Return to “VR/AR Research & Development”