mirror of
https://github.com/babalae/better-genshin-impact.git
synced 2026-05-23 09:55:48 +08:00
add CameraOrientation.ComputeMiniMap(mat)
This commit is contained in:
@@ -43,11 +43,6 @@ namespace BetterGenshinImpact.GameTask.AutoTrackPath;
|
||||
public class AutoTrackPathTask
|
||||
{
|
||||
private readonly AutoTrackPathParam _taskParam;
|
||||
private readonly Random _rd = new Random();
|
||||
|
||||
private readonly List<GiWorldPosition> _tpPositions;
|
||||
|
||||
private readonly Dictionary<string, double[]> _countryPositions = MapAssets.Instance.CountryPositions;
|
||||
|
||||
private GiPath _way;
|
||||
|
||||
@@ -57,7 +52,6 @@ public class AutoTrackPathTask
|
||||
public AutoTrackPathTask(AutoTrackPathParam taskParam)
|
||||
{
|
||||
_taskParam = taskParam;
|
||||
_tpPositions = MapAssets.Instance.TpPositions;
|
||||
|
||||
var wayJson = File.ReadAllText(Global.Absolute(@"log\way\way2.json"));
|
||||
_way = JsonSerializer.Deserialize<GiPath>(wayJson, ConfigService.JsonOptions) ?? throw new Exception("way json deserialize failed");
|
||||
|
||||
@@ -19,6 +19,16 @@ public class CameraOrientation
|
||||
public static int Compute(Mat greyMat)
|
||||
{
|
||||
var mat = new Mat(greyMat, new Rect(62, 19, 212, 212));
|
||||
return ComputeMiniMap(mat);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 小地图
|
||||
/// </summary>
|
||||
/// <param name="mat"></param>
|
||||
/// <returns></returns>
|
||||
public static int ComputeMiniMap(Mat mat)
|
||||
{
|
||||
Cv2.GaussianBlur(mat, mat, new Size(3, 3), 0);
|
||||
// 极坐标展开
|
||||
var centerPoint = new Point2f(mat.Width / 2f, mat.Height / 2f);
|
||||
|
||||
Reference in New Issue
Block a user