using RichCreator.Utility.CV; using RichCreator.Utility.Structs; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Emgu.CV; using Emgu.CV.Structure; using System.Threading; using RichCreator.Utility.Captures; using ZTImage.Configuration; using RichCreator.Utility.Utilitys; namespace RichCreator.Utility.CV { /// /// 凛冬识别 /// public class LindongCVHelper { /// /// 凛冬难度选择向右的箭头 /// public static ColorArray LindongRightGreenArrow = ColorArray.FromHsvFloatString(0.002f, 0.002f, 0.002f, "574,612,0,160,245$577,612,0,213,255$574,596,29,77,189$574,604,15,114,217$574,605,0,101,208$574,611,0,154,241$577,611,0,212,255$577,604,37,185,253$578,604,37,187,253$589,604,37,170,249$590,604,37,163,247$591,604,33,151,242"); /// /// 凛冬难度选择向左的箭头 /// public static ColorArray LindongLeftGreenArrow = ColorArray.FromHsvFloatString(0.002f, 0.002f, 0.002f, "495,605,0,145,243$495,597,74,151,252$494,597,74,152,255$494,605,0,151,248$496,605,0,131,233$496,612,0,196,255$497,612,0,173,251$481,604,36,158,246$482,604,37,166,248"); /// /// 是否打开选择了凛冬副本 /// /// /// /// public static bool IsInChoiceLindong(Image image, ZTRectangle gameRect, out bool choiceNanduDir) { choiceNanduDir = true; ZTRectangle limit = new ZTRectangle(gameRect.Start.X + 400, gameRect.End.Y - 200, gameRect.Start.X + 630, gameRect.End.Y - 90); ZTRectangle position = ZTRectangle.Empty; if (CVHelper.FindColorArray(out position, image, LindongRightGreenArrow, limit)) { choiceNanduDir = true; return true; } if (CVHelper.FindColorArray(out position, image, LindongLeftGreenArrow, limit)) { choiceNanduDir = false; return true; } return false; } /// /// 凛冬难度,1¬5级 /// private static ColorArray[] LindongNandu = new ColorArray[] { ColorArray.FromHsvFloatString(0.002f, 0.002f, 0.002f, "1391,650,102,0,170$1368,650,255,255,255$1380,650,0,102,170$1402,650,160,0,136$1413,650,170,0,17"), ColorArray.FromHsvFloatString(0.002f, 0.002f, 0.002f, "1391,650,102,0,170$1369,650,102,170,0$1380,650,255,255,255$1402,650,160,0,136$1413,650,170,0,17"), ColorArray.FromHsvFloatString(0.002f,0.002f,0.002f,"1390,650,255,255,255$1369,650,102,170,0$1380,650,0,102,170$1402,650,160,0,136$1413,650,170,0,17"), ColorArray.FromHsvFloatString(0.002f, 0.002f, 0.002f, "1402,650,255,255,255$1369,650,102,170,0$1380,650,0,102,170$1391,650,102,0,170$1413,650,170,0,17"), ColorArray.FromHsvFloatString(0.002f, 0.002f, 0.002f, "1391,650,102,0,170$1369,650,102,170,0$1380,650,0,102,170$1401,650,160,0,136$1412,650,255,255,255") }; /// /// 查找凛冬难度 /// /// /// /// /// public static bool GetChoiceLingdongNandu(out Int32 choiceNandu,Image image, ZTRectangle gameRect) { ZTRectangle limit = new ZTRectangle(gameRect.Start.X + 270, gameRect.Start.Y +505, gameRect.Start.X + 354, gameRect.Start.Y+519); ZTRectangle position = ZTRectangle.Empty; for (int i = 0; i < LindongNandu.Length; i++) { if (CVHelper.FindColorArray(out position, image, LindongNandu[i], limit)) { choiceNandu = i + 1; return true; } } choiceNandu = 0; return false; } /// /// 小地图时空之门文字 /// public static ColorArray ShikongzhimenText = ColorArray.FromHsvFloatString(0.002f, 0.002f, 0.002f, "1162,37,230,200,155$1150,35,230,200,155$1153,35,230,200,155$1153,39,230,200,155$1150,39,230,200,155$1150,43,230,200,155$1152,43,230,200,155$1153,44,230,200,155$1159,45,230,200,155$1159,37,230,200,155$1159,34,230,200,155$1155,37,230,200,155$1162,36,230,200,155$1172,36,230,200,155$1172,37,230,200,155$1171,41,230,200,155$1163,41,230,200,155$1162,45,230,200,155$1167,43,230,200,155$1172,45,230,200,155$1181,45,230,200,155$1185,45,230,200,155$1185,37,230,200,155$1189,34,230,200,155$1194,34,230,200,155$1194,45,230,200,155"); /// /// 是否时空之门地图 /// /// /// /// public static bool IsShikongzhimen(Image image, ZTRectangle gameRect) { ZTRectangle limit = new ZTRectangle(gameRect.End.X-200, gameRect.Start.Y, gameRect.End.X, gameRect.Start.Y +80); ZTRectangle position = ZTRectangle.Empty; return CVHelper.FindColorArray(out position, image, ShikongzhimenText, limit); } public static ColorArray LingdongRoomText = ColorArray.FromHsvFloatString(0.002f, 0.002f, 0.3f, "1144,18,204,193,167$1140,19,204,193,167$1148,19,204,193,167$1153,18,204,193,167$1153,19,204,193,167$1158,19,204,193,167$1160,25,204,193,167$1158,29,204,193,167$1157,29,204,193,167$1148,29,204,193,167$1144,29,204,193,167$1143,29,204,193,167$1140,29,204,193,167$1138,27,204,193,167"); /// /// 是否存在凛冬房间上的文字 /// /// /// /// public static bool ExistLingdongText(Image image, ZTRectangle gameRect) { ZTRectangle limit = new ZTRectangle(gameRect.End.X - 200, gameRect.Start.Y, gameRect.End.X, gameRect.Start.Y + 40); ZTRectangle position = ZTRectangle.Empty; return CVHelper.FindColorArray(out position, image, LingdongRoomText, limit); } } }