|
|
@@ -342,7 +342,12 @@ public partial class ScreenLocate : MonoBehaviour
|
|
|
Debug.Log("Init Red filterValue:" + redfilterValue);
|
|
|
infraredLocate.SetBrightnessThreshold(redfilterValue); // 参数是 红外灯的亮度阈值,阈值越小能够检测到的亮度就越低,默认值是0.93
|
|
|
}
|
|
|
- screenIdentification.Screen.CurCameraSize = getUVCCameraInfoSize; // 同步分辨率
|
|
|
+
|
|
|
+ if (screenIdentification.Screen.RefreshCameraSize(getUVCCameraInfoSize)) // 同步分辨率, 分辨率变化后还需同步到InfraredDemo
|
|
|
+ {
|
|
|
+ ScreenLocate.quadUnityVectorList = screenIdentification.Screen.QuadInCamera.GetUnityVertexList();
|
|
|
+ SyncInfraredDemo();
|
|
|
+ }
|
|
|
|
|
|
if (mode == Mode.ScreenLocateManual)
|
|
|
{
|
|
|
@@ -637,6 +642,7 @@ public partial class ScreenLocate : MonoBehaviour
|
|
|
}
|
|
|
public void OnLocateScreenEnter()
|
|
|
{
|
|
|
+ screenIdentification.Screen.QuadInCamera = null;
|
|
|
DefaultResolutionIndex = InfraredDemoMain?.ResolutionIndex ?? 0; // 记录一下进入前的分辨率(游戏场景的分辨率,比识别时更低)
|
|
|
InfraredDemoMain?.SetResolutionNew(HighScreenLocateResolutionIndex);
|
|
|
CreateUVCTexture2DIfNeeded();
|
|
|
@@ -761,7 +767,7 @@ public partial class ScreenLocate : MonoBehaviour
|
|
|
{
|
|
|
if (quadUnityVectorList.Count == 0) return;
|
|
|
Vector2 texSize = getUVCCameraInfoSize;
|
|
|
- Debug.Log("quadUnityVectorList" + quadUnityVectorList.Count);
|
|
|
+ Debug.Log("[SyncInfraredDemo] quadUnityVectorList Count: " + quadUnityVectorList.Count);
|
|
|
//同步到infaredDemo
|
|
|
FindObjectOfType<InfraredDemo>()?.SetLocatePointsToCameraRender(
|
|
|
quadUnityVectorList,
|