adjustable parameters

This commit is contained in:
huiyadanli
2024-01-04 23:36:25 +08:00
parent 433475d6c0
commit 4b41c2fb86
2 changed files with 5 additions and 3 deletions

View File

@@ -501,7 +501,7 @@ public class AutoDomainTask
{
// 左移视角
var moveAngle = angle;
if (moveAngle > 0)
if (moveAngle > 2)
{
moveAngle *= 2;
}
@@ -513,7 +513,7 @@ public class AutoDomainTask
{
// 右移视角
var moveAngle = 360 - angle;
if (moveAngle > 0)
if (moveAngle > 2)
{
moveAngle *= 2;
}

View File

@@ -123,8 +123,10 @@ public class Avatar
var teamRa = content.CaptureRectArea.Crop(AutoFightContext.Instance().FightAssets.TeamRect);
var blockX = NameRect.X + NameRect.Width * 2 - 10;
var block = teamRa.Crop(new Rect(blockX, NameRect.Y, teamRa.Width - blockX, NameRect.Height * 2));
Cv2.ImWrite($"block_{Name}.png", block.SrcMat);
// 取白色区域
var bMat = OpenCvCommonHelper.Threshold(block.SrcMat, new Scalar(255, 255, 255), new Scalar(255, 255, 255));
Cv2.ImWrite($"block_b_{Name}.png", bMat);
// 矩形识别
Cv2.FindContours(bMat, out var contours, out _, RetrievalModes.External,
ContourApproximationModes.ApproxSimple);
@@ -146,7 +148,7 @@ public class Avatar
var indexBlock = teamRa.Crop(new Rect(blockX + IndexRect.X, NameRect.Y + IndexRect.Y, IndexRect.Width, IndexRect.Height));
Cv2.ImWrite($"indexBlock_{Name}.png", indexBlock.SrcMat);
var count = OpenCvCommonHelper.CountGrayMatColor(indexBlock.SrcGreyMat, 255);
if (count * 1.0 / (IndexRect.Width * IndexRect.Height) > 0.8)
if (count * 1.0 / (IndexRect.Width * IndexRect.Height) > 0.5)
{
return false;
}