Skip to content

Commit

Permalink
Fixed README.
Browse files Browse the repository at this point in the history
  • Loading branch information
EnoxSoftware committed Mar 13, 2021
1 parent c77eb2e commit 438b027
Show file tree
Hide file tree
Showing 9 changed files with 267 additions and 196 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ public void OnWebCamTextureToMatHelperInitialized()
Debug.Log("invertZM " + invertZM.ToString());

detectorParams = DetectorParameters.create();
dictionary = Aruco.getPredefinedDictionary(Aruco.DICT_6X6_250);
dictionary = Aruco.getPredefinedDictionary(dictionaryId);


//If WebCamera is frontFaceing, flip Mat.
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,28 @@ public class TrackedObject
public int id;
public TrackedState state;

public Rect position {
get { return lastPositions [lastPositions.Count - 1].clone (); }
public Rect position
{
get { return lastPositions[lastPositions.Count - 1].clone(); }
}

static private int _id = 0;

public TrackedObject (Rect rect)
public TrackedObject(Rect rect)
{
lastPositions = new PositionsVector ();
lastPositions = new PositionsVector();

numDetectedFrames = 1;
numFramesNotDetected = 0;
state = TrackedState.NEW;

lastPositions.Add (rect.clone ());
lastPositions.Add(rect.clone());

_id = GetNextId ();
_id = GetNextId();
id = _id;
}

static int GetNextId ()
static int GetNextId()
{
_id++;
return _id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ public class TrackedRect : Rect
public int id;
public TrackedState state;

public TrackedRect (int id, Rect rect, TrackedState state, int numDetectedFrames, int numFramesNotDetected)
: base (rect.x, rect.y, rect.width, rect.height)
public TrackedRect(int id, Rect rect, TrackedState state, int numDetectedFrames, int numFramesNotDetected)
: base(rect.x, rect.y, rect.width, rect.height)
{
this.numDetectedFrames = numDetectedFrames;
this.numFramesNotDetected = numFramesNotDetected;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ public class TrackerParameters
public float coeffObjectSpeedUsingInPrediction = 0.8f;
public float coeffRectangleOverlap = 0.7f;

public TrackerParameters ()
public TrackerParameters()
{
}

public TrackerParameters Clone ()
public TrackerParameters Clone()
{
TrackerParameters trackerParameters = new TrackerParameters ();
TrackerParameters trackerParameters = new TrackerParameters();
trackerParameters.numLastPositionsToTrack = numLastPositionsToTrack;
trackerParameters.numStepsToWaitBeforeFirstShow = numStepsToWaitBeforeFirstShow;
trackerParameters.numStepsToTrackWithoutDetectingIfObjectHasNotBeenShown = numStepsToTrackWithoutDetectingIfObjectHasNotBeenShown;
Expand Down
Binary file modified MRTKProjectConfigurator.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified PlayerSettings.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ProjectAssets.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
## Setup
1. Download the latest release unitypackage. [HoloLensWithOpenCVForUnityExample.unitypackage](https://github.com/EnoxSoftware/HoloLensWithOpenCVForUnityExample/releases)
1. Create a new project. (HoloLensWithOpenCVForUnityExample)
* Change the platform to UWP in the "Build Settings" window.
1. Import the OpenCVForUnity.
* Setup the OpenCVForUnity. (Tools > OpenCV for Unity > Set Plugin Import Settings)
* Move the "OpenCVForUnity/StreamingAssets/haarcascade_frontalface_alt.xml" and "OpenCVForUnity/StreamingAssets/lbpcascade_frontalface.xml" to the "Assets/StreamingAssets/" folder.
Expand All @@ -35,9 +36,11 @@
* Set the scripting backend of the plugin inspector to "Any Script Backend". (IL2CPP support)
1. Import the Microsoft.MixedReality.Toolkit.Unity.Foundation.2.2.0.unitypackage.
* Setup the MRTKv2. (Mixed Reality ToolKit > Utilities > Configure Unity Project)
* Do not enable the "Enable MSBuild for Unity" option in the "MRTK Project Configurator > Modify Configurations" tab.
1. Import the HoloLensWithOpenCVForUnityExample.unitypackage.
1. Add the "Assets/HoloLensWithOpenCVForUnityExample/*.unity" files to the "Scenes In Build" list in the "Build Settings" window.
1. 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))
* Enable "WebCam" Capabilties in Publishing settings tab.
1. Build and Deploy to HoloLens. (See [https://developer.microsoft.com/en-us/windows/holographic/holograms_100](https://developer.microsoft.com/en-us/windows/holographic/holograms_100))
* (Print the AR marker "CanonicalMarker-d10-i1-sp500-bb1.pdf" and "ChArUcoBoard-mx5-my7-d10-os1000-bb1.pdf" on an A4 size paper)

Expand Down

0 comments on commit 438b027

Please sign in to comment.