All Projects → doughtmw → ArUcoDetectionHoloLens-Unity

doughtmw / ArUcoDetectionHoloLens-Unity

Licence: MIT license
ArUco marker tracking on the HoloLens, implemented in Unity.

Programming Languages

C#
18002 projects
ShaderLab
938 projects

Projects that are alternatives of or similar to ArUcoDetectionHoloLens-Unity

HoloLensArucoTracking
A simple aruco marker tracking library for the HoloLens and the Unity Editor
Stars: ✭ 41 (-48.1%)
Mutual labels:  hololens, aruco
Hololens facial recognition
A Unity hololens app to detect faces and display their attributes
Stars: ✭ 217 (+174.68%)
Mutual labels:  hololens
Hololens ironman
Iron Man helmet HUD for Hololens
Stars: ✭ 22 (-72.15%)
Mutual labels:  hololens
Mrlightingtools Unity
A Unity library and MRTK extension for estimating and replicating the current environment's lighting on Mixed Reality devices.
Stars: ✭ 142 (+79.75%)
Mutual labels:  hololens
Hololensscanningeffect
Source code for my blog post http://smeenk.com/hololens-scanning-effect-in-unity/.
Stars: ✭ 52 (-34.18%)
Mutual labels:  hololens
Openxr Mixedreality
OpenXR samples and preview headers for HoloLens and Windows Mixed Reality developers familiar with Visual Studio
Stars: ✭ 143 (+81.01%)
Mutual labels:  hololens
Mixedrealitytoolkit
The MixedRealityToolkit is a collection of scripts and components intended to accelerate the development of mixed reality applications targeting Windows Mixed Reality.
Stars: ✭ 757 (+858.23%)
Mutual labels:  hololens
Ecere Sdk
Ecere SDK (eC Language, Ecere IDE, Cross platform GUI, graphics, and more) — http://ec-lang.org —
Stars: ✭ 244 (+208.86%)
Mutual labels:  hololens
Simple Webxr Unity
⭐ Bringing WebXR to Unity 3D with 3 files ! B-)
Stars: ✭ 215 (+172.15%)
Mutual labels:  hololens
Dxr
DXR is a Unity package for rapid prototyping of immersive data visualizations in augmented, mixed, and virtual reality (AR, MR, VR) or XR for short.
Stars: ✭ 134 (+69.62%)
Mutual labels:  hololens
Holoviveobserver
Shared Reality: Observe a VR session from the same room using a HoloLens!
Stars: ✭ 126 (+59.49%)
Mutual labels:  hololens
Spatial Computing
Samples showing how to use Azure and AI services in Mixed Reality projects
Stars: ✭ 63 (-20.25%)
Mutual labels:  hololens
Puremvc Csharp Multicore Framework
PureMVC MultiCore Framework for C#
Stars: ✭ 166 (+110.13%)
Mutual labels:  hololens
Hololensarucounity
Marker tracking on HoloLens built on Aruco, OpenCV and Unity
Stars: ✭ 39 (-50.63%)
Mutual labels:  hololens
Hololenscamerastream
This Unity plugin makes the HoloLens video camera frames available to a Unity app in real time. This enables Unity devs to easily use the HoloLens camera for computer vision (or anything they want).
Stars: ✭ 233 (+194.94%)
Mutual labels:  hololens
Mr Realtime Translator
Real-time translation services in Mixed Reality. Core pieces to get audio from the mic in Unity and stream over a websocket to the Azure Translator API and process the responses - as you speak!
Stars: ✭ 22 (-72.15%)
Mutual labels:  hololens
Holobot
HoloBot is a reusable 3D interface that allows HoloLens & VR users to interact with any bot using Mixed Reality & Speech.
Stars: ✭ 114 (+44.3%)
Mutual labels:  hololens
Hololenswithopencvforunityexample
HoloLens With OpenCVforUnity Example
Stars: ✭ 142 (+79.75%)
Mutual labels:  hololens
KEYSDK-WH
Simplified mapping with KEY SDK.
Stars: ✭ 12 (-84.81%)
Mutual labels:  hololens
Hololensartoolkit
Marker tracking using the front-facing camera of HoloLens (both 1 and 2) and Unity, with a wrapper of ARToolKit built for UWP (Windows Universal Platform)
Stars: ✭ 238 (+201.27%)
Mutual labels:  hololens

ArUcoDetectionHoloLens-Unity

Edit 1/30/2022: If you are interested in testing out our improved repo for tracking and display calibration on the HoloLens 2, please check out our display-calibration-hololens repository.

ArUco marker tracking made available for use in Unity through IL2CPP Windows Runtime support for the HoloLens 1 (x86) and HoloLens 2 (ARM).

Incorporates:

aruco tracking

Requirements

ArUco Detection Sample

  1. Git clone repo. From the main project directory, clone submodules with:
git submodule update --init

Optional: build project from source

  • Open HoloLensForCV sample in VS2017/VS2019 and install the OpenCV.HoloLens.3411 NuGet package to HoloLensForCV project. In Nuget package manager console type:
Install-Package ..\OpenCV.HoloLens.3411.0.0.nupkg -ProjectName HoloLensForCV
  • Build the HoloLensForCV project (x86 OR ARM, Debug or Release)
  • Copy all output files from HoloLensForCV output path (dlls and HoloLensForCV.winmd) to the Assets->Plugins->x86/ARM folder of the ArUcoDetectionHoloLensUnity project
  1. Open ArUcoDetectionHoloLensUnity Unity project and build using IL2CPP, ensure that unsafe code is allowed under Unity Player Settings->Other Settings
  2. Open VS solution, build then deploy to device
  3. When looking at an aruco marker from the correct ArUco dictionary: this sample uses the 6x6 (50, 100, 250, 500) dictionary by default, a virtual cube, which is scaled to the size of the ArUco marker, should appear on top of the marker

Camera calibration for the HoloLens 2

  • To improve the accuracy of marker-based registration, it is recommended that a standard camera calibration procedure is performed (estimating the intrinsic and extrinsic parameters of the camera)
    • This estimation procedure only has to be performed once per camera and requires the user to capture multiple images of a standard planar calibration chessboard from different orientations
  • Details of how to record images from your HoloLens 2 camera (at the desired resolution for marker-based tracking) and compute the calibration parameters are included in the following README file
  • After computing the camera parameters, we can open the resulting data.json file and extract relevant measures to include in the Unity project for online tracking
  • Below is a sample json file from one of my calibration results
// Calibration parameters from opencv, compute once for each hololens 2 device
{"camera_matrix": [[677.8968352717175, 0.0, 439.2388714449508], [0.0, 677.1775976226464, 231.50848952714483], [0.0, 0.0,1.0]], "dist_coeff": [[-0.002602963842533594, -0.008751170499511022, -0.0022398259556777236, -5.941804169976817e-05, 0.0]], "height": 504, "width": 896}
  • From this file we can parse important values as follows and enter them into the corresponding Unity fields in the ArUcoDetectionHoloLensUnity project
  • On runtime, these values will be used within the HoloLensForCV project to remove distortion from the incoming video data and improve the accuracy of marker-based tracking
// Proper format parameters for Unity
  677.8968352717175f, 677.1775976226464f, // focal length (0,0) & (1,1)
  439.2388714449508f, 231.50848952714483f, // principal point (0,2) & (2,2)
  -0.002602963842533594f, -0.008751170499511022f, 0.0f, // radial distortion (0,0) & (0,1) & (0,4)
  -0.0022398259556777236f, -5.941804169976817e-05f, // tangential distortion (0,2) & (0,3)
  504, 896); // image width and height

Using other research mode sensor streams - HoloLens 1 only...

To enable the use of HoloLens research mode streams in Unity, additional permissions are required for the project. Navigate to Unity project build folder and modify the Package.appxmanifest file to include:

  • Restricted capabilities package:
<Package 
  xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" 
  xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" 
  xmlns:uap2="http://schemas.microsoft.com/appx/manifest/uap/windows10/2" 
  xmlns:uap3="http://schemas.microsoft.com/appx/manifest/uap/windows10/3" 
  xmlns:uap4="http://schemas.microsoft.com/appx/manifest/uap/windows10/4" 
  xmlns:iot="http://schemas.microsoft.com/appx/manifest/iot/windows10" 
  xmlns:mobile="http://schemas.microsoft.com/appx/manifest/mobile/windows10" 
  xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities" 
  IgnorableNamespaces="uap uap2 uap3 uap4 mp mobile iot rescap" 
  xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"> 
  • Modified capabilities with with new package:
  <Capabilities>
    <rescap:Capability Name="perceptionSensorsExperimental" />
    <Capability Name="internetClient" />
    <Capability Name="internetClientServer" />
    <Capability Name="privateNetworkClientServer" />
    <uap2:Capability Name="spatialPerception" />
    <DeviceCapability Name="webcam" />
  </Capabilities>

Now, modifying the selected sensor for streaming in Unity (for depth and infrared streams, more processing of input frames will likely be required to visualize) different streams can be selected. ArUco marker tracking is currently only supported using the photo-video camera of the HoloLens 1 and HoloLens 2.

research mode sensor enum

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].