Skip to content

Commit ad19638

Browse files
author
surface
committed
v1.0.1 update OpenCVForUnity version to 2.5.0. Added NrealHumanSegmentationExample.
1 parent a9b5b66 commit ad19638

15 files changed

+3427
-28
lines changed

Assets/NrealLightWithOpenCVForUnityExample/NrealDnnObjectDetectionExample/NrealDnnObjectDetectionExample.cs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -150,18 +150,18 @@ protected virtual void Start()
150150
#else
151151
if (!string.IsNullOrEmpty(classes))
152152
{
153-
classes_filepath = Utils.getFilePath("dnn/" + classes);
154-
if (string.IsNullOrEmpty(classes_filepath)) Debug.Log("The file:" + classes + " did not exist in the folder “Assets/StreamingAssets/dnn”.");
153+
classes_filepath = Utils.getFilePath("OpenCVForUnity/dnn/" + classes);
154+
if (string.IsNullOrEmpty(classes_filepath)) Debug.Log("The file:" + classes + " did not exist in the folder “Assets/StreamingAssets/OpenCVForUnity/dnn”.");
155155
}
156156
if (!string.IsNullOrEmpty(config))
157157
{
158-
config_filepath = Utils.getFilePath("dnn/" + config);
159-
if (string.IsNullOrEmpty(config_filepath)) Debug.Log("The file:" + config + " did not exist in the folder “Assets/StreamingAssets/dnn”.");
158+
config_filepath = Utils.getFilePath("OpenCVForUnity/dnn/" + config);
159+
if (string.IsNullOrEmpty(config_filepath)) Debug.Log("The file:" + config + " did not exist in the folder “Assets/StreamingAssets/OpenCVForUnity/dnn”.");
160160
}
161161
if (!string.IsNullOrEmpty(model))
162162
{
163-
model_filepath = Utils.getFilePath("dnn/" + model);
164-
if (string.IsNullOrEmpty(model_filepath)) Debug.Log("The file:" + model + " did not exist in the folder “Assets/StreamingAssets/dnn”.");
163+
model_filepath = Utils.getFilePath("OpenCVForUnity/dnn/" + model);
164+
if (string.IsNullOrEmpty(model_filepath)) Debug.Log("The file:" + model + " did not exist in the folder “Assets/StreamingAssets/OpenCVForUnity/dnn”.");
165165
}
166166
Run();
167167
#endif
@@ -172,35 +172,35 @@ protected virtual IEnumerator GetFilePath()
172172
{
173173
if (!string.IsNullOrEmpty(classes))
174174
{
175-
var getFilePathAsync_0_Coroutine = Utils.getFilePathAsync("dnn/" + classes, (result) =>
175+
var getFilePathAsync_0_Coroutine = Utils.getFilePathAsync("OpenCVForUnity/dnn/" + classes, (result) =>
176176
{
177177
classes_filepath = result;
178178
});
179179
yield return getFilePathAsync_0_Coroutine;
180180

181-
if (string.IsNullOrEmpty(classes_filepath)) Debug.Log("The file:" + classes + " did not exist in the folder “Assets/StreamingAssets/dnn”.");
181+
if (string.IsNullOrEmpty(classes_filepath)) Debug.Log("The file:" + classes + " did not exist in the folder “Assets/StreamingAssets/OpenCVForUnity/dnn”.");
182182
}
183183

184184
if (!string.IsNullOrEmpty(config))
185185
{
186-
var getFilePathAsync_1_Coroutine = Utils.getFilePathAsync("dnn/" + config, (result) =>
186+
var getFilePathAsync_1_Coroutine = Utils.getFilePathAsync("OpenCVForUnity/dnn/" + config, (result) =>
187187
{
188188
config_filepath = result;
189189
});
190190
yield return getFilePathAsync_1_Coroutine;
191191

192-
if (string.IsNullOrEmpty(config_filepath)) Debug.Log("The file:" + config + " did not exist in the folder “Assets/StreamingAssets/dnn”.");
192+
if (string.IsNullOrEmpty(config_filepath)) Debug.Log("The file:" + config + " did not exist in the folder “Assets/StreamingAssets/OpenCVForUnity/dnn”.");
193193
}
194194

195195
if (!string.IsNullOrEmpty(model))
196196
{
197-
var getFilePathAsync_2_Coroutine = Utils.getFilePathAsync("dnn/" + model, (result) =>
197+
var getFilePathAsync_2_Coroutine = Utils.getFilePathAsync("OpenCVForUnity/dnn/" + model, (result) =>
198198
{
199199
model_filepath = result;
200200
});
201201
yield return getFilePathAsync_2_Coroutine;
202202

203-
if (string.IsNullOrEmpty(model_filepath)) Debug.Log("The file:" + model + " did not exist in the folder “Assets/StreamingAssets/dnn”.");
203+
if (string.IsNullOrEmpty(model_filepath)) Debug.Log("The file:" + model + " did not exist in the folder “Assets/StreamingAssets/OpenCVForUnity/dnn”.");
204204
}
205205

206206
getFilePath_Coroutine = null;
@@ -220,7 +220,7 @@ protected virtual void Run()
220220
classNames = readClassNames(classes_filepath);
221221
if (classNames == null)
222222
{
223-
Debug.LogError(classes + " is not loaded. Please see “Assets/StreamingAssets/dnn/setup_dnn_module.pdf”. ");
223+
Debug.LogError(classes + " is not loaded. Please see “Assets/StreamingAssets/OpenCVForUnity/dnn/setup_dnn_module.pdf”. ");
224224
}
225225
}
226226
else if (classesList.Count > 0)
@@ -230,7 +230,7 @@ protected virtual void Run()
230230

231231
if (string.IsNullOrEmpty(model_filepath))
232232
{
233-
Debug.LogError(model + " is not loaded. Please see “Assets/StreamingAssets/dnn/setup_dnn_module.pdf”. ");
233+
Debug.LogError(model + " is not loaded. Please see “Assets/StreamingAssets/OpenCVForUnity/dnn/setup_dnn_module.pdf”. ");
234234
}
235235
else
236236
{

Assets/NrealLightWithOpenCVForUnityExample/NrealDnnObjectDetectionExample/NrealLibFaceDetectionV2Example.unity

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,10 @@ PrefabInstance:
288288
propertyPath: m_Name
289289
value: FPSCanvas
290290
objectReference: {fileID: 0}
291+
- target: {fileID: 114491031132128258, guid: 67d84a29ffd5ca443ae62b9736795f1b, type: 3}
292+
propertyPath: m_PresetInfoIsWorld
293+
value: 1
294+
objectReference: {fileID: 0}
291295
- target: {fileID: 224453369079705500, guid: 67d84a29ffd5ca443ae62b9736795f1b, type: 3}
292296
propertyPath: m_Pivot.x
293297
value: 0.5
@@ -832,7 +836,7 @@ PrefabInstance:
832836
objectReference: {fileID: 0}
833837
- target: {fileID: 4275651716754104, guid: 665d8158924bd2648a94fb3f87691bbb, type: 3}
834838
propertyPath: m_RootOrder
835-
value: 0
839+
value: 1
836840
objectReference: {fileID: 0}
837841
- target: {fileID: 4275651716754104, guid: 665d8158924bd2648a94fb3f87691bbb, type: 3}
838842
propertyPath: m_LocalPosition.x
@@ -1574,7 +1578,7 @@ PrefabInstance:
15741578
objectReference: {fileID: 0}
15751579
- target: {fileID: 4808320353365586, guid: ad152f08ed7eb6e4abd93376a0203e38, type: 3}
15761580
propertyPath: m_RootOrder
1577-
value: 1
1581+
value: 0
15781582
objectReference: {fileID: 0}
15791583
- target: {fileID: 4808320353365586, guid: ad152f08ed7eb6e4abd93376a0203e38, type: 3}
15801584
propertyPath: m_LocalPosition.x

Assets/NrealLightWithOpenCVForUnityExample/NrealFaceDetectionExample/NrealFaceDetectionExample.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,23 +206,23 @@ public void OnWebCamTextureToMatHelperInitialized()
206206

207207

208208
cascade = new CascadeClassifier();
209-
cascade.load(Utils.getFilePath("objdetect/lbpcascade_frontalface.xml"));
209+
cascade.load(Utils.getFilePath("OpenCVForUnity/objdetect/lbpcascade_frontalface.xml"));
210210
#if !UNITY_WSA_10_0 || UNITY_EDITOR
211211
// "empty" method is not working on the UWP platform.
212212
if (cascade.empty())
213213
{
214-
Debug.LogError("cascade file is not loaded. Please copy from “OpenCVForUnity/StreamingAssets/” to “Assets/StreamingAssets/” folder. ");
214+
Debug.LogError("cascade file is not loaded. Please copy from “OpenCVForUnity/StreamingAssets/OpenCVForUnity/objdetect/” to “Assets/StreamingAssets/OpenCVForUnity/objdetect/” folder. ");
215215
}
216216
#endif
217217

218218
grayMat4Thread = new Mat();
219219
cascade4Thread = new CascadeClassifier();
220-
cascade4Thread.load(Utils.getFilePath("objdetect/haarcascade_frontalface_alt.xml"));
220+
cascade4Thread.load(Utils.getFilePath("OpenCVForUnity/objdetect/haarcascade_frontalface_alt.xml"));
221221
#if !UNITY_WSA_10_0 || UNITY_EDITOR
222222
// "empty" method is not working on the UWP platform.
223223
if (cascade4Thread.empty())
224224
{
225-
Debug.LogError("cascade file is not loaded. Please copy from “OpenCVForUnity/StreamingAssets/” to “Assets/StreamingAssets/” folder. ");
225+
Debug.LogError("cascade file is not loaded. Please copy from “OpenCVForUnity/StreamingAssets/OpenCVForUnity/objdetect/” to “Assets/StreamingAssets/OpenCVForUnity/objdetect/” folder. ");
226226
}
227227
#endif
228228
}

Assets/NrealLightWithOpenCVForUnityExample/NrealHumanSegmentationExample.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)