Skip to content

Commit 1ac803d

Browse files
committed
v1.0.5 update OpenCVForUnity version to 2.6.4.
1 parent 8518994 commit 1ac803d

28 files changed

+665
-182
lines changed

Assets/NrealLightWithOpenCVForUnityExample/Materials/holographicImageBlendGrayscale_material.mat

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22
%TAG !u! tag:unity3d.com,2011:
33
--- !u!21 &2100000
44
Material:
5-
serializedVersion: 6
5+
serializedVersion: 8
66
m_ObjectHideFlags: 0
77
m_CorrespondingSourceObject: {fileID: 0}
88
m_PrefabInstance: {fileID: 0}
99
m_PrefabAsset: {fileID: 0}
1010
m_Name: holographicImageBlendGrayscale_material
1111
m_Shader: {fileID: 4800000, guid: b31aa24f8b8045b479ee2194b93a28f4, type: 3}
12-
m_ShaderKeywords:
12+
m_ValidKeywords: []
13+
m_InvalidKeywords: []
1314
m_LightmapFlags: 5
1415
m_EnableInstancingVariants: 0
1516
m_DoubleSidedGI: 0
@@ -23,6 +24,7 @@ Material:
2324
m_Texture: {fileID: 0}
2425
m_Scale: {x: 1, y: 1}
2526
m_Offset: {x: 0, y: 0}
27+
m_Ints: []
2628
m_Floats:
2729
- _VignetteScale: 0
2830
m_Colors:

Assets/NrealLightWithOpenCVForUnityExample/NRCamTextureToMatHelperExample.meta renamed to Assets/NrealLightWithOpenCVForUnityExample/NRCamTexture2MatHelperExample.meta

File renamed without changes.

Assets/NrealLightWithOpenCVForUnityExample/NRCamTextureToMatHelperExample/ComicFilter.cs renamed to Assets/NrealLightWithOpenCVForUnityExample/NRCamTexture2MatHelperExample/ComicFilter.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using OpenCVForUnity.CoreModule;
22
using OpenCVForUnity.ImgprocModule;
3+
using OpenCVForUnity.UnityUtils;
34
using OpenCVForUnity.UtilsModule;
45
using System;
56

Assets/NrealLightWithOpenCVForUnityExample/NRCamTextureToMatHelperExample/ComicFilter.cs.meta renamed to Assets/NrealLightWithOpenCVForUnityExample/NRCamTexture2MatHelperExample/ComicFilter.cs.meta

File renamed without changes.

Assets/NrealLightWithOpenCVForUnityExample/NRCamTextureToMatHelperExample/NRCamTextureToMatHelperExample.cs renamed to Assets/NrealLightWithOpenCVForUnityExample/NRCamTexture2MatHelperExample/NRCamTexture2MatHelperExample.cs

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
namespace NrealLightWithOpenCVForUnityExample
1414
{
1515
/// <summary>
16-
/// NRCamTextureToMatHelper Example
16+
/// NRCamTexture2MatHelper Example
1717
/// An example of image processing (comic filter) using OpenCVForUnity on NrealLight.
1818
/// </summary>
19-
[RequireComponent(typeof(NRCamTextureToMatHelper))]
20-
public class NRCamTextureToMatHelperExample : MonoBehaviour
19+
[RequireComponent(typeof(NRCamTexture2MatHelper))]
20+
public class NRCamTexture2MatHelperExample : MonoBehaviour
2121
{
2222

2323
/// <summary>
@@ -43,7 +43,7 @@ public class NRCamTextureToMatHelperExample : MonoBehaviour
4343
/// <summary>
4444
/// The webcam texture to mat helper.
4545
/// </summary>
46-
NRCamTextureToMatHelper webCamTextureToMatHelper;
46+
NRCamTexture2MatHelper webCamTextureToMatHelper;
4747

4848
/// <summary>
4949
/// The quad renderer.
@@ -76,8 +76,8 @@ public class NRCamTextureToMatHelperExample : MonoBehaviour
7676
// Use this for initialization
7777
void Start()
7878
{
79-
webCamTextureToMatHelper = gameObject.GetComponent<NRCamTextureToMatHelper>();
80-
webCamTextureToMatHelper.outputColorFormat = WebCamTextureToMatHelper.ColorFormat.RGB;
79+
webCamTextureToMatHelper = gameObject.GetComponent<NRCamTexture2MatHelper>();
80+
webCamTextureToMatHelper.outputColorFormat = Source2MatHelperColorFormat.RGB;
8181
webCamTextureToMatHelper.Initialize();
8282

8383
// Update GUI state
@@ -94,10 +94,10 @@ public void OnWebCamTextureToMatHelperInitialized()
9494
{
9595
Debug.Log("OnWebCamTextureToMatHelperInitialized");
9696

97-
Mat webCamTextureMat = webCamTextureToMatHelper.GetMat();
97+
Mat rgbMat = webCamTextureToMatHelper.GetMat();
9898

99-
texture = new Texture2D(webCamTextureMat.cols(), webCamTextureMat.rows(), TextureFormat.RGB24, false);
100-
Utils.matToTexture2D(webCamTextureMat, texture);
99+
texture = new Texture2D(rgbMat.cols(), rgbMat.rows(), TextureFormat.RGB24, false);
100+
Utils.matToTexture2D(rgbMat, texture);
101101

102102
gameObject.GetComponent<Renderer>().material.mainTexture = texture;
103103

@@ -136,9 +136,10 @@ public void OnWebCamTextureToMatHelperDisposed()
136136
/// Raises the webcam texture to mat helper error occurred event.
137137
/// </summary>
138138
/// <param name="errorCode">Error code.</param>
139-
public void OnWebCamTextureToMatHelperErrorOccurred(WebCamTextureToMatHelper.ErrorCode errorCode)
139+
/// <param name="message">Message.</param>
140+
public void OnWebCamTextureToMatHelperErrorOccurred(Source2MatHelperErrorCode errorCode, string message)
140141
{
141-
Debug.Log("OnWebCamTextureToMatHelperErrorOccurred " + errorCode);
142+
Debug.Log("OnWebCamTextureToMatHelperErrorOccurred " + errorCode + ":" + message);
142143
}
143144

144145
// Update is called once per frame
@@ -157,7 +158,7 @@ void Update()
157158
Imgproc.putText(rgbMat, "W:" + rgbMat.width() + " H:" + rgbMat.height() + " SO:" + Screen.orientation, new Point(5, rgbMat.rows() - 10), Imgproc.FONT_HERSHEY_SIMPLEX, 1.0, new Scalar(255, 255, 255, 255), 2, Imgproc.LINE_AA, false);
158159
}
159160

160-
Utils.fastMatToTexture2D(rgbMat, texture);
161+
Utils.matToTexture2D(rgbMat, texture);
161162
}
162163

163164
if (webCamTextureToMatHelper.IsPlaying())

Assets/NrealLightWithOpenCVForUnityExample/NRCamTextureToMatHelperExample/NRCamTextureToMatHelperExample.cs.meta renamed to Assets/NrealLightWithOpenCVForUnityExample/NRCamTexture2MatHelperExample/NRCamTexture2MatHelperExample.cs.meta

File renamed without changes.

0 commit comments

Comments
 (0)