Skip to content

Commit 745b1bc

Browse files
committed
update 1.0.2
1 parent 7681846 commit 745b1bc

7 files changed

Lines changed: 407 additions & 328 deletions

Assets/MagicLeapWithOpenCVForUnityExample/MLCameraPreviewToMatHelper.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -985,6 +985,7 @@ public virtual bool DidUpdateThisFrame ()
985985
/// <returns>The mat of the current frame.</returns>
986986
public virtual Mat GetMat ()
987987
{
988+
988989
#if !UNITY_EDITOR
989990
// if (!hasInitDone || !MLCamera.Previewing) {
990991
if (!hasInitDone) {
@@ -994,8 +995,13 @@ public virtual Mat GetMat ()
994995
//Because MLCamera.PreviewTexture2D is not readable, you can not get pixels directly. So, Utils.textureToTexture2D () is used.
995996
//Utils.texture2DToMat (MLCamera.PreviewTexture2D, frameMat);
996997
Utils.textureToTexture2D (MLCamera.PreviewTexture2D, texture);
998+
//Graphics.CopyTexture(MLCamera.PreviewTexture2D, texture);
999+
9971000
Utils.texture2DToMat (texture, frameMat);
9981001

1002+
// int numChannels = 4;
1003+
// Utils.copyToMat<byte>(MagicLeapInternal.MLTextureUtils.ConvertToByteArray(MLCamera.PreviewTexture2D, out numChannels), frameMat);
1004+
9991005
return frameMat;
10001006
#else
10011007

Assets/MagicLeapWithOpenCVForUnityExample/MLCameraPreviewToMatHelperExample.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,10 @@ void Start ()
114114
cascade = new CascadeClassifier ();
115115
cascade.load (Utils.getFilePath ("lbpcascade_frontalface.xml"));
116116
// cascade.load (Utils.getFilePath ("haarcascade_frontalface_alt.xml"));
117-
#if !UNITY_WSA_10_0
118117
if (cascade.empty ()) {
119118
Debug.LogError ("cascade file is not loaded. Please copy from “OpenCVForUnity/StreamingAssets/” to “Assets/StreamingAssets/” folder. ");
120119
}
121-
#endif
120+
122121
}
123122

124123
/// <summary>

0 commit comments

Comments
 (0)