|
@@ -70,10 +70,11 @@ namespace o0.Project
|
|
|
{
|
|
{
|
|
|
return i switch
|
|
return i switch
|
|
|
{
|
|
{
|
|
|
- 1 => UnityEngine.Color.green,
|
|
|
|
|
- 2 => UnityEngine.Color.red,
|
|
|
|
|
- 3 => UnityEngine.Color.yellow,
|
|
|
|
|
|
|
+ 1 => UnityEngine.Color.yellow,
|
|
|
|
|
+ 2 => new UnityEngine.Color(0,1,1,1),
|
|
|
|
|
+ 3 => UnityEngine.Color.green,
|
|
|
4 => UnityEngine.Color.white,
|
|
4 => UnityEngine.Color.white,
|
|
|
|
|
+ 5 => UnityEngine.Color.red,
|
|
|
_ => UnityEngine.Color.black,
|
|
_ => UnityEngine.Color.black,
|
|
|
};
|
|
};
|
|
|
}
|
|
}
|
|
@@ -691,7 +692,7 @@ namespace o0.Project
|
|
|
var scale = 1.0f / maxWhite; // 放大对比度
|
|
var scale = 1.0f / maxWhite; // 放大对比度
|
|
|
|
|
|
|
|
var differPixel = new UnityEngine.Color[Size.x * Size.y];
|
|
var differPixel = new UnityEngine.Color[Size.x * Size.y];
|
|
|
- //var whitePixel = new UnityEngine.Color[Size.x * Size.y];
|
|
|
|
|
|
|
+ var whitePixel = new UnityEngine.Color[Size.x * Size.y];
|
|
|
Parallel.For(0, Size.x, x =>
|
|
Parallel.For(0, Size.x, x =>
|
|
|
{
|
|
{
|
|
|
for (int y = 0; y < Size.y; y++)
|
|
for (int y = 0; y < Size.y; y++)
|
|
@@ -699,11 +700,11 @@ namespace o0.Project
|
|
|
var i = y * Size.x + x;
|
|
var i = y * Size.x + x;
|
|
|
var d = ScreenWhiteTexture[i] - ScreenBlackTexture[i];
|
|
var d = ScreenWhiteTexture[i] - ScreenBlackTexture[i];
|
|
|
differPixel[i] = new UnityEngine.Color(d.x, d.y, d.z) * scale;
|
|
differPixel[i] = new UnityEngine.Color(d.x, d.y, d.z) * scale;
|
|
|
- //whitePixel[i] = new UnityEngine.Color(ScreenWhiteTexture[i].x, ScreenWhiteTexture[i].y, ScreenWhiteTexture[i].z) * scale;
|
|
|
|
|
|
|
+ whitePixel[i] = new UnityEngine.Color(ScreenWhiteTexture[i].x, ScreenWhiteTexture[i].y, ScreenWhiteTexture[i].z) * scale;
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
PixelsMultipleBatches.Add(differPixel); // 色差图
|
|
PixelsMultipleBatches.Add(differPixel); // 色差图
|
|
|
- //PixelsMultipleBatches.Add(whitePixel); // 原图
|
|
|
|
|
|
|
+ PixelsMultipleBatches.Add(whitePixel); // 原图
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
int conSize = (int)Math.Ceiling(0.007f * Size.y) * 2 + 1;
|
|
int conSize = (int)Math.Ceiling(0.007f * Size.y) * 2 + 1;
|
|
@@ -804,9 +805,9 @@ namespace o0.Project
|
|
|
foreach (var i in LineIdentifiedSemiAuto.Index())
|
|
foreach (var i in LineIdentifiedSemiAuto.Index())
|
|
|
{
|
|
{
|
|
|
if (LastQuadSemiAutoState[i])
|
|
if (LastQuadSemiAutoState[i])
|
|
|
- o0Extension.DrawLine(ScreenQuadMap, LineIdentifiedSemiAuto[i].DrawLine, (x, y) => 2, new Geometry2D.Float.Vector(0, 10));
|
|
|
|
|
|
|
+ o0Extension.DrawLine(ScreenQuadMap, LineIdentifiedSemiAuto[i].DrawLine, (x, y) => 5, new Geometry2D.Float.Vector(0, 10));
|
|
|
else
|
|
else
|
|
|
- o0Extension.DrawLine(ScreenQuadMap, LineIdentifiedSemiAuto[i].DrawLine, (x, y) => 1, new Geometry2D.Float.Vector(0, 6), true);
|
|
|
|
|
|
|
+ o0Extension.DrawLine(ScreenQuadMap, LineIdentifiedSemiAuto[i].DrawLine, (x, y) => 3, new Geometry2D.Float.Vector(0, 6), true);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 绘制全自动
|
|
// 绘制全自动
|
|
@@ -821,7 +822,7 @@ namespace o0.Project
|
|
|
foreach (var l in allLines)
|
|
foreach (var l in allLines)
|
|
|
{
|
|
{
|
|
|
if (l.DrawLine != null)
|
|
if (l.DrawLine != null)
|
|
|
- o0Extension.DrawLine(allLinesMap, l.DrawLine, (x, y) => 3, new Geometry2D.Float.Vector(0, 2), true);
|
|
|
|
|
|
|
+ o0Extension.DrawLine(allLinesMap, l.DrawLine, (x, y) => 1, new Geometry2D.Float.Vector(0, 2), true);
|
|
|
}
|
|
}
|
|
|
var allLinesTex = allLinesMap.ToTexRGBA(FloatValueToColor);
|
|
var allLinesTex = allLinesMap.ToTexRGBA(FloatValueToColor);
|
|
|
ScreenLocate.DebugTexture(1, allLinesTex);
|
|
ScreenLocate.DebugTexture(1, allLinesTex);
|
|
@@ -831,17 +832,17 @@ namespace o0.Project
|
|
|
foreach (var l in possibleLines)
|
|
foreach (var l in possibleLines)
|
|
|
{
|
|
{
|
|
|
if (l != null && !quadLinesSemiAuto.Contains(l) && !manualLines.Contains(l))
|
|
if (l != null && !quadLinesSemiAuto.Contains(l) && !manualLines.Contains(l))
|
|
|
- o0Extension.DrawLine(ChoosableLineMap, l.DrawLine, (x, y) => 3, new Geometry2D.Float.Vector(0, 2), true); // 其他的备选线段
|
|
|
|
|
|
|
+ o0Extension.DrawLine(ChoosableLineMap, l.DrawLine, (x, y) => 1, new Geometry2D.Float.Vector(0, 2), true); // 其他的备选线段
|
|
|
}
|
|
}
|
|
|
foreach (var l in LineIdentifiedSemiAuto)
|
|
foreach (var l in LineIdentifiedSemiAuto)
|
|
|
{
|
|
{
|
|
|
if (l != null)
|
|
if (l != null)
|
|
|
- o0Extension.DrawLine(ChoosableLineMap, l.DrawLine, (x, y) => 2, new Geometry2D.Float.Vector(0, 5)); // 识别的结果
|
|
|
|
|
|
|
+ o0Extension.DrawLine(ChoosableLineMap, l.DrawLine, (x, y) => 5, new Geometry2D.Float.Vector(0, 5)); // 识别的结果
|
|
|
}
|
|
}
|
|
|
if (manualLines != null)
|
|
if (manualLines != null)
|
|
|
{
|
|
{
|
|
|
foreach (var l in manualLines)
|
|
foreach (var l in manualLines)
|
|
|
- o0Extension.DrawLine(ChoosableLineMap, l.DrawLine, (x, y) => 1, new Geometry2D.Float.Vector(0, 2), true); // 旧的屏幕线段(例如上次手动识别的)
|
|
|
|
|
|
|
+ o0Extension.DrawLine(ChoosableLineMap, l.DrawLine, (x, y) => 3, new Geometry2D.Float.Vector(0, 2), true); // 旧的屏幕线段(例如上次手动识别的)
|
|
|
}
|
|
}
|
|
|
Texture2D ChoosableLineTex = ChoosableLineMap.ToTexRGBA(FloatValueToColor);
|
|
Texture2D ChoosableLineTex = ChoosableLineMap.ToTexRGBA(FloatValueToColor);
|
|
|
#endregion
|
|
#endregion
|