Skip to main content
Inspiring
October 20, 2014

Rendering webcam images in the Rift using OpenCV and OpenGL

I've been asked about OpenCV with the Rift a few times, so I've made the example code for doing Rift rendering of captured OpenCV images the subject of my latest video.




A walkthrough of an application that pulls images from a live Rift mounted webcam and renders them to the display.

Example source code

Full example repository

Book Website

    16 replies

    Participant
    December 18, 2015
    "Mecrof" wrote:
    Thanks for the video! Have to add the concept in my own application.

    It may be a stupid question but you flip the texture with OpenCV on the CPU. Why do not just flip the OpenGL texture coordinates and let the fragment shader does "automatically" the flipping? It would be faster and reduce the camera latency. Am I wrong ? :)



    Hi Will you please tell me how you prepare setup for this demo "Oculus Rift In Action"

    I have already cloned all git repository and created a build for that using cmake ..

    but its still have a problems with build solutions

    if you provide steps to run this examples that will be very helpful for me

    I am using VS 2012 as platform
    looking forward to kind help from you


    Thank you
    Participant
    December 18, 2015
    "DoZo1971" wrote:
    Great stuff!
    Are there differences in camera quality performance wise? Are more expensive cameras "faster"?
    To battle the latency? Or is it only dependent on the resolution and the performance of your machine?
    Thanks,
    Daniel



    Will you please tell me which Visual Studio version you used 2012 or 2013 ? or else
    New Participant
    March 9, 2016
    Thanks for the guide and a well written book (bought it last week). I'm new to Oculus programming as a whole, but for some reason I cant manage to get the FPS to show over the webcam-stream. I'm able to get everything else to run. Any suggestions?
    New Participant
    November 1, 2016
    I am trying to run this webcam streaming application on my Oculus DK2. But since the development is done on the older version of Oculus SDK, the application is only running on the PC but NOT on the oculus itself. What could I be doing wrong?

    Note: I installed appropriate Oculus runtime (0.5 for this application) and included Oculus SDK (v0.4). I see that after installing Oculus runtime v0.5, the Oculus tracker is getting disabled and HMD stops responding. Is there something I missed?
    New Participant
    February 9, 2019
    I know it's an old thread but I have also bought this book last week and It's not even updated! it should not be sold anymore imo. But business is business. I feel I have been scammed! Shame on you
    kojack
    Honored Contributor
    February 12, 2019
    I guess technically the book is still valid if you have a DK1 or DK2 headset and use an sdk of 0.5 or below (the code examples were built against 0.5).

    But for CV1 owners and the current sdk, things are extremely different.
    Author: Oculus Monitor , Auto Oculus Touch , Forum Dark Mode , Phantom Touch Remover , X-Plane Fixer Hardware: Threadripper 1950x, MSI Gaming Trio 2080TI, Asrock X399 Taich Headsets: Wrap 1200VR, DK1, DK2, CV1, Rift-S, GearVR, Go, Quest, Quest 2, Reverb G2, Quest 3