microsoft / HoloLens2ForCV

Sample code and documentation for using the Microsoft HoloLens 2 for Computer Vision research.
MIT License
479 stars 144 forks source link

How to get depth camera data in unity realtime? #148

Open Hans86 opened 1 year ago

Hans86 commented 1 year ago

As title, how to get depth camera data using unity with openxr to build a holographic application? Is there any method to get the data stream? I have tried this method(https://github.com/cgsaxner/HoloLens2-Unity-ResearchModeStreamer) but if I put it into my project , then it will crash soon and I never get depth camera data successfully... I have tried this method(https://github.com/petergu684/HoloLens2-ResearchMode-Unity) too but it doesn't work. My unity version is 2020.3.14 with MRTK version 2.7.3.0.

revkusz commented 1 year ago

Currently there is no official way (not that i know of) to get the ResearchModeApi data directly to c# or unity. If those are not working out of the box then they need a little tinkering as always with some of the Hololens 2 sample applications. I could never make those work at first try for some reason.

vbandi commented 1 year ago

I have a repo that does this (based on another PeterGu's repo). Maybe you can get that one to work? https://github.com/vbandi/HL2-ResearchMode