HL2-DINO / DINO-DLL

A C++ HoloLens 2 DLL used for detecting and tracking infrared markers with the Research Mode API
https://hl2-dino.github.io/DINO-DLL/
BSD 3-Clause "New" or "Revised" License
15 stars 1 forks source link
dll hololens2 infrared-tracking research-mode

HoloLens 2 & Detection for Infrared Navigation with OST AR headsets

Overview3rd Party DependenciesGetting StartedAcknowledgementsAppendix

Overview

This is the C++ DLL used for the image-processing and tool-pose estimation used by the system reported in our publication: Semi-Automatic Infrared Calibration for Augmented Reality Systems in Surgery[^1] by Hisham Iqbal & Ferdinando Rodriguez y Baena.

This project is a Windows Runtime Component (C++/WinRT)[^2] DLL designed to enable the HoloLens 2 to detect the presence of tools equipped with IR-reflective markers. The resulting .dll and .winmd files can be copied and easily consumed on a C# Unity app (see HL2-DINO-Unity for example).


[!NOTE] The experimental branch includes new features that are under development and may require further testing and refinement. Any significant commits are highlighted below.

Change Description
Commit a8082fe Added support for spherical passive markers by parsing the marker_radius_m key in the JSON config and iteratively using different radii to compute tool poses in Holo2IRTracker.cpp

The classes in this project are designed to carry out the following tasks:

  1. Grabbing sensor data from the HoloLens 2's AHAT depth sensor
  2. Image processing to locate the presence of IR-reflective markers visible to the headset
  3. Providing an interface for the C# Unity application to receive sensor images, tool pose data etc.

For more details on each class, check out the docs!

3rd Party Dependencies

Libraries/Headers Note
ResearchModeAPI.h From the HoloLens2ForCV project on GitHub
OpenCV 4.9.0 Compiled for compatibility with UWP applications[^3]. Static libraries included within this project
Eigen Header-only matrix library with no extra compilation required
Shiny-UWP Used for gathering profiler data.[^4] Static libraries included.

See the NOTICE file in the repo for more details.

[!TIP] Shiny-UWP is optional and can be removed altogether if you are not interested in this info.

Getting Started

  1. git clone https://github.com/HL2-DINO/DINO-DLL.git
  2. Open HL2DinoPlugin.sln, set project configs to Release and ARM64
  3. [Optional] Checkout the experimental branch or make any changes to the source code as you wish
  4. From Visual Studio menus, [Build] -> [Build Solution]
  5. Copy generated .dll and .winmd from the ARM64/Release/HL2DinoPlugin/ folder into your Unity project inside the folder Assets/Plugins/WSA

To see how to set up a sample Unity project, check out the DINO-Unity repositories.

You can use this project as is to build a .dll and .winmd in your Unity project. If you wish to make alterations to the source code to insert your own algorithms, then make any necessary adjustments, and compile for Release and ARM64 architecture.

Two outputs of this process (HL2DinoPlugin.dll & HL2DinoPlugin.winmd) will be contained in ARM64/Release/HL2DinoPlugin. These need to be copied over to your Unity project structure inside the folder Assets/Plugins/WSA.

Acknowledgements

[!NOTE] Gear Icon in repository logo created by Freepik - Flaticon

Appendix

Additional Notes

There are some additional features which have not been implemented yet to expedite the process of open-sourcing.

TO-DO's on the DLL side:

License

This project is licensed under the BSD License.

Other Build Information


[^1]: Iqbal H., Rodriguez y Baena, F. (2022) Semi‑Automatic Calibration for Augmented Reality Systems in Surgery. 2022 IEEE/RSJ International Conference on Intelligent Robots and Systems https://dx.doi.org/10.1109/IROS47612.2022.9982215

[^2]: The project was built using a Windows Runtime Component (C++/WinRT) project template on Visual Studio 2019. See this tutorial for a reference on how to set up your own project.

[^3]: If you want to re-compile OpenCV with different flags or for a different major version, it is highly recommended you follow the instructions found in this project README written by Andreas Keller. Some more reading on the topic can be done here and here

[^4]: A forked repository of the original Shiny Profiler.