|
|
@@ -195,7 +195,7 @@ namespace o0.Project
|
|
|
}
|
|
|
|
|
|
//times.Add(watch.ElapsedMilliseconds);
|
|
|
- //UnityEngine.Debug.Log("time: " + (times[times.Count - 1] - times[times.Count - 2]));
|
|
|
+ //Debug.Log("time: " + (times[times.Count - 1] - times[times.Count - 2]));
|
|
|
}
|
|
|
|
|
|
public void NextScreen()
|
|
|
@@ -318,8 +318,8 @@ namespace o0.Project
|
|
|
}
|
|
|
else if (quadTemp.Count == 1)
|
|
|
{
|
|
|
- Screen.QuadInCamera = quadTemp[0];
|
|
|
- Debug.Log($"<color=aqua>[ScreenIdentification] 拟合成功,识别数据: {Screen.QuadInCamera}</color>");
|
|
|
+ SetScreenQuad(quadTemp[0]);
|
|
|
+ Debug.Log($"[ScreenIdentification] 拟合成功,识别数据: {Screen.QuadInCamera}");
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
@@ -357,8 +357,8 @@ namespace o0.Project
|
|
|
predicts.Add(lr.Predict<Vector>(1));
|
|
|
}
|
|
|
}
|
|
|
- Screen.QuadInCamera = new QuadrilateralInCamera(predicts, new Vector(Size.x, Size.y));
|
|
|
- Debug.Log($"<color=aqua>[ScreenIdentification] 拟合成功,RSquared: {rs}, Quad: {Screen.QuadInCamera.QuadString}____{Screen.QuadInCamera.SizeString}</color>");
|
|
|
+ SetScreenQuad(new QuadrilateralInCamera(predicts, new Vector(Size.x, Size.y)));
|
|
|
+ Debug.Log($"[ScreenIdentification] 拟合成功,RSquared: {rs}, Quad: {Screen.QuadInCamera}");
|
|
|
//if (rs < 0.8) Screen.Quad = null;
|
|
|
}
|
|
|
|
|
|
@@ -563,7 +563,7 @@ namespace o0.Project
|
|
|
|
|
|
|
|
|
times.Add(watch.ElapsedMilliseconds);
|
|
|
- UnityEngine.Debug.Log("time: " + (times[times.Count - 1] - times[times.Count - 2]));
|
|
|
+ Debug.Log("time: " + (times[times.Count - 1] - times[times.Count - 2]));
|
|
|
|
|
|
//ScreenLocate.DebugTexture(5, edge.IdentifyLine(edgeDir).ToTex());
|
|
|
//ScreenLocate.DebugTexture(4, ScreenLocateTexLighted.Too0Mat().IdentifyEdgeGradientX().ToTex());
|
|
|
@@ -727,7 +727,7 @@ namespace o0.Project
|
|
|
}
|
|
|
Texture2D ScreenLocateTexture = LocateTexTemp[0]; // for output
|
|
|
|
|
|
- // 如果有旧的手动数据,刷新一下Size
|
|
|
+ // 如果有手动数据,刷新一下Size
|
|
|
QuadManual?.ReSize(new Vector(Size.x, Size.y), ScreenMap.ViewAspectRatioSetting);
|
|
|
// 估算屏幕中点,如果已有手动定位数据,根据现有数据取平均即可,否则从色差计算,ScreenLocateMatList[0]默认是屏幕的黑白色差
|
|
|
Vector AvgPoint = QuadManual != null ? QuadManual.Quad.Centroid : GetAvgPoint(ScreenLocateMatList[0]);
|
|
|
@@ -784,17 +784,17 @@ namespace o0.Project
|
|
|
// 优先应用半自动的结果(也可以在外部手动设置)
|
|
|
if (QuadSemiAuto == null && QuadAuto == null && Screen.QuadInCamera != null) // 如果可能,回退到上一个screen
|
|
|
{
|
|
|
- Debug.Log("<color=aqua>[ScreenIdentification] 本次识别失败,回退到上次的识别结果</color>");
|
|
|
+ Debug.Log($"<color=yellow>[ScreenIdentification] 本次识别失败,回退到上次的识别结果: {Screen.QuadInCamera}</color>");
|
|
|
quadTemp.Add(Screen.QuadInCamera);
|
|
|
}
|
|
|
else if (QuadSemiAuto != null)
|
|
|
{
|
|
|
- Debug.Log("<color=aqua>[ScreenIdentification] 识别到四边形</color>");
|
|
|
+ Debug.Log($"<color=aqua>[ScreenIdentification] 识别到四边形(半自动): {QuadSemiAuto}</color>");
|
|
|
quadTemp.Add(QuadSemiAuto);
|
|
|
}
|
|
|
else if (QuadAuto != null)
|
|
|
{
|
|
|
- Debug.Log("<color=aqua>[ScreenIdentification] 识别到四边形</color>");
|
|
|
+ Debug.Log($"<color=aqua>[ScreenIdentification] 识别到四边形(全自动): {QuadAuto}</color>");
|
|
|
quadTemp.Add(QuadAuto);
|
|
|
}
|
|
|
|
|
|
@@ -856,7 +856,7 @@ namespace o0.Project
|
|
|
}
|
|
|
|
|
|
//times.Add(watch.ElapsedMilliseconds);
|
|
|
- //UnityEngine.Debug.Log("time: " + (times[times.Count - 1] - times[times.Count - 2]));
|
|
|
+ //Debug.Log("time: " + (times[times.Count - 1] - times[times.Count - 2]));
|
|
|
|
|
|
// opecncv处理, zim
|
|
|
{
|
|
|
@@ -1005,7 +1005,7 @@ namespace o0.Project
|
|
|
manualLines = null;
|
|
|
if (QuadManual != null)
|
|
|
{
|
|
|
- Debug.Log("[IdentifyLineLSD] 根据已有定位数据做筛选");
|
|
|
+ Debug.Log($"[IdentifyLineLSD] 根据已有定位数据做筛选, QuadManual: {QuadManual}");
|
|
|
manualLines = QuadManual.GetLines().Select((i) => new LineIdentified(0, i, 0, 0, true)).ToArray();
|
|
|
var calibration = ScreenLocate.Main.ReDoLocateCalibrationRatio * Size.y;
|
|
|
var avgPointCross = manualLines.Select((i) => i.Line.LineCrossWithPoint(avgPoint)).ToArray(); // 对于平均点的corss值
|