Skip to content

Commit 94eac78

Browse files
committed
update v1.0.1
1 parent 6a6f56e commit 94eac78

File tree

46 files changed

+15386
-1153
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+15386
-1153
lines changed

Assets/FfmpegWithOpenCVForUnityExample/ArUcoCameraCalibrationFfmpegExample.meta renamed to Assets/FfmpegWithOpenCVForUnityExample/ArUcoCameraCalibrationFfplayExample.meta

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ namespace FfmpegWithOpenCVForUnityExample
3030
/// https://docs.opencv.org/3.2.0/da/d13/tutorial_aruco_calibration.html
3131
/// https://github.com/opencv/opencv_contrib/blob/master/modules/aruco/samples/calibrate_camera_charuco.cpp
3232
/// </summary>
33-
[RequireComponent(typeof(FfmpegToMatHelper))]
34-
public class ArUcoCameraCalibrationFfmpegExample : MonoBehaviour
33+
[RequireComponent(typeof(FfplayToMatHelper))]
34+
public class ArUcoCameraCalibrationFfplayExample : MonoBehaviour
3535
{
3636
/// <summary>
3737
/// The marker type used for calibration.
@@ -178,10 +178,10 @@ public class ArUcoCameraCalibrationFfmpegExample : MonoBehaviour
178178

179179
/// <summary>
180180
/// The calibration images directory path.
181-
/// Set a relative directory path from the starting point of the "StreamingAssets" folder. e.g. "objdetect/calibration_images/".
181+
/// Set a relative directory path from the starting point of the "StreamingAssets" folder. e.g. "aruco/calibration_images/".
182182
/// </summary>
183-
[Tooltip("Set a relative directory path from the starting point of the \"StreamingAssets\" folder. e.g. \"OpenCVForUnity/objdetect/calibration_images\"")]
184-
public string calibrationImagesDirectory = "OpenCVForUnity/objdetect/calibration_images";
183+
[Tooltip("Set a relative directory path from the starting point of the \"StreamingAssets\" folder. e.g. \"OpenCVForUnity/aruco/calibration_images\"")]
184+
public string calibrationImagesDirectory = "OpenCVForUnity/aruco/calibration_images";
185185

186186
/// <summary>
187187
/// The texture.
@@ -191,7 +191,7 @@ public class ArUcoCameraCalibrationFfmpegExample : MonoBehaviour
191191
/// <summary>
192192
/// The webcam texture to mat helper.
193193
/// </summary>
194-
FfmpegToMatHelper ffmpegToMatHelper;
194+
FfplayToMatHelper ffplayToMatHelper;
195195

196196
/// <summary>
197197
/// The gray mat.
@@ -297,7 +297,7 @@ public class ArUcoCameraCalibrationFfmpegExample : MonoBehaviour
297297
IEnumerator Start()
298298
{
299299

300-
ffmpegToMatHelper = gameObject.GetComponent<FfmpegToMatHelper>();
300+
ffplayToMatHelper = gameObject.GetComponent<FfplayToMatHelper>();
301301

302302
// fix the screen orientation.
303303
Screen.orientation = ScreenOrientation.LandscapeLeft;
@@ -330,18 +330,18 @@ IEnumerator Start()
330330

331331
if (!isImagesInputMode)
332332
{
333-
ffmpegToMatHelper.Initialize();
333+
ffplayToMatHelper.Initialize();
334334
}
335335
}
336336

337337
/// <summary>
338338
/// Raises the webcam texture to mat helper initialized event.
339339
/// </summary>
340-
public void OnFfmpegToMatHelperInitialized()
340+
public void OnFfplayToMatHelperInitialized()
341341
{
342-
Debug.Log("OnFfmpegToMatHelperInitialized");
342+
Debug.Log("OnFfplayToMatHelperInitialized");
343343

344-
Mat webCamTextureMat = ffmpegToMatHelper.GetMat();
344+
Mat webCamTextureMat = ffplayToMatHelper.GetMat();
345345

346346
InitializeCalibraton(webCamTextureMat);
347347

@@ -359,9 +359,9 @@ public void OnFfmpegToMatHelperInitialized()
359359
/// <summary>
360360
/// Raises the webcam texture to mat helper disposed event.
361361
/// </summary>
362-
public void OnFfmpegToMatHelperDisposed()
362+
public void OnFfplayToMatHelperDisposed()
363363
{
364-
Debug.Log("OnFfmpegToMatHelperDisposed");
364+
Debug.Log("OnFfplayToMatHelperDisposed");
365365

366366
DisposeCalibraton();
367367
}
@@ -370,9 +370,9 @@ public void OnFfmpegToMatHelperDisposed()
370370
/// Raises the webcam texture to mat helper error occurred event.
371371
/// </summary>
372372
/// <param name="errorCode">Error code.</param>
373-
public void OnFfmpegToMatHelperErrorOccurred(FfmpegToMatHelper.ErrorCode errorCode)
373+
public void OnFfplayToMatHelperErrorOccurred(FfplayToMatHelper.ErrorCode errorCode)
374374
{
375-
Debug.Log("OnFfmpegToMatHelperErrorOccurred " + errorCode);
375+
Debug.Log("OnFfplayToMatHelperErrorOccurred " + errorCode);
376376
}
377377

378378
// Update is called once per frame
@@ -381,10 +381,10 @@ void Update()
381381
if (isImagesInputMode)
382382
return;
383383

384-
if (ffmpegToMatHelper.IsPlaying() && ffmpegToMatHelper.DidUpdateThisFrame())
384+
if (ffplayToMatHelper.IsPlaying() && ffplayToMatHelper.DidUpdateThisFrame())
385385
{
386386

387-
Mat rgbaMat = ffmpegToMatHelper.GetMat();
387+
Mat rgbaMat = ffplayToMatHelper.GetMat();
388388

389389
Imgproc.cvtColor(rgbaMat, grayMat, Imgproc.COLOR_RGBA2GRAY);
390390

@@ -1113,7 +1113,7 @@ void OnDestroy()
11131113
}
11141114
else
11151115
{
1116-
ffmpegToMatHelper.Dispose();
1116+
ffplayToMatHelper.Dispose();
11171117
}
11181118

11191119
Screen.orientation = ScreenOrientation.AutoRotation;
@@ -1135,7 +1135,7 @@ public void OnPlayButtonClick()
11351135
if (isImagesInputMode)
11361136
return;
11371137

1138-
ffmpegToMatHelper.Play();
1138+
ffplayToMatHelper.Play();
11391139
}
11401140

11411141
/// <summary>
@@ -1191,8 +1191,8 @@ public void OnMarkerTypeDropdownValueChanged(int result)
11911191
}
11921192
else
11931193
{
1194-
if (ffmpegToMatHelper.IsInitialized())
1195-
ffmpegToMatHelper.Initialize();
1194+
if (ffplayToMatHelper.IsInitialized())
1195+
ffplayToMatHelper.Initialize();
11961196
}
11971197
}
11981198
}
@@ -1215,8 +1215,8 @@ public void OnBoardSizeWDropdownValueChanged(int result)
12151215
}
12161216
else
12171217
{
1218-
if (ffmpegToMatHelper.IsInitialized())
1219-
ffmpegToMatHelper.Initialize();
1218+
if (ffplayToMatHelper.IsInitialized())
1219+
ffplayToMatHelper.Initialize();
12201220
}
12211221
}
12221222
}
@@ -1236,8 +1236,8 @@ public void OnBoardSizeHDropdownValueChanged(int result)
12361236
}
12371237
else
12381238
{
1239-
if (ffmpegToMatHelper.IsInitialized())
1240-
ffmpegToMatHelper.Initialize();
1239+
if (ffplayToMatHelper.IsInitialized())
1240+
ffplayToMatHelper.Initialize();
12411241
}
12421242
}
12431243
}
@@ -1325,8 +1325,8 @@ public void OnDictionaryIdDropdownValueChanged(int result)
13251325
}
13261326
else
13271327
{
1328-
if (ffmpegToMatHelper.IsInitialized())
1329-
ffmpegToMatHelper.Initialize();
1328+
if (ffplayToMatHelper.IsInitialized())
1329+
ffplayToMatHelper.Initialize();
13301330
}
13311331
}
13321332
}
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)