Example #1
0
 public override void CreateFilteredMat()
 {
     FilteredMat = CaptureSource.Clone();
     ImageFilterHelper.whiteToDarkPixel(FilteredMat, 150);
     ImageFilterHelper.killDarkPixel(FilteredMat, 40);
     ImageFilterHelper.saturation(FilteredMat, 0, 255, 1);
 }
Example #2
0
 private int determinePercentage()
 {
     if (barPercent != -1)
     {
         return(barPercent);
     }
     barPercent = ImageFilterHelper.getBarPercentage(FilteredMat, new Scalar(0, 0, 0));
     return(barPercent);
 }
Example #3
0
        public override void CreateFilteredMat()
        {
            if (UseCastableDetection())
            {
                CasteableDetection = new Mat(this.CaptureSource, this.CastableDetectionArea);
                CasteableDetection = CasteableDetection.Resize(new Size(1, 1), 0, 0, InterpolationFlags.Cubic);
                ImageFilterHelper.reduceColor(CasteableDetection, 64);
            }

            FilteredMat = CaptureSource;
            if (this.IsCastable() || !UseCastableDetection())
            {
                FilteredMat = new Mat(this.CaptureSource, new Rect(this.BorderCut, this.BorderCut, this.CaptureSource.Width - this.BorderCut * 2, this.CaptureSource.Height - this.BorderCut * 2));
                FilteredMat = FilteredMat.Blur(new Size(5, 5), new Point(-1, -1));
                ImageFilterHelper.killDarkPixel(FilteredMat, 60);
                // ImageFilterHelper.KillGrayPixel(ref image, 60);
                ImageFilterHelper.saturation(FilteredMat, 0, 2, 50);
            }
        }