https://github.com/EnoxSoftware/HoloLensWithOpenCVForUnityExample
What‘s new
- Support for Hololens1 and Hololens2. (XR System: Legacy Built–in XR / XR Plugin Management WindowsMR / XR Plugin Management OpenXR)
Demo Video (old version)
Environment
- Hololens1 10.0.17763.3532 / Hololens2 20348.1522
- Windows 10 SDK 10.0.19041.0
- Visual Studio 2019
- Unity 2019.4.31f1 / 2020.3.38f1
- Microsoft Mixed Reality Toolkit v2.8.2
- OpenCV for Unity 2.5.1+
- EnoxSoftware/HoloLensCameraStream
Setup
- Download the latest release unitypackage. HoloLensWithOpenCVForUnityExample.unitypackage
- Create a new project. (
HoloLensWithOpenCVForUnityExample
) - Import the OpenCVForUnity.
- Clone HoloLensCameraStream repository.
- Import the Microsoft Mixed Reality Toolkit. (Recommend using MixedRealityFeatureTool)
- Import the HoloLensWithOpenCVForUnityExample.unitypackage.
- Add the “Assets/HoloLensWithOpenCVForUnityExample/*.unity” files to the “Scenes In Build” list in the “Build Settings” window.
- Configure settings in the “Project Settings” window.
- Add Define Symbols: the following to
Scripting Define Symbols
depending on the XR system used in your project; Legacy built-in XR:BUILTIN_XR
; XR Plugin Management (Windows Mixed Reality):XR_PLUGIN_WINDOWSMR
; XR Plugin Management (OpenXR):XR_PLUGIN_OPENXR
. - Enable
WebCam
Capabilties in Publishing settings tab.
- Add Define Symbols: the following to
- (Optional) Setup a performance environment suitable for Holorens. (See Recommended settings for Unity – Mixed Reality | Microsoft Learn)
- Build the project: You can now build the Unity project, which generates a Visual Studio Solution (which you will then have to also build). With the Build Settings window still open, click Build. In the explorer window that appears, make a new folder called
App
, which should live as a sibling next to the ‘Assets` folder. Then click Select Folder to generate the VS solution in that folder. Then wait for Unity to build the solution. - Open the VS Solution: When the solution is built, a Windows explorer folder will open. Open the newly-built VS solution, which lives in
App/HoloLensWithOpenCVForUnityExample.sln
. This is the solution that ultimately gets deployed to your HoloLens. - Configure the deploy settings: In the Visual Studio toolbar, change the solution platform from
ARM
tox86
if you are building for Hololens1 or toARM64
if you are building for Hololens2; Change the deploy target (the green play button) toDevice
(if your HoloLens is plugged into your computer), orRemote Machine
(if your HoloLens is connected via WiFi). - Run the app: Go to Debug > Start Debugging. Once the app is deployed to the HoloLens, you should see some confirmation output in the Output window.
Project Assets | Build Settings |
---|---|
Player Settings |
---|
ScreenShot (old version)
原文地址:https://blog.csdn.net/moonlightpeng/article/details/134814124
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如若转载,请注明出处:http://www.7code.cn/show_47760.html
如若内容造成侵权/违法违规/事实不符,请联系代码007邮箱:suwngjj01@126.com进行投诉反馈,一经查实,立即删除!
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。