Magic Leap With Open CV For Unity Example by EnoxSoftware - 19

Games & Projects

MagicLeap with OpenCVforUnity Example

Unknown LicenseUpdated 29 days agoCreated on January 30th, 2019

MagicLeap With OpenCVForUnity Example

Environment

  • MagicLeapOne Lumin OS 0.94
  • Unity 2018.1.9f2-MLTP10 (64-bit)
  • OpenCV for Unity 2.3.3+

Setup

  1. Download the latest release unitypackage. MagicLeapWithOpenCVForUnityExample.unitypackage
  2. Create a new project. (MagicLeapWithOpenCVForUnityExample)
  3. Import “C:/Users/xxx/MagicLeap/tools/unity/v0.19.0/MagicLeap.unitypackage”
  4. Import the OpenCVForUnity.
    • Setup the OpenCVForUnity. (Tools > OpenCV for Unity > Set Plugin Import Settings)
    • Set “Assets/OpenCVForUnity/Plugin/Android/libs/arm64-v8a/libopencvforunity.so” Import Settings. magicleap_settings.png
    • Enclose the code related to the WebCamTexture class with #if UNITY_EDITOR and #endif. ( The WebCamTexture class is not included in the MagicLeap API, so an error occurs at build time. ) enclose_utils.png Assets/OpenCVForUnity/org/opencv/unity/Utils.cs (L496 - L620) enclose_webcamtexturetomathelper.png Assets/OpenCVForUnity/org/opencv/unity/helper/WebCamTextureToMatHelper.cs (L1 - L939)
    • Delete “Assets/OpenCVForUnity/Examples” folders. delete_examples.png
    • Downlod https://raw.githubusercontent.com/pjreddie/darknet/master/cfg/yolov3-tiny.cfg. Copy yolov3-tiny.cfg to “Assets/StreamingAssets/dnn/” folder. Downlod https://pjreddie.com/media/files/yolov3-tiny.weights. Copy yolov3-tiny.weights to “Assets/StreamingAssets/dnn/” folder. Downlod https://github.com/pjreddie/darknet/tree/master/data/coco.names. Copy coco.names to “Assets/StreamingAssets/dnn/” folder.
  5. Import the MagicLeapWithOpenCVForUnityExample.unitypackage.
  6. Add the “Assets/MagicLeapWithOpenCVForUnityExample/*.unity” files to the “Scenes In Build” list in the “Build Settings” window.
  7. Check CameraCapture checkbox in Publishing Settings.
  8. Build and Deploy to MagicLeap.

ScreenShot

magicleap_yoloexample.jpg

Show all projects by EnoxSoftware