{"id":19119715,"url":"https://github.com/enoxsoftware/hololenswithopencvforunityexample","last_synced_at":"2025-04-12T19:46:03.726Z","repository":{"id":45156796,"uuid":"81202585","full_name":"EnoxSoftware/HoloLensWithOpenCVForUnityExample","owner":"EnoxSoftware","description":"HoloLens With OpenCVforUnity Example (Support for Hololens1 and Hololens2)","archived":false,"fork":false,"pushed_at":"2024-12-11T16:39:15.000Z","size":9893,"stargazers_count":270,"open_issues_count":13,"forks_count":51,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-04-03T23:09:15.622Z","etag":null,"topics":["aruco","augmented-reality","face-detection","hololens","hololens2","mixed-reality","mrtk","opencv","unity"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EnoxSoftware.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-07T11:50:53.000Z","updated_at":"2025-03-20T06:41:57.000Z","dependencies_parsed_at":"2024-11-09T05:10:52.517Z","dependency_job_id":"cea4e88e-27ce-4a33-925f-06e4c2f89c4f","html_url":"https://github.com/EnoxSoftware/HoloLensWithOpenCVForUnityExample","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EnoxSoftware%2FHoloLensWithOpenCVForUnityExample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EnoxSoftware%2FHoloLensWithOpenCVForUnityExample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EnoxSoftware%2FHoloLensWithOpenCVForUnityExample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EnoxSoftware%2FHoloLensWithOpenCVForUnityExample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EnoxSoftware","download_url":"https://codeload.github.com/EnoxSoftware/HoloLensWithOpenCVForUnityExample/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248625491,"owners_count":21135513,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aruco","augmented-reality","face-detection","hololens","hololens2","mixed-reality","mrtk","opencv","unity"],"created_at":"2024-11-09T05:10:48.494Z","updated_at":"2025-04-12T19:46:03.704Z","avatar_url":"https://github.com/EnoxSoftware.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HoloLens With OpenCVForUnity Example\r\n\r\n\r\n## Demo Video (old version)\r\n[![](http://img.youtube.com/vi/SdzsedkTpCI/0.jpg)](https://youtu.be/SdzsedkTpCI)\r\n\r\n\r\n## Environment\r\n* HoloLens1 10.0.17763.316 / HoloLens2 22621.1399\r\n* Windows 10 SDK 10.0.19041.0 / 10.0.22621.0\r\n* Unity 2021.3.35f1 (Built-in Render Pipeline / OpenXR 1.11.1 / MRTK 2.8.3 / DirectX 11 / Visual Studio 2022 MSVC v143)\r\n* Unity 2021.3.35f1 (Built-in Render Pipeline / OpenXR 1.11.1 / MRTK 3.2.2 / DirectX 11 / Visual Studio 2022 MSVC v143)\r\n* [Mixed Reality Feature Tool](https://learn.microsoft.com/en-us/windows/mixed-reality/develop/unity/welcome-to-mr-feature-tool)\r\n* [OpenCV for Unity](https://assetstore.unity.com/packages/tools/integration/opencv-for-unity-21088?aid=1011l4ehR) 2.6.4+ \r\n* [EnoxSoftware/HoloLensCameraStream](https://github.com/EnoxSoftware/HoloLensCameraStream)\r\n\r\n\r\n## Setup (Common)\r\n1. Download the latest release unitypackage. [HoloLensWithOpenCVForUnityExample.unitypackage](https://github.com/EnoxSoftware/HoloLensWithOpenCVForUnityExample/releases)\r\n1. Create a new project. (`HoloLensWithOpenCVForUnityExample`)\r\n    * Change the platform to `UWP` in the \"Build Settings\" window.\r\n1. Import and setup the Microsoft Mixed Reality Toolkit. (Recommend using [MixedRealityFeatureTool](https://www.microsoft.com/en-us/download/details.aspx?id=102778))\r\n1. Import the OpenCVForUnity.\r\n    * Select MenuItem[Tools/OpenCV for Unity/Open Setup Tools].\r\n    * Click the [Move StreamingAssets Folder] button.\r\n    * Leave the following files and delete the rest. (\"StreamingAssets/OpenCVForUnity/objdetect/haarcascade_frontalface_alt.xml\", \"lbpcascade_ frontalface.xml\")\r\n1. Clone HoloLensCameraStream repository.\r\n    * Copy the \"HoloLensCameraStream/HoloLensVideoCaptureExample/Assets/CamStream/\" folder to the \"Assets/\" folder.\r\n1. Import the HoloLensWithOpenCVForUnityExample.unitypackage.\r\n1. Add the \"Assets/HoloLensWithOpenCVForUnityExample/*.unity\" files to the \"Scenes In Build\" list in the \"Build Settings\" window.\r\n1. Configure settings in the \"Project Settings\" window.\r\n    * 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`.\r\n    * Enable `WebCam` Capabilties in Publishing settings tab.\r\n1. (Optional) Setup a performance environment suitable for Holorens. (See [https://docs.microsoft.com/en-us/windows/mixed-reality/develop/unity/recommended-settings-for-unity](https://docs.microsoft.com/en-us/windows/mixed-reality/develop/unity/recommended-settings-for-unity))\r\n1. **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.\r\n1. **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.\r\n1. **Configure the deploy settings:** In the Visual Studio toolbar, change the solution platform from `ARM` to `x86` if you are building for Hololens1 or to `ARM64` if you are building for Hololens2; Change the deploy target (the green play button) to `Device` (if your HoloLens is plugged into your computer), or `Remote Machine` (if your HoloLens is connected via WiFi).\r\n1. **Run the app:** Go to **Debug \u003e Start Debugging**. Once the app is deployed to the HoloLens, you should see some confirmation output in the Output window.\r\n    *  (Print the AR marker \"CanonicalMarker-d10-i1-sp500-bb1.pdf\" on an A4 size paper)  \r\n\r\n* [Choosing a Unity version and XR plugin](https://learn.microsoft.com/en-us/windows/mixed-reality/develop/unity/choosing-unity-version)\r\n* [Known issues in Unity versions and packages](https://learn.microsoft.com/en-us/windows/mixed-reality/develop/unity/known-issues)\r\n\r\n\r\n## Setup (Unity 2021 (Built-in Render Pipeline / OpenXR / MRTK 2 / DirectX 11 / Visual Studio 2022))\r\n1. Download the latest release unitypackage.\r\n1. Create a new project. (`HoloLensWithOpenCVForUnityExample`)\r\n1. Import the Microsoft Mixed Reality Toolkit.\r\n    * Add MRTK2 (Mixed Reality Toolkit - Mixed Reality Toolkit Foundation) and OpenXR(Platform Support - Mixed Reality OpenXR Plugin) to the project using \"Mixed Reality Feature Tool\".\r\n    * Follow the MRTK2 configuration dialog to set up the project. (XR System: OpenXR)\r\n1. Import the OpenCVForUnity.\r\n1. Import the HoloLensCameraStream.\r\n1. Import the HoloLensWithOpenCVForUnityExampleMRTK2.unitypackage.\r\n1. Add the \"Assets/HoloLensWithOpenCVForUnityExample/*.unity\" files to the \"Scenes In Build\" list in the \"Build Settings\" window.\r\n1. Configure settings in the \"Project Settings\" window.\r\n    * Add `XR_PLUGIN_OPENXR` to the list of Define Symbols.\r\n    * Enable `WebCam` Capabilties in Publishing settings tab.\r\n1. Build the project; open it in VS2022, set the deployment target to `ARM64` and deploy it to the Hololens2 actual device.\r\n\r\n* [Set up a new OpenXR project with MRTK](https://learn.microsoft.com/en-us/windows/mixed-reality/develop/unity/new-openxr-project-with-mrtk)\r\n\r\n\r\n## Setup (Unity 2021 (Built-in Render Pipeline / OpenXR / MRTK 3 / DirectX 11 / Visual Studio 2022))\r\n1. Download the latest release unitypackage.\r\n1. Create a new project. (`HoloLensWithOpenCVForUnityExample`)\r\n1. Import the Microsoft Mixed Reality Toolkit.\r\n    * Add MRTK3 (MRTK3 - MRTK Input, MRTK UX Components, MRTK UX Components (Non-Canvas)) and OpenXR(Platform Support - Mixed Reality OpenXR Plugin) to the project using \"Mixed Reality Feature Tool\".\r\n    * * Set up the MRTK3. (XR System: OpenXR)\r\n1. Import the OpenCVForUnity.\r\n1. Import the HoloLensCameraStream.\r\n1. Import the HoloLensWithOpenCVForUnityExampleMRTK3.unitypackage.\r\n1. Add the \"Assets/HoloLensWithOpenCVForUnityExample/*.unity\" files to the \"Scenes In Build\" list in the \"Build Settings\" window.\r\n1. Configure settings in the \"Project Settings\" window.\r\n    * Add `XR_PLUGIN_OPENXR` to the list of Define Symbols.\r\n    * Enable `WebCam` Capabilties in Publishing settings tab.\r\n1. Build the project; open it in VS2022, set the deployment target to `ARM64` and deploy it to the Hololens2 actual device.\r\n\r\n* [Setting up a new Unity project with MRTK3](https://learn.microsoft.com/en-us/windows/mixed-reality/mrtk-unity/mrtk3-overview/getting-started/setting-up/setup-new-project)\r\n\r\n\r\n\r\n|Project Assets|Build Settings|\r\n|---|---|\r\n|![ProjectAssets.jpg](ProjectAssets.jpg)|![BuildSettings.jpg](BuildSettings.jpg)|\r\n\r\n|Player Settings|\r\n|---|\r\n|![PlayerSettings.jpg](PlayerSettings.jpg)|\r\n\r\n\r\n## ScreenShot (old version)\r\n![screenshot01.jpg](screenshot01.jpg) \r\n\r\n![screenshot02.jpg](screenshot02.jpg) \r\n\r\n![screenshot03.jpg](screenshot03.jpg) \r\n\r\n![screenshot04.jpg](screenshot04.jpg) \r\n\r\n![screenshot05.jpg](screenshot05.jpg) \r\n\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenoxsoftware%2Fhololenswithopencvforunityexample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fenoxsoftware%2Fhololenswithopencvforunityexample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenoxsoftware%2Fhololenswithopencvforunityexample/lists"}