diff --git a/BetterGenshinImpact.Test/MainWindow.xaml b/BetterGenshinImpact.Test/MainWindow.xaml
index 2cb66533..2d3fb0b8 100644
--- a/BetterGenshinImpact.Test/MainWindow.xaml
+++ b/BetterGenshinImpact.Test/MainWindow.xaml
@@ -4,7 +4,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Title="Test"
- Width="120"
+ Width="240"
Height="450"
mc:Ignorable="d">
\ No newline at end of file
diff --git a/BetterGenshinImpact.Test/MainWindow.xaml.cs b/BetterGenshinImpact.Test/MainWindow.xaml.cs
index 5a0fa238..64dce3e8 100644
--- a/BetterGenshinImpact.Test/MainWindow.xaml.cs
+++ b/BetterGenshinImpact.Test/MainWindow.xaml.cs
@@ -48,8 +48,8 @@ public partial class MainWindow : Window
private void DoMatchTest(object sender, System.Windows.RoutedEventArgs e)
{
// KeyPointMatchTest.Test();
- EntireMapTest.Test();
- // EntireMapTest.Storage();
+ // EntireMapTest.Test();
+ EntireMapTest.Storage();
// BigMapMatchTest.Test();
// FeatureTransfer.Transfer();
@@ -74,4 +74,9 @@ public partial class MainWindow : Window
{
MapPathTest.Test();
}
+
+ private void ZoomOut(object sender, RoutedEventArgs e)
+ {
+ ScaleTest.ZoomOutTest();
+ }
}
diff --git a/BetterGenshinImpact.Test/Simple/AllMap/MapPuzzle.cs b/BetterGenshinImpact.Test/Simple/AllMap/MapPuzzle.cs
index 41237cc7..4f7e38e3 100644
--- a/BetterGenshinImpact.Test/Simple/AllMap/MapPuzzle.cs
+++ b/BetterGenshinImpact.Test/Simple/AllMap/MapPuzzle.cs
@@ -28,7 +28,7 @@ public class MapPuzzle
public static void Put()
{
- string folderPath = @"E:\HuiTask\更好的原神\地图匹配\UI_Map"; // 图片文件夹路径
+ string folderPath = @"E:\HuiTask\更好的原神\地图匹配\UI_Map_5.0"; // 图片文件夹路径
string pattern = @"UI_MapBack_([-+]?\d+)_([-+]?\d+)(.*)";
var images = Directory.GetFiles(folderPath, "*.png", SearchOption.TopDirectoryOnly); // 获取所有图片文件路径
@@ -158,7 +158,7 @@ public class MapPuzzle
}
// 保存大图
- Cv2.ImWrite(@"E:\HuiTask\更好的原神\地图匹配\map_46_2048.png", largeImage);
+ Cv2.ImWrite(@"E:\HuiTask\更好的原神\地图匹配\map_50_2048.png", largeImage);
// Cv2.ImWrite(@"E:\HuiTask\更好的原神\地图匹配\combined_image_sd4x.png", largeImage.Resize(new Size(largeImage.Width / 4, largeImage.Height / 4), 0, 0, InterpolationFlags.Cubic));
// Cv2.ImWrite(@"E:\HuiTask\更好的原神\地图匹配\combined_image_small.png", largeImage.Resize(new Size(1400, 1300), 0, 0, InterpolationFlags.Cubic));
diff --git a/BetterGenshinImpact.Test/Simple/ScaleTest.cs b/BetterGenshinImpact.Test/Simple/ScaleTest.cs
new file mode 100644
index 00000000..351f6bd5
--- /dev/null
+++ b/BetterGenshinImpact.Test/Simple/ScaleTest.cs
@@ -0,0 +1,16 @@
+using OpenCvSharp;
+
+namespace BetterGenshinImpact.Test.Simple;
+
+public class ScaleTest
+{
+ public static void ZoomOutTest()
+ {
+ var mainMap2048BlockMat = new Mat(@"E:\HuiTask\更好的原神\地图匹配\有用的素材\5.0\mainMap2048Block.png", ImreadModes.Grayscale);
+ // 缩小 2048/256 = 8 倍
+ var targetFilePath = @"E:\HuiTask\更好的原神\地图匹配\有用的素材\5.0\mainMap256Block.png";
+ // opencv 缩小
+ var mainMap256BlockMat = mainMap2048BlockMat.Resize(new Size(mainMap2048BlockMat.Width / 8, mainMap2048BlockMat.Height / 8));
+ mainMap256BlockMat.SaveImage(targetFilePath);
+ }
+}
diff --git a/BetterGenshinImpact.Test/Simple/Track/MapPathTest.cs b/BetterGenshinImpact.Test/Simple/Track/MapPathTest.cs
index 2339cf32..3e19c051 100644
--- a/BetterGenshinImpact.Test/Simple/Track/MapPathTest.cs
+++ b/BetterGenshinImpact.Test/Simple/Track/MapPathTest.cs
@@ -13,22 +13,22 @@ internal class MapPathTest
{
public static void Test()
{
- var wayJson = File.ReadAllText(Global.Absolute(@"log\way\yl3.json"));
- var way = JsonSerializer.Deserialize(wayJson, ConfigService.JsonOptions) ?? throw new Exception("way json deserialize failed");
-
- var points = way.WayPointList.Select(giPathPoint => giPathPoint.MatchRect.GetCenterPoint()).ToList();
-
- var pointsRect = Cv2.BoundingRect(points);
- var allMap = new Mat(@"E:\HuiTask\更好的原神\地图匹配\有用的素材\mainMap2048Block.png");
-
- // 按顺序连线,每个点都画圈
- for (var i = 0; i < points.Count - 1; i++)
- {
- Cv2.Line(allMap, points[i], points[i + 1], Scalar.Red, 1);
- Cv2.Circle(allMap, points[i], 3, Scalar.Red, -1);
- }
-
- var map = allMap[new Rect(pointsRect.X - 100, pointsRect.Y - 100, pointsRect.Width + 200, pointsRect.Height + 200)];
- Cv2.ImShow("map", map);
+ // var wayJson = File.ReadAllText(Global.Absolute(@"log\way\yl3.json"));
+ // var way = JsonSerializer.Deserialize(wayJson, ConfigService.JsonOptions) ?? throw new Exception("way json deserialize failed");
+ //
+ // var points = way.WayPointList.Select(giPathPoint => giPathPoint.MatchRect.GetCenterPoint()).ToList();
+ //
+ // var pointsRect = Cv2.BoundingRect(points);
+ // var allMap = new Mat(@"E:\HuiTask\更好的原神\地图匹配\有用的素材\mainMap2048Block.png");
+ //
+ // // 按顺序连线,每个点都画圈
+ // for (var i = 0; i < points.Count - 1; i++)
+ // {
+ // Cv2.Line(allMap, points[i], points[i + 1], Scalar.Red, 1);
+ // Cv2.Circle(allMap, points[i], 3, Scalar.Red, -1);
+ // }
+ //
+ // var map = allMap[new Rect(pointsRect.X - 100, pointsRect.Y - 100, pointsRect.Width + 200, pointsRect.Height + 200)];
+ // Cv2.ImShow("map", map);
}
}
diff --git a/BetterGenshinImpact/Assets/Map/mainMap256Block.png b/BetterGenshinImpact/Assets/Map/mainMap256Block.png
index 45d1a9c4..ad60a896 100644
Binary files a/BetterGenshinImpact/Assets/Map/mainMap256Block.png and b/BetterGenshinImpact/Assets/Map/mainMap256Block.png differ
diff --git a/BetterGenshinImpact/GameTask/Common/Element/Assets/MapAssets.cs b/BetterGenshinImpact/GameTask/Common/Element/Assets/MapAssets.cs
index fe5cbe1b..5f496c06 100644
--- a/BetterGenshinImpact/GameTask/Common/Element/Assets/MapAssets.cs
+++ b/BetterGenshinImpact/GameTask/Common/Element/Assets/MapAssets.cs
@@ -12,7 +12,7 @@ namespace BetterGenshinImpact.GameTask.Common.Element.Assets;
public class MapAssets : BaseAssets
{
- public Lazy MainMap2048BlockMat { get; } = new(() => new Mat(@"E:\HuiTask\更好的原神\地图匹配\有用的素材\mainMap2048Block.png", ImreadModes.Grayscale));
+ public Lazy MainMap2048BlockMat { get; } = new(() => new Mat(@"E:\HuiTask\更好的原神\地图匹配\有用的素材\5.0\mainMap2048Block.png", ImreadModes.Grayscale));
public Lazy MainMap256BlockMat { get; } = new(() => new Mat(Global.Absolute(@"Assets\Map\mainMap256Block.png"), ImreadModes.Grayscale));
diff --git a/BetterGenshinImpact/GameTask/Common/Map/MapCoordinate.cs b/BetterGenshinImpact/GameTask/Common/Map/MapCoordinate.cs
index d3bc5167..d5896ddf 100644
--- a/BetterGenshinImpact/GameTask/Common/Map/MapCoordinate.cs
+++ b/BetterGenshinImpact/GameTask/Common/Map/MapCoordinate.cs
@@ -11,10 +11,15 @@ namespace BetterGenshinImpact.GameTask.Common.Map;
///
public class MapCoordinate
{
+ #region 每次地图扩大都要更新的参数
+
public static readonly int GameMapRows = 13; // 游戏坐标下地图块的行数
- public static readonly int GameMapCols = 14; // 游戏坐标下地图块的列数
+ public static readonly int GameMapCols = 16; // 游戏坐标下地图块的列数
public static readonly int GameMapUpRows = 5; // 游戏坐标下 左上角离地图原点的行数
- public static readonly int GameMapLeftCols = 7; // 游戏坐标下 左上角离地图原点的列数
+ public static readonly int GameMapLeftCols = 9; // 游戏坐标下 左上角离地图原点的列数
+
+ #endregion 每次地图扩大都要更新的参数
+
public static readonly int GameMapBlockWidth = 1024; // 游戏地图块的长宽
///