test code

This commit is contained in:
辉鸭蛋
2025-01-31 18:13:09 +08:00
parent 7d7289ac16
commit 854baad420
3 changed files with 5 additions and 4 deletions

View File

@@ -61,7 +61,7 @@ internal class HsvTestWindow
Cv2.CreateTrackbar("High S", _windowDetectionName, ref _highS, MaxValue, on_high_S_thresh_trackbar);
Cv2.CreateTrackbar("Low V", _windowDetectionName, ref _lowV, MaxValue, on_low_V_thresh_trackbar);
Cv2.CreateTrackbar("High V", _windowDetectionName, ref _highV, MaxValue, on_high_V_thresh_trackbar);
var frame = Cv2.ImRead(@"E:\HuiTask\更好的原神\自动秘境\自动战斗\队伍识别\冷却时间\Clip_20250130_092132.png", ImreadModes.Color);
var frame = Cv2.ImRead(@"E:\HuiTask\更好的原神\自动秘境\Q识别\拼图\2.png", ImreadModes.Color);
Mat frameHsv = new Mat();
// Convert from BGR to HSV colorspace
Cv2.CvtColor(frame, frameHsv, ColorConversionCodes.BGR2HSV);

View File

@@ -63,7 +63,7 @@ public partial class ChooseTalkOptionTask
{
if (isOrange)
{
// region.DeriveCrop(optionRa.ToRect()).SrcMat.SaveImage(Global.Absolute($"log\\t{optionRa.Text}.png"));
region.DeriveCrop(optionRa.ToRect()).SrcMat.SaveImage(Global.Absolute($"log\\t{optionRa.Text}.png"));
if (!IsOrangeOption(region.DeriveCrop(optionRa.ToRect()).SrcMat))
{
return TalkOptionRes.FoundButNotOrange;
@@ -204,7 +204,8 @@ public partial class ChooseTalkOptionTask
int highConfidencePixels = Cv2.CountNonZero(mask);
double rate = highConfidencePixels * 1.0 / (mask.Width * mask.Height);
Debug.WriteLine($"识别到橙色文字区域占比:{rate}");
return rate > 0.15;
_logger.LogInformation($"识别到橙色文字区域占比:{rate}");
return rate > 0.1;
}
}

View File

@@ -80,7 +80,7 @@ public class GoToAdventurersGuildTask
await new ReturnMainUiTask().Start(ct);
// 结束后重新打开
await Delay(1000, ct);
await Delay(1200, ct);
var ra = CaptureToRectArea();
if (!Bv.FindFAndPress(ra, "凯瑟琳"))
{