@@ -30,8 +30,8 @@ namespace FfmpegWithOpenCVForUnityExample
30
30
/// https://docs.opencv.org/3.2.0/da/d13/tutorial_aruco_calibration.html
31
31
/// https://github.com/opencv/opencv_contrib/blob/master/modules/aruco/samples/calibrate_camera_charuco.cpp
32
32
/// </summary>
33
- [ RequireComponent ( typeof ( FfmpegToMatHelper ) ) ]
34
- public class ArUcoCameraCalibrationFfmpegExample : MonoBehaviour
33
+ [ RequireComponent ( typeof ( FfplayToMatHelper ) ) ]
34
+ public class ArUcoCameraCalibrationFfplayExample : MonoBehaviour
35
35
{
36
36
/// <summary>
37
37
/// The marker type used for calibration.
@@ -178,10 +178,10 @@ public class ArUcoCameraCalibrationFfmpegExample : MonoBehaviour
178
178
179
179
/// <summary>
180
180
/// 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/".
182
182
/// </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" ;
185
185
186
186
/// <summary>
187
187
/// The texture.
@@ -191,7 +191,7 @@ public class ArUcoCameraCalibrationFfmpegExample : MonoBehaviour
191
191
/// <summary>
192
192
/// The webcam texture to mat helper.
193
193
/// </summary>
194
- FfmpegToMatHelper ffmpegToMatHelper ;
194
+ FfplayToMatHelper ffplayToMatHelper ;
195
195
196
196
/// <summary>
197
197
/// The gray mat.
@@ -297,7 +297,7 @@ public class ArUcoCameraCalibrationFfmpegExample : MonoBehaviour
297
297
IEnumerator Start ( )
298
298
{
299
299
300
- ffmpegToMatHelper = gameObject . GetComponent < FfmpegToMatHelper > ( ) ;
300
+ ffplayToMatHelper = gameObject . GetComponent < FfplayToMatHelper > ( ) ;
301
301
302
302
// fix the screen orientation.
303
303
Screen . orientation = ScreenOrientation . LandscapeLeft ;
@@ -330,18 +330,18 @@ IEnumerator Start()
330
330
331
331
if ( ! isImagesInputMode )
332
332
{
333
- ffmpegToMatHelper . Initialize ( ) ;
333
+ ffplayToMatHelper . Initialize ( ) ;
334
334
}
335
335
}
336
336
337
337
/// <summary>
338
338
/// Raises the webcam texture to mat helper initialized event.
339
339
/// </summary>
340
- public void OnFfmpegToMatHelperInitialized ( )
340
+ public void OnFfplayToMatHelperInitialized ( )
341
341
{
342
- Debug . Log ( "OnFfmpegToMatHelperInitialized " ) ;
342
+ Debug . Log ( "OnFfplayToMatHelperInitialized " ) ;
343
343
344
- Mat webCamTextureMat = ffmpegToMatHelper . GetMat ( ) ;
344
+ Mat webCamTextureMat = ffplayToMatHelper . GetMat ( ) ;
345
345
346
346
InitializeCalibraton ( webCamTextureMat ) ;
347
347
@@ -359,9 +359,9 @@ public void OnFfmpegToMatHelperInitialized()
359
359
/// <summary>
360
360
/// Raises the webcam texture to mat helper disposed event.
361
361
/// </summary>
362
- public void OnFfmpegToMatHelperDisposed ( )
362
+ public void OnFfplayToMatHelperDisposed ( )
363
363
{
364
- Debug . Log ( "OnFfmpegToMatHelperDisposed " ) ;
364
+ Debug . Log ( "OnFfplayToMatHelperDisposed " ) ;
365
365
366
366
DisposeCalibraton ( ) ;
367
367
}
@@ -370,9 +370,9 @@ public void OnFfmpegToMatHelperDisposed()
370
370
/// Raises the webcam texture to mat helper error occurred event.
371
371
/// </summary>
372
372
/// <param name="errorCode">Error code.</param>
373
- public void OnFfmpegToMatHelperErrorOccurred ( FfmpegToMatHelper . ErrorCode errorCode )
373
+ public void OnFfplayToMatHelperErrorOccurred ( FfplayToMatHelper . ErrorCode errorCode )
374
374
{
375
- Debug . Log ( "OnFfmpegToMatHelperErrorOccurred " + errorCode ) ;
375
+ Debug . Log ( "OnFfplayToMatHelperErrorOccurred " + errorCode ) ;
376
376
}
377
377
378
378
// Update is called once per frame
@@ -381,10 +381,10 @@ void Update()
381
381
if ( isImagesInputMode )
382
382
return ;
383
383
384
- if ( ffmpegToMatHelper . IsPlaying ( ) && ffmpegToMatHelper . DidUpdateThisFrame ( ) )
384
+ if ( ffplayToMatHelper . IsPlaying ( ) && ffplayToMatHelper . DidUpdateThisFrame ( ) )
385
385
{
386
386
387
- Mat rgbaMat = ffmpegToMatHelper . GetMat ( ) ;
387
+ Mat rgbaMat = ffplayToMatHelper . GetMat ( ) ;
388
388
389
389
Imgproc . cvtColor ( rgbaMat , grayMat , Imgproc . COLOR_RGBA2GRAY ) ;
390
390
@@ -1113,7 +1113,7 @@ void OnDestroy()
1113
1113
}
1114
1114
else
1115
1115
{
1116
- ffmpegToMatHelper . Dispose ( ) ;
1116
+ ffplayToMatHelper . Dispose ( ) ;
1117
1117
}
1118
1118
1119
1119
Screen . orientation = ScreenOrientation . AutoRotation ;
@@ -1135,7 +1135,7 @@ public void OnPlayButtonClick()
1135
1135
if ( isImagesInputMode )
1136
1136
return ;
1137
1137
1138
- ffmpegToMatHelper . Play ( ) ;
1138
+ ffplayToMatHelper . Play ( ) ;
1139
1139
}
1140
1140
1141
1141
/// <summary>
@@ -1191,8 +1191,8 @@ public void OnMarkerTypeDropdownValueChanged(int result)
1191
1191
}
1192
1192
else
1193
1193
{
1194
- if ( ffmpegToMatHelper . IsInitialized ( ) )
1195
- ffmpegToMatHelper . Initialize ( ) ;
1194
+ if ( ffplayToMatHelper . IsInitialized ( ) )
1195
+ ffplayToMatHelper . Initialize ( ) ;
1196
1196
}
1197
1197
}
1198
1198
}
@@ -1215,8 +1215,8 @@ public void OnBoardSizeWDropdownValueChanged(int result)
1215
1215
}
1216
1216
else
1217
1217
{
1218
- if ( ffmpegToMatHelper . IsInitialized ( ) )
1219
- ffmpegToMatHelper . Initialize ( ) ;
1218
+ if ( ffplayToMatHelper . IsInitialized ( ) )
1219
+ ffplayToMatHelper . Initialize ( ) ;
1220
1220
}
1221
1221
}
1222
1222
}
@@ -1236,8 +1236,8 @@ public void OnBoardSizeHDropdownValueChanged(int result)
1236
1236
}
1237
1237
else
1238
1238
{
1239
- if ( ffmpegToMatHelper . IsInitialized ( ) )
1240
- ffmpegToMatHelper . Initialize ( ) ;
1239
+ if ( ffplayToMatHelper . IsInitialized ( ) )
1240
+ ffplayToMatHelper . Initialize ( ) ;
1241
1241
}
1242
1242
}
1243
1243
}
@@ -1325,8 +1325,8 @@ public void OnDictionaryIdDropdownValueChanged(int result)
1325
1325
}
1326
1326
else
1327
1327
{
1328
- if ( ffmpegToMatHelper . IsInitialized ( ) )
1329
- ffmpegToMatHelper . Initialize ( ) ;
1328
+ if ( ffplayToMatHelper . IsInitialized ( ) )
1329
+ ffplayToMatHelper . Initialize ( ) ;
1330
1330
}
1331
1331
}
1332
1332
}
0 commit comments