回退修改。

This commit is contained in:
秋云 2024-12-27 23:51:40 +08:00
parent 28ceb3dd85
commit 17282a3cef
3 changed files with 7 additions and 11 deletions

1
.gitignore vendored
View File

@ -29,4 +29,3 @@ node_modules/
# Rider # Rider
.idea .idea
/BetterGenshinImpact/GameTask/AutoTrackPath/Assets/tp_en.json

View File

@ -33,7 +33,7 @@ public class MapPuzzle
// 保存1024 // 保存1024
var img1024 = Put(1024); var img1024 = Put(1024);
Cv2.ImWrite(@"C:\Users\root\Downloads\map\map_52_1024.png", img1024); Cv2.ImWrite(@"E:\HuiTask\更好的原神\地图匹配\有用的素材\5.2\map_52_1024.png", img1024);
// 保存256 // 保存256
// var grayImage = new Mat(); // var grayImage = new Mat();
@ -44,7 +44,7 @@ public class MapPuzzle
public static Mat Put(int block = 2048) public static Mat Put(int block = 2048)
{ {
string folderPath = @"C:\Users\root\Downloads\map"; // 图片文件夹路径 string folderPath = @"E:\HuiTask\更好的原神\地图匹配\UI_Map_5.2"; // 图片文件夹路径
string pattern = @"UI_MapBack_([-+]?\d+)_([-+]?\d+)(.*)"; string pattern = @"UI_MapBack_([-+]?\d+)_([-+]?\d+)(.*)";
var images = Directory.GetFiles(folderPath, "*.png", SearchOption.TopDirectoryOnly); // 获取所有图片文件路径 var images = Directory.GetFiles(folderPath, "*.png", SearchOption.TopDirectoryOnly); // 获取所有图片文件路径

View File

@ -15,9 +15,9 @@ public class MapTeleportPointDraw
{ {
// var pList = LoadTeleportPoint(@"E:\HuiTask\更好的原神\地图匹配\地图点位\5.0"); // var pList = LoadTeleportPoint(@"E:\HuiTask\更好的原神\地图匹配\地图点位\5.0");
// pList.AddRange(MapAssets.Instance.TpPositions); // pList.AddRange(MapAssets.Instance.TpPositions);
var map = new Mat(@"C:\Users\root\Downloads\map\map_52_1024.png"); var map = new Mat(@"E:\HuiTask\更好的原神\地图匹配\有用的素材\5.0\mainMap1024BlockColor.png");
DrawTeleportPoint(map, MapLazyAssets.Instance.TpPositions); DrawTeleportPoint(map, MapLazyAssets.Instance.TpPositions);
Cv2.ImWrite(@"C:\Users\root\Downloads\map\map_52_1024_with_tp.png", map); Cv2.ImWrite(@"E:\HuiTask\更好的原神\地图匹配\有用的素材\5.0\传送点_1024_0.34.3.png", map);
} }
public static void DrawTeleportPoint(Mat map, List<GiWorldPosition> points) public static void DrawTeleportPoint(Mat map, List<GiWorldPosition> points)
@ -26,9 +26,8 @@ public class MapTeleportPointDraw
{ {
var p = MapCoordinate.GameToMain1024(point.Position); var p = MapCoordinate.GameToMain1024(point.Position);
Cv2.Circle(map, p, 4, Scalar.Red, 2); Cv2.Circle(map, p, 4, Scalar.Red, 2);
Cv2.PutText(map, point.Country, new Point(p.X + 10, p.Y + 5), HersheyFonts.HersheySimplex, 1, Scalar.Red, 2);
// 写文字 // 写文字
// Cv2.PutText(map, $"[{point.X:F2},{point.Y:F2}]", new Point(p.X + 10, p.Y + 5), HersheyFonts.HersheySimplex, 1, Scalar.Red, 2); Cv2.PutText(map, $"[{point.X:F2},{point.Y:F2}]", new Point(p.X + 10, p.Y + 5), HersheyFonts.HersheySimplex, 1, Scalar.Red, 2);
} }
} }
@ -45,7 +44,7 @@ public class MapTeleportPointDraw
continue; continue;
} }
points.Add(Transform(gamePoint.Position,gamePoint.Country)); points.Add(Transform(gamePoint.Position));
} }
return points; return points;
@ -56,12 +55,11 @@ public class MapTeleportPointDraw
/// </summary> /// </summary>
/// <param name="position">[a,b,c]</param> /// <param name="position">[a,b,c]</param>
/// <returns></returns> /// <returns></returns>
public static GiWorldPosition Transform(decimal[] position,string country) public static GiWorldPosition Transform(decimal[] position)
{ {
return new GiWorldPosition return new GiWorldPosition
{ {
Position = position, Position = position,
Country = country,
}; };
} }
@ -69,7 +67,6 @@ public class MapTeleportPointDraw
{ {
public string Description { get; set; } = string.Empty; public string Description { get; set; } = string.Empty;
public string Name { get; set; } = string.Empty; public string Name { get; set; } = string.Empty;
public string Country { get; set; } = string.Empty;
public decimal[] Position { get; set; } = new decimal[3]; public decimal[] Position { get; set; } = new decimal[3];
} }
} }