From 7944e1e4bbcef39c7f45bd52791c0db1ea2fdea5 Mon Sep 17 00:00:00 2001 From: jarig Date: Sat, 23 Jan 2016 16:04:29 +0200 Subject: [PATCH] improved reward recognition --- EliteReporter/Assets/reward_eng.bmp | Bin 2934 -> 11422 bytes EliteReporter/Assets/reward_rus.bmp | Bin 3454 -> 15482 bytes EliteReporter/Utils/ScreenAnalyzer.cs | 5 +++-- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/EliteReporter/Assets/reward_eng.bmp b/EliteReporter/Assets/reward_eng.bmp index cbaf54df4c20fdd540cd8790c16efb965a8e8b19..f41dd80196a087a4e53b9eeade7351ab0230c028 100644 GIT binary patch delta 385 zcmew+HZM}g$#={M1J(PR;>)sq#t z=7Vtor_6}QdWzacMuy1+nwybHkWB!| CizCSZ diff --git a/EliteReporter/Assets/reward_rus.bmp b/EliteReporter/Assets/reward_rus.bmp index 10664d28fe82c096494b6878387098fd8c477c73..e4c44cb232f4b6ab3f9365cedb41638ec1e4aad9 100644 GIT binary patch delta 531 zcmew-^{Yb1$+yae0SwH5qy`Z4F)}a+18GJE39z^eRGxuhqRzyL0R|KI+E2c~vj&Di zB7ekz&DHkeT$dSU>?IJwD{Y=09Q!p`2YX_ delta 192 zcmexW@lQ&}$+wP|0SwH5qy`W>0kI$uGcrg3NeDQ?$G~ueZ=%k`$rsqzCjaN;nfPCK zassnBkjp-K9rLQmPk2Ot>@7fA5UOM&69dC!G2UY!%1HoB diff --git a/EliteReporter/Utils/ScreenAnalyzer.cs b/EliteReporter/Utils/ScreenAnalyzer.cs index bf85aaa..0191a4e 100644 --- a/EliteReporter/Utils/ScreenAnalyzer.cs +++ b/EliteReporter/Utils/ScreenAnalyzer.cs @@ -105,6 +105,7 @@ public MissionInfo findAndAnalyzeMissionSummaryPage(string pathToBmp, bool inclu } } + source = source.GetSubRect(new Rectangle((int)(450*widthFactor), 0, source.Width - (int)(450*widthFactor), source.Height)); using (Image result = source.MatchTemplate(rewardTemplate, Emgu.CV.CvEnum.TemplateMatchingType.CcoeffNormed)) { double[] minValues, maxValues; @@ -112,11 +113,11 @@ public MissionInfo findAndAnalyzeMissionSummaryPage(string pathToBmp, bool inclu result.MinMax(out minValues, out maxValues, out minLocations, out maxLocations); // You can try different values of the threshold. I guess somewhere between 0.75 and 0.95 would be good. - if (maxValues[0] > 0.7) + if (maxValues[0] > 0.65) { int reward = 0; // reward - var match = new Rectangle(new Point(maxLocations[0].X + rewardTemplate.Width + (int)(210 * widthFactor), + var match = new Rectangle(new Point(maxLocations[0].X + rewardTemplate.Width, maxLocations[0].Y), new Size((int)(210 * widthFactor), rewardTemplate.Height)); if (match.X + match.Width > source.Width || match.Y + match.Height > source.Height)