ZIM 1 tahun lalu
induk
melakukan
5b8d4269cb

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

@@ -292,12 +292,12 @@ namespace o0.Project
 
                 if (quadTemp.Count != LocateAreaData[0].Length)
                 {
-                    Debug.Log($"<color=#FFA07A>[ScreenIdentification] 拟合四边形失败, quadTemp.Count: {quadTemp.Count}</color>");
+                    Debug.Log($"<color=yellow>[ScreenIdentification] 拟合四边形失败, quadTemp.Count: {quadTemp.Count}</color>");
                 }
                 else if (quadTemp.Count == 1)
                 {
                     Screen.QuadInCamera = new QuadrilateralInCamera(quadTemp[0], new Vector(Size.x, Size.y));
-                    Debug.Log($"<color=#ADD8E6>[ScreenIdentification] 拟合成功,Quad: {Screen.QuadInCamera.QuadString}____{Screen.QuadInCamera.SizeString}</color>");
+                    Debug.Log($"<color=aqua>[ScreenIdentification] 拟合成功,Quad: {Screen.QuadInCamera.QuadString}____{Screen.QuadInCamera.SizeString}</color>");
                 }
                 else
                 {
@@ -336,7 +336,7 @@ namespace o0.Project
                         }
                     }
                     Screen.QuadInCamera = new QuadrilateralInCamera(predicts, new Vector(Size.x, Size.y));
-                    Debug.Log($"<color=#ADD8E6>[ScreenIdentification] 拟合成功,RSquared: {rs}, Quad: {Screen.QuadInCamera.QuadString}____{Screen.QuadInCamera.SizeString}</color>");
+                    Debug.Log($"<color=aqua>[ScreenIdentification] 拟合成功,RSquared: {rs}, Quad: {Screen.QuadInCamera.QuadString}____{Screen.QuadInCamera.SizeString}</color>");
                     //if (rs < 0.8) Screen.Quad = null;
                 }
 
@@ -701,12 +701,12 @@ namespace o0.Project
             }
             if (screenQuad == null && Screen.QuadInCamera != null)     // 如果可能,回退到上一个screen
             {
-                Debug.Log("<color=#ADD8E6>[ScreenIdentification] 本次识别失败,回退到上次的识别结果</color>");
+                Debug.Log("<color=aqua>[ScreenIdentification] 本次识别失败,回退到上次的识别结果</color>");
                 quadTemp.Add(Screen.QuadInCamera.Quad);
             }
             else if (screenQuad != null)
             {
-                Debug.Log("<color=#ADD8E6>[ScreenIdentification] 识别到四边形</color>");
+                Debug.Log("<color=aqua>[ScreenIdentification] 识别到四边形</color>");
                 quadTemp.Add(screenQuad.Quad);
             }
 

+ 3 - 2
Assets/InfraredProject/WebCamera/Script/ZIM/ZIMUnity/ZIMWebCamera.cs

@@ -88,8 +88,9 @@ public class ZIMWebCamera : MonoBehaviour
             }
             if (devices.Length < cameraIndex + 1)
             {
-                Debug.LogError("开启失败,没有对应序号的摄像头!");
-                return;
+                Debug.Log("<color=yellow>开启失败,没有对应序号的摄像头! 尝试启动默认摄像头</color>");
+                cameraIndex = 0;
+                //return;
             }
             string deviceName = devices[cameraIndex].name;
             _webCamTexture = new WebCamTexture(deviceName, width, height, fps);

+ 1 - 1
Assets/InfraredProject/WebCamera/zimWebCamera.unity

@@ -4854,7 +4854,7 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: 69761566ec3b1054fb4eaf1a515fa3ce, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
-  cameraIndex: 0
+  cameraIndex: 1
   width: 1280
   height: 720
   fps: 30