snowaterr 1 년 전
부모
커밋
c570213cf9

+ 2 - 2
Assets/InfraredProject/WebCamera/Script/ZIM/InfraredLocate/ScreenIdentification.cs

@@ -297,7 +297,7 @@ namespace o0.Project
                         }
                     }
                     Screen.QuadInCamera = new QuadrilateralInCamera(predicts, new Vector(Size.x, Size.y));
-                    Debug.Log($"[ScreenIdentification拟合结果] RSquared: {rs}, Quad: {Screen.QuadInCamera}");
+                    Debug.Log($"[ScreenIdentification拟合结果] RSquared: {rs}, Quad: {Screen.QuadInCamera.QuadString}");
                     //if (rs < 0.8) Screen.Quad = null;
                 }
 
@@ -315,7 +315,7 @@ namespace o0.Project
                 if (delay == 0)
                 {
                     Size = new Geometry2D.Vector<int>(cam.width, cam.height);          // 记录当前的分辨率
-                    Debug.Log("[ScreenIdentification] 采样纹理,分辨率: [" + Size.x + "," + Size.y + "]");
+                    Debug.Log("[ScreenIdentification] 采样纹理,分辨率: [" + Size.x + ", " + Size.y + "]");
                 }
                 return true;
             }

+ 3 - 3
Assets/InfraredProject/WebCamera/Script/ZIM/InfraredLocate/ScreenMap.cs

@@ -20,7 +20,7 @@ namespace ZIM.Unity
 
         public Rect QuadRect { get; private set; }
         public Vector2 UVSize { get; private set; }     // UV代表屏幕空间的坐标,UVSize代表屏幕坐标的取值范围
-        public bool Active => quadInCamera != null;
+        public bool Active => QuadInCamera != null;
 
         QuadrilateralInCamera quadInCamera;     // 记录的分辨率和识别时的分辨率可能不同
         public QuadrilateralInCamera QuadInCamera
@@ -43,7 +43,7 @@ namespace ZIM.Unity
                 var newSize = value.o0Vector();
                 if (QuadInCamera != null && QuadInCamera.CameraSize != newSize)
                 {
-                    UnityEngine.Debug.Log("[ScreenMap]根据分辨率映射: from " + QuadInCamera.CameraSize + " to " + value);
+                    UnityEngine.Debug.Log("[ScreenMap]根据分辨率映射: from " + QuadInCamera.SizeString + " to " + value);
                     QuadInCamera.ReSize(newSize, ViewAspectRatioSetting);
                     InitByQuad();
                 }
@@ -52,7 +52,7 @@ namespace ZIM.Unity
 
         private void InitByQuad()
         {
-            if (quadInCamera != null)
+            if (QuadInCamera != null)
             {
                 var quad = QuadInCamera.Quad;
                 var x = Math.Min((quad.A - quad.B).Length, (quad.C - quad.D).Length);

+ 3 - 0
Assets/InfraredProject/WebCamera/Script/ZIM/Other/QuadrilateralInCamera.cs

@@ -39,6 +39,9 @@ namespace ZIM.Unity
             Quad = quad;
         }
 
+        public string SizeString => $"[{CameraSize.x}, {CameraSize.y}]";
+        public string QuadString => $"[({Quad.A.x}, {Quad.A.y}), ({Quad.B.x}, {Quad.B.y}), ({Quad.C.x}, {Quad.C.y}), ({Quad.D.x}, {Quad.D.y})]";
+
         // 需要标准化的坐标(即数值范围0-1)时使用,会自动根据当前的CameraSize转换
         private List<Vector> ScreenVertexListNormalized
         {