private void ApplyTresholdFilter(int thresholdValue) { FactoryFilterGrayScale ffgs = new FactoryFilterGrayScale(); Filter greyImage = ffgs.Create(); this.imgGrey = greyImage.ApplyFilter(this.imgOriginal); Bitmap newBmp = new System.Drawing.Bitmap(imgOriginal); // create filter FactoryFilterBinarization ffb = new FactoryFilterBinarization(); Filter binarizationOtsu = ffb.Create(); // apply the filter this.imgThreshold = binarizationOtsu.ApplyFilter(this.imgGrey); this.UpdatePictureBox(); Pool.Instance.Binary = this.imgThreshold; }
/** * 1 - Gray Scale * 2 - Binarization * 3 - Edge Detection * 4 - Blob extractor (hand contour) **/ public Bitmap ApplyPrimaryFilters() { Bitmap imgProcessed = null; HandContour hc = new HandContour(); // Binarization FactoryFilterGrayScale ffgs = new FactoryFilterGrayScale(); Filter greyImage = ffgs.Create(); Bitmap imgGrey = greyImage.ApplyFilter(this._imgOriginal); OtsuThreshold filter = new OtsuThreshold(); imgProcessed = filter.Apply(imgGrey); // Edge Detection start FactoryFilterEdgeDetection ffed = new FactoryFilterEdgeDetection(); Filter edgeDetection = ffed.Create(); imgProcessed = edgeDetection.ApplyFilter(imgProcessed); // Contour Extraction _handCountour = hc.ExtractHandContour(imgProcessed); return(_handCountour); }