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 Toolkitv2.8.2
- OpenCV for Unity2.5.1+
- EnoxSoftware/HoloLensCameraStream
Setup
- Download the latest release unitypackage.HoloLensWithOpenCVForUnityExample.unitypackage
- Create a new project. (
HoloLensWithOpenCVForUnityExample
)- Change the platform to
UWP
in the “Build Settings” window.
- Change the platform to
- Import the OpenCVForUnity.
- Select MenuItem[Tools/OpenCV for Unity/Open Setup Tools].
- Click the [Move StreamingAssets Folder] button.
- Leave the following files and delete the rest. (“StreamingAssets/OpenCVForUnity/objdetect/haarcascade_frontalface_alt.xml”, “lbpcascade_ frontalface.xml”)
- Clone HoloLensCameraStream repository.
- Copy the “HoloLensCameraStream/HoloLensVideoCaptureExamp服务器托管网le/Assets/CamStream/” folder to the “Assets/” folder.
- Import the Microsoft Mixed Reality Toolkit. (Recommend usingMixedRealityFeatureTool)
- Follow the MRTK2 configuration dialog to set up the project.
- 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. (SeeRecommended 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, clickBuild. 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 toDebug > Start Debugging. Once the app is deployed to the HoloLens, you should see some confirmation output in the Output window.
- (Print the AR marker “CanonicalMarker-d10-i1-sp500-bb1.pdf” on an A4 size paper)
Project Assets | Build Settings |
---|---|
Player Settings |
---|
ScreenShot (old version)
服务器托管,北京服务器托管,服务器租用 http://www.fwqtg.net
本地部署modelscope-agent 部署流程 在modelscope社区创建一个自己的空间(假设name是LocalAgent),clone空间到本地(或云服务器如魔搭Notebook) git clone https://github.com/mode…