Skip to content

Commit 56f8f00

Browse files
committed
update 2.5.0
1 parent 8388f9b commit 56f8f00

File tree

144 files changed

+10000
-2436
lines changed

Some content is hidden

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

144 files changed

+10000
-2436
lines changed

Assets/OpenCVForUnity/Examples/Basic/MatBasicProcessingExample/MatBasicProcessingExample.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ public void OnCVExceptionHandlingExampleButtonClick()
300300

301301
Mat m3 = m1 / m2; // element type is different.
302302
Debug.Log("m3=" + m3);
303+
executionResultText.text += "m3=" + m3 + "\n";
303304

304305
Utils.setDebugMode(false);
305306

@@ -309,6 +310,7 @@ public void OnCVExceptionHandlingExampleButtonClick()
309310
{
310311
Mat m4 = m1 / m2; // element type is different.
311312
Debug.Log("m4=" + m4);
313+
executionResultText.text += "m4=" + m4 + "\n";
312314
}
313315
catch (Exception e)
314316
{

Assets/OpenCVForUnity/Examples/Basic/Utils_GetFilePathExample/Utils_GetFilePathExample.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ public class Utils_GetFilePathExample : MonoBehaviour
6060
public Text filePathInputField;
6161

6262
string[] filePathPreset = new string[] {
63-
"768x576_mjpeg.mjpeg",
64-
"/objdetect/lbpcascade_frontalface.xml",
65-
"aruco/calibration_images/left01.jpg",
63+
"OpenCVForUnity/768x576_mjpeg.mjpeg",
64+
"/OpenCVForUnity/objdetect/lbpcascade_frontalface.xml",
65+
"OpenCVForUnity/aruco/calibration_images/left01.jpg",
6666
"xxx"
6767
};
6868

@@ -91,8 +91,8 @@ private void GetFilePath(string filePath, bool refresh, int timeout)
9191
#else
9292
if (string.IsNullOrEmpty(readableFilePath))
9393
{
94-
Debug.LogError("# completed: " + "readableFilePath= " + filePath + " is not loaded. Please move from “OpenCVForUnity/StreamingAssets/” to “Assets/StreamingAssets/” folder.");
95-
filePathInputField.text = filePathInputField.text + "# completed: " + "readableFilePath= " + filePath + " is not loaded. Please move from “OpenCVForUnity/StreamingAssets/” to “Assets/StreamingAssets/” folder." + "\n";
94+
Debug.LogError("# completed: " + "readableFilePath= " + filePath + " is not loaded. Please move from “OpenCVForUnity/StreamingAssets/OpenCVForUnity/” to “Assets/StreamingAssets/OpenCVForUnity/” folder.");
95+
filePathInputField.text = filePathInputField.text + "# completed: " + "readableFilePath= " + filePath + " is not loaded. Please move from “OpenCVForUnity/StreamingAssets/OpenCVForUnity/” to “Assets/StreamingAssets/OpenCVForUnity/” folder." + "\n";
9696
}
9797
else
9898
{
@@ -126,8 +126,8 @@ private void GetMultipleFilePaths(string[] filePaths, bool refresh, int timeout)
126126
{
127127
if (string.IsNullOrEmpty(readableFilePaths[i]))
128128
{
129-
Debug.LogError("readableFilePath[" + i + "]= " + filePaths[i] + " is not loaded. Please move from “OpenCVForUnity/StreamingAssets/” to “Assets/StreamingAssets/” folder.");
130-
filePathInputField.text = filePathInputField.text + "readableFilePath[" + i + "]= " + filePaths[i] + " is not loaded. Please move from “OpenCVForUnity/StreamingAssets/” to “Assets/StreamingAssets/” folder." + "\n";
129+
Debug.LogError("readableFilePath[" + i + "]= " + filePaths[i] + " is not loaded. Please move from “OpenCVForUnity/StreamingAssets/OpenCVForUnity/” to “Assets/StreamingAssets/OpenCVForUnity/” folder.");
130+
filePathInputField.text = filePathInputField.text + "readableFilePath[" + i + "]= " + filePaths[i] + " is not loaded. Please move from “OpenCVForUnity/StreamingAssets/OpenCVForUnity/” to “Assets/StreamingAssets/OpenCVForUnity/” folder." + "\n";
131131
}
132132
else
133133
{
@@ -155,8 +155,8 @@ private void GetFilePathAsync(string filePath, bool refresh, int timeout)
155155

156156
if (string.IsNullOrEmpty(readableFilePath))
157157
{
158-
Debug.LogError("# completed: " + "readableFilePath= " + filePath + " is not loaded. Please move from “OpenCVForUnity/StreamingAssets/” to “Assets/StreamingAssets/” folder.");
159-
filePathInputField.text = filePathInputField.text + "# completed: " + "readableFilePath= " + filePath + " is not loaded. Please move from “OpenCVForUnity/StreamingAssets/” to “Assets/StreamingAssets/” folder." + "\n";
158+
Debug.LogError("# completed: " + "readableFilePath= " + filePath + " is not loaded. Please move from “OpenCVForUnity/StreamingAssets/OpenCVForUnity/” to “Assets/StreamingAssets/OpenCVForUnity/” folder.");
159+
filePathInputField.text = filePathInputField.text + "# completed: " + "readableFilePath= " + filePath + " is not loaded. Please move from “OpenCVForUnity/StreamingAssets/OpenCVForUnity/” to “Assets/StreamingAssets/OpenCVForUnity/” folder." + "\n";
160160
}
161161

162162
Debug.Log("# completed: " + "readableFilePath= " + readableFilePath);
@@ -205,8 +205,8 @@ private void GetMultipleFilePathsAsync(string[] filePaths, bool refresh, int tim
205205
{
206206
if (string.IsNullOrEmpty(readableFilePaths[i]))
207207
{
208-
Debug.LogError("readableFilePath[" + i + "]= " + filePaths[i] + " is not loaded. Please move from “OpenCVForUnity/StreamingAssets/” to “Assets/StreamingAssets/” folder.");
209-
filePathInputField.text = filePathInputField.text + "readableFilePath[" + i + "]= " + filePaths[i] + " is not loaded. Please move from “OpenCVForUnity/StreamingAssets/” to “Assets/StreamingAssets/” folder." + "\n";
208+
Debug.LogError("readableFilePath[" + i + "]= " + filePaths[i] + " is not loaded. Please move from “OpenCVForUnity/StreamingAssets/OpenCVForUnity/” to “Assets/StreamingAssets/OpenCVForUnity/” folder.");
209+
filePathInputField.text = filePathInputField.text + "readableFilePath[" + i + "]= " + filePaths[i] + " is not loaded. Please move from “OpenCVForUnity/StreamingAssets/OpenCVForUnity/” to “Assets/StreamingAssets/OpenCVForUnity/” folder." + "\n";
210210
}
211211
else
212212
{

Assets/OpenCVForUnity/Examples/Basic/Utils_GetFilePathExample/Utils_GetFilePathExample.unity

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -967,11 +967,11 @@ MonoBehaviour:
967967
m_Value: 0
968968
m_Options:
969969
m_Options:
970-
- m_Text: 'Path: 768x576_mjpeg.mjpeg'
970+
- m_Text: 'Path: OpenCVForUnity/768x576_mjpeg.mjpeg'
971971
m_Image: {fileID: 0}
972-
- m_Text: 'Path: /objdetect/lbpcascade_frontalface.xml'
972+
- m_Text: 'Path: /OpenCVForUnity/objdetect/lbpcascade_frontalface.xml'
973973
m_Image: {fileID: 0}
974-
- m_Text: 'Path: aruco/calibration_images/left01.jpg'
974+
- m_Text: 'Path: OpenCVForUnity/aruco/calibration_images/left01.jpg'
975975
m_Image: {fileID: 0}
976976
- m_Text: 'Path: xxx (error)'
977977
m_Image: {fileID: 0}
@@ -1609,7 +1609,7 @@ MonoBehaviour:
16091609
m_HorizontalOverflow: 0
16101610
m_VerticalOverflow: 0
16111611
m_LineSpacing: 1
1612-
m_Text: 'Path: 768x576_mjpeg.mjpeg'
1612+
m_Text: 'Path: OpenCVForUnity/768x576_mjpeg.mjpeg'
16131613
--- !u!222 &757276707
16141614
CanvasRenderer:
16151615
m_ObjectHideFlags: 0

Assets/OpenCVForUnity/Examples/Basic/WebCamTextureToMatExample/WebCamTextureToMatExample.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ private IEnumerator _Initialize()
133133
isInitWaiting = true;
134134

135135
// Checks camera permission state.
136-
#if UNITY_IOS && UNITY_2018_1_OR_NEWER
136+
#if (UNITY_IOS || UNITY_WEBGL) && UNITY_2018_1_OR_NEWER
137137
UserAuthorization mode = UserAuthorization.WebCam;
138138
if (!Application.HasUserAuthorization(mode))
139139
{
@@ -281,7 +281,7 @@ private IEnumerator _Initialize()
281281
}
282282
}
283283

284-
#if (UNITY_IOS && UNITY_2018_1_OR_NEWER) || (UNITY_ANDROID && UNITY_2018_3_OR_NEWER)
284+
#if ((UNITY_IOS || UNITY_WEBGL) && UNITY_2018_1_OR_NEWER) || (UNITY_ANDROID && UNITY_2018_3_OR_NEWER)
285285
bool isUserRequestingPermission;
286286

287287
IEnumerator OnApplicationFocus(bool hasFocus)

Assets/OpenCVForUnity/Examples/ContribModules/aruco/ArUcoExample/ArUcoCameraCalibrationExample.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,8 @@ public class ArUcoCameraCalibrationExample : MonoBehaviour
169169
/// The calibration images directory path.
170170
/// Set a relative directory path from the starting point of the "StreamingAssets" folder. e.g. "aruco/calibration_images/".
171171
/// </summary>
172-
[Tooltip("Set a relative directory path from the starting point of the \"StreamingAssets\" folder. e.g. \"aruco/calibration_images\"")]
173-
public string calibrationImagesDirectory = "aruco/calibration_images";
172+
[Tooltip("Set a relative directory path from the starting point of the \"StreamingAssets\" folder. e.g. \"OpenCVForUnity/aruco/calibration_images\"")]
173+
public string calibrationImagesDirectory = "OpenCVForUnity/aruco/calibration_images";
174174

175175
/// <summary>
176176
/// The texture.

Assets/OpenCVForUnity/Examples/ContribModules/aruco/ArUcoExample/ArUcoCameraCalibrationExample.unity

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7410,7 +7410,7 @@ MonoBehaviour:
74107410
dictionaryIdDropdown: {fileID: 229363025}
74117411
refineMarkerDetection: 1
74127412
isImagesInputMode: 0
7413-
calibrationImagesDirectory: aruco/calibration_images
7413+
calibrationImagesDirectory: OpenCVForUnity/aruco/calibration_images
74147414
--- !u!1 &1793984378
74157415
GameObject:
74167416
m_ObjectHideFlags: 0

Assets/OpenCVForUnity/Examples/ContribModules/barcode/BarcodeDetectorExample/BarcodeDetectorExample.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ private void Run()
3535
BarcodeDetector detector = new BarcodeDetector();
3636

3737
// When using super resolution.
38-
// Please, download 'sr.*' from https://github.com/WeChatCV/opencv_3rdparty/tree/wechat_qrcode and put them into the StreamingAssets/barcode directory.
39-
//BarcodeDetector detector = new BarcodeDetector(Utils.getFilePath("barcode/sr.prototxt"), Utils.getFilePath("barcode/sr.caffemodel"));
38+
// Please, download 'sr.*' from https://github.com/WeChatCV/opencv_3rdparty/tree/wechat_qrcode and put them into the StreamingAssets/OpenCVForUnity/barcode directory.
39+
//BarcodeDetector detector = new BarcodeDetector(Utils.getFilePath("OpenCVForUnity/barcode/sr.prototxt"), Utils.getFilePath("OpenCVForUnity/barcode/sr.caffemodel"));
4040

4141
List<string> decoded_info = new List<string>();
4242
List<int> decoded_type = new List<int>();

Assets/OpenCVForUnity/Examples/ContribModules/barcode/BarcodeDetectorExample/BarcodeDetectorWebCamExample.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ void Start()
5151
detector = new BarcodeDetector();
5252

5353
// When using super resolution.
54-
// Please, download 'sr.*' from https://github.com/WeChatCV/opencv_3rdparty/tree/wechat_qrcode and put them into the StreamingAssets/barcode directory.
55-
//detector = new BarcodeDetector(Utils.getFilePath("barcode/sr.prototxt"), Utils.getFilePath("barcode/sr.caffemodel"));
54+
// Please, download 'sr.*' from https://github.com/WeChatCV/opencv_3rdparty/tree/wechat_qrcode and put them into the StreamingAssets/OpenCVForUnity/barcode directory.
55+
//detector = new BarcodeDetector(Utils.getFilePath("OpenCVForUnity/barcode/sr.prototxt"), Utils.getFilePath("OpenCVForUnity/barcode/sr.caffemodel"));
5656

5757

5858
#if UNITY_ANDROID && !UNITY_EDITOR

Assets/OpenCVForUnity/Examples/ContribModules/face/FaceMarkExample/FaceMarkExample.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public class FaceMarkExample : MonoBehaviour
6363
/// <summary>
6464
/// FACEMARK_CASCADE_FILENAME
6565
/// </summary>
66-
protected static readonly string FACEMARK_CASCADE_FILENAME = "objdetect/lbpcascade_frontalface.xml";
66+
protected static readonly string FACEMARK_CASCADE_FILENAME = "OpenCVForUnity/objdetect/lbpcascade_frontalface.xml";
6767

6868
/// <summary>
6969
/// The facemark cascade filepath.
@@ -73,7 +73,7 @@ public class FaceMarkExample : MonoBehaviour
7373
/// <summary>
7474
/// FACEMARK_CASCADE_FILENAME
7575
/// </summary>
76-
protected static readonly string FACEMARK_MODEL_FILENAME = "face/lbfmodel.yaml";
76+
protected static readonly string FACEMARK_MODEL_FILENAME = "OpenCVForUnity/face/lbfmodel.yaml";
7777

7878
/// <summary>
7979
/// The facemark model filepath.
@@ -130,7 +130,7 @@ void Run()
130130

131131
if (string.IsNullOrEmpty(facemark_model_filepath))
132132
{
133-
Debug.LogError(FACEMARK_MODEL_FILENAME + " is not loaded. Please read “StreamingAssets/face/setup_dnn_module.pdf” to make the necessary setup.");
133+
Debug.LogError(FACEMARK_MODEL_FILENAME + " is not loaded. Please read “StreamingAssets/OpenCVForUnity/face/setup_dnn_module.pdf” to make the necessary setup.");
134134
}
135135
else
136136
{
@@ -141,7 +141,7 @@ void Run()
141141

142142
if (string.IsNullOrEmpty(facemark_cascade_filepath))
143143
{
144-
Debug.LogError(FACEMARK_CASCADE_FILENAME + " is not loaded. Please move from “OpenCVForUnity/StreamingAssets/” to “Assets/StreamingAssets/” folder.");
144+
Debug.LogError(FACEMARK_CASCADE_FILENAME + " is not loaded. Please move from “OpenCVForUnity/StreamingAssets/OpenCVForUnity/” to “Assets/StreamingAssets/OpenCVForUnity/” folder.");
145145
}
146146
else
147147
{

Assets/OpenCVForUnity/Examples/ContribModules/face/FaceRecognizerExample/FaceRecognizerExample.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public class FaceRecognizerExample : MonoBehaviour
2222
/// <summary>
2323
/// IMAGE_0_FILENAME
2424
/// </summary>
25-
protected static readonly string IMAGE_0_FILENAME = "face/facerec_0.bmp";
25+
protected static readonly string IMAGE_0_FILENAME = "OpenCVForUnity/face/facerec_0.bmp";
2626

2727
/// <summary>
2828
/// The image 0 filepath.
@@ -32,7 +32,7 @@ public class FaceRecognizerExample : MonoBehaviour
3232
/// <summary>
3333
/// IMAGE_1_FILENAME
3434
/// </summary>
35-
protected static readonly string IMAGE_1_FILENAME = "face/facerec_1.bmp";
35+
protected static readonly string IMAGE_1_FILENAME = "OpenCVForUnity/face/facerec_1.bmp";
3636

3737
/// <summary>
3838
/// The image 1 filepath.
@@ -42,7 +42,7 @@ public class FaceRecognizerExample : MonoBehaviour
4242
/// <summary>
4343
/// SAMPLE_IMAGE_FILENAME
4444
/// </summary>
45-
protected static readonly string SAMPLE_IMAGE_FILENAME = "face/facerec_sample.bmp";
45+
protected static readonly string SAMPLE_IMAGE_FILENAME = "OpenCVForUnity/face/facerec_sample.bmp";
4646

4747
/// <summary>
4848
/// The sample image filepath.
@@ -95,7 +95,7 @@ private void Run()
9595
{
9696
if (string.IsNullOrEmpty(image_0_filepath) || string.IsNullOrEmpty(image_1_filepath) || string.IsNullOrEmpty(sample_image_filepath))
9797
{
98-
Debug.LogError(IMAGE_0_FILENAME + " or " + IMAGE_1_FILENAME + " or " + SAMPLE_IMAGE_FILENAME + " is not loaded. Please move from “OpenCVForUnity/StreamingAssets/” to “Assets/StreamingAssets/” folder.");
98+
Debug.LogError(IMAGE_0_FILENAME + " or " + IMAGE_1_FILENAME + " or " + SAMPLE_IMAGE_FILENAME + " is not loaded. Please move from “OpenCVForUnity/StreamingAssets/OpenCVForUnity/” to “Assets/StreamingAssets/OpenCVForUnity/” folder.");
9999
}
100100

101101
List<Mat> images = new List<Mat>();

0 commit comments

Comments
 (0)