Skip to content

Commit 438b027

Browse files
committed
Fixed README.
1 parent c77eb2e commit 438b027

File tree

9 files changed

+267
-196
lines changed

9 files changed

+267
-196
lines changed

Assets/HoloLensWithOpenCVForUnityExample/HoloLensArUcoExample/HoloLensArUcoExample.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ public void OnWebCamTextureToMatHelperInitialized()
453453
Debug.Log("invertZM " + invertZM.ToString());
454454

455455
detectorParams = DetectorParameters.create();
456-
dictionary = Aruco.getPredefinedDictionary(Aruco.DICT_6X6_250);
456+
dictionary = Aruco.getPredefinedDictionary(dictionaryId);
457457

458458

459459
//If WebCamera is frontFaceing, flip Mat.

Assets/HoloLensWithOpenCVForUnityExample/RectangleTracker/Scripts/RectangleTracker.cs

Lines changed: 249 additions & 182 deletions
Large diffs are not rendered by default.

Assets/HoloLensWithOpenCVForUnityExample/RectangleTracker/Scripts/TrackedObject.cs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,27 +22,28 @@ public class TrackedObject
2222
public int id;
2323
public TrackedState state;
2424

25-
public Rect position {
26-
get { return lastPositions [lastPositions.Count - 1].clone (); }
25+
public Rect position
26+
{
27+
get { return lastPositions[lastPositions.Count - 1].clone(); }
2728
}
2829

2930
static private int _id = 0;
3031

31-
public TrackedObject (Rect rect)
32+
public TrackedObject(Rect rect)
3233
{
33-
lastPositions = new PositionsVector ();
34-
34+
lastPositions = new PositionsVector();
35+
3536
numDetectedFrames = 1;
3637
numFramesNotDetected = 0;
3738
state = TrackedState.NEW;
3839

39-
lastPositions.Add (rect.clone ());
40+
lastPositions.Add(rect.clone());
4041

41-
_id = GetNextId ();
42+
_id = GetNextId();
4243
id = _id;
4344
}
4445

45-
static int GetNextId ()
46+
static int GetNextId()
4647
{
4748
_id++;
4849
return _id;

Assets/HoloLensWithOpenCVForUnityExample/RectangleTracker/Scripts/TrackedRect.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ public class TrackedRect : Rect
99
public int id;
1010
public TrackedState state;
1111

12-
public TrackedRect (int id, Rect rect, TrackedState state, int numDetectedFrames, int numFramesNotDetected)
13-
: base (rect.x, rect.y, rect.width, rect.height)
12+
public TrackedRect(int id, Rect rect, TrackedState state, int numDetectedFrames, int numFramesNotDetected)
13+
: base(rect.x, rect.y, rect.width, rect.height)
1414
{
1515
this.numDetectedFrames = numDetectedFrames;
1616
this.numFramesNotDetected = numFramesNotDetected;

Assets/HoloLensWithOpenCVForUnityExample/RectangleTracker/Scripts/TrackerParameters.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ public class TrackerParameters
1212
public float coeffObjectSpeedUsingInPrediction = 0.8f;
1313
public float coeffRectangleOverlap = 0.7f;
1414

15-
public TrackerParameters ()
15+
public TrackerParameters()
1616
{
1717
}
1818

19-
public TrackerParameters Clone ()
19+
public TrackerParameters Clone()
2020
{
21-
TrackerParameters trackerParameters = new TrackerParameters ();
21+
TrackerParameters trackerParameters = new TrackerParameters();
2222
trackerParameters.numLastPositionsToTrack = numLastPositionsToTrack;
2323
trackerParameters.numStepsToWaitBeforeFirstShow = numStepsToWaitBeforeFirstShow;
2424
trackerParameters.numStepsToTrackWithoutDetectingIfObjectHasNotBeenShown = numStepsToTrackWithoutDetectingIfObjectHasNotBeenShown;

MRTKProjectConfigurator.jpg

35.3 KB
Loading

PlayerSettings.jpg

108 KB
Loading

ProjectAssets.jpg

53.1 KB
Loading

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
## Setup
2828
1. Download the latest release unitypackage. [HoloLensWithOpenCVForUnityExample.unitypackage](https://github.com/EnoxSoftware/HoloLensWithOpenCVForUnityExample/releases)
2929
1. Create a new project. (HoloLensWithOpenCVForUnityExample)
30+
* Change the platform to UWP in the "Build Settings" window.
3031
1. Import the OpenCVForUnity.
3132
* Setup the OpenCVForUnity. (Tools > OpenCV for Unity > Set Plugin Import Settings)
3233
* Move the "OpenCVForUnity/StreamingAssets/haarcascade_frontalface_alt.xml" and "OpenCVForUnity/StreamingAssets/lbpcascade_frontalface.xml" to the "Assets/StreamingAssets/" folder.
@@ -35,9 +36,11 @@
3536
* Set the scripting backend of the plugin inspector to "Any Script Backend". (IL2CPP support)
3637
1. Import the Microsoft.MixedReality.Toolkit.Unity.Foundation.2.2.0.unitypackage.
3738
* Setup the MRTKv2. (Mixed Reality ToolKit > Utilities > Configure Unity Project)
39+
* Do not enable the "Enable MSBuild for Unity" option in the "MRTK Project Configurator > Modify Configurations" tab.
3840
1. Import the HoloLensWithOpenCVForUnityExample.unitypackage.
3941
1. Add the "Assets/HoloLensWithOpenCVForUnityExample/*.unity" files to the "Scenes In Build" list in the "Build Settings" window.
4042
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))
43+
* Enable "WebCam" Capabilties in Publishing settings tab.
4144
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))
4245
* (Print the AR marker "CanonicalMarker-d10-i1-sp500-bb1.pdf" and "ChArUcoBoard-mx5-my7-d10-os1000-bb1.pdf" on an A4 size paper)
4346

0 commit comments

Comments
 (0)