mirror of
https://github.com/babalae/better-genshin-impact.git
synced 2026-03-15 07:43:20 +08:00
test code
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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, "凯瑟琳"))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user