private void ApplyCustomTresholdFilter(int thresholdValue) { FactoryFilterBinarization ffb = new FactoryFilterBinarization(); Filter binaryFilter = ffb.Create(); ((Binarization)binaryFilter).Threshold = this.iThresholdValue; this.imgThreshold = binaryFilter.ApplyFilter(this.imgGrey); this.labelThresholdValue.Text = this.trackBarThreshold.Value.ToString(); this.UpdateTrackBar(); this.UpdatePictureBox(); Pool.Instance.Binary = this.imgThreshold; }
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; }