Giter Site home page Giter Site logo

hololenstrackingopencv's Introduction

TrackingHololens

This is the example for the object tracking for the Hololens using OpenCV. Based on the Enox OpenCVForUnity library.

To use the project we have supported on:

Build

To develop the project on the Hololens or in the Holographic Emulator we need to:

  1. Pull this Git repository.
  2. Add the folders which are in the OpenCVForUnity library and are included on the .gitignore file.
  3. Import all the Holotoolkit Unity package.

Capabilities needed on Unity

  • WebCam
  • Micophone
  • VideosLibrary
  • SpatialMapping

Run Holographic emulator

  1. Open the Holographic Remoting Player application on the Hollens.
  2. Ensure that the ip will be an public ip not a local ip started by 127.0
  3. Open the Holographic emulator located in Window Menu
  4. Optional, start Debug on Visual Studio
  5. Play. The emulation will show
  6. Be Careful! For a new emulation is better disconnect an re conect because Unity can fail.

Deploy in the Hololens

  1. Build Settings -> Build -> Select a new folder named by your preference
  2. Open the Visual Studio Solution
  3. Change Debug and ARM with Release and x86. Select the Device if it will be conncected by USB or Reomte Machine if will be by WiFi.
  4. Select Start Debugging if you want to bew see the prints console from Unity

Unity Project

Scenes for the Hololens

  • Hololens Normal Cam - just for check we're vieweing and tracking by the Holoelsn Web Cam
  • Hololens MOSSE tracking - tracking more confident, fast 60 fps but can lose the tracking times
  • Hololens CSRT tracking - can track 30 fps but more dynamic
  • Comic Filter - A sample from the OpenCVForUnity package

Scenes for te webcam

Video tracking examples

  1. Select the algorithm on the Mono Tracking Example Script.
  2. Clic for the first corner of the ROI tracking
  3. Second clic for complete the ROI and start tracking
  4. Click again if you want another ROI

CamTracker

Common bugs:

  • The camera stops, but the UI works: There is something wrong on the OnFrameAquired function. There are some methods can only be called from the main thread. "Constructors and field initializers will be executed from the loading thread when loading a scene. Don't use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function."

  • "DllNotFoundException: opencvforunity": The DLL library is not loaded. Ensure the DLL in the WSA (not in the Windows) folder was loaded in Unity.

  • Seeing the webcam image and not the hololens cam: you should build the to se the hololens cameras. If you run from the holographic emulation you will always see the webcam render. Furthermor willl run always the Update function and all the code which is under

  • Dont see any change after the unity build: Ensure you add the new scene to the Build Settings

  • The holographic emulator never connect: Is by Release - x86, On and is the Hololens plugged?

Debug the builded Unity Hololens project

  1. Check the C# projects checkbox before the build. All the C# files will be builded too, where you can edited and rebuild after the unity build. If you have to make an edition on the uinty project you need to buil it again from unity.
  2. Start Debugging lets you see all the Debug.Log logs will be showed.

2018, Universidad de los Andes - Teknische Universität Kaiserslautern

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.