public frmEdgeDetection() { InitializeComponent(); FactoryFilterEdgeDetection ffed = new FactoryFilterEdgeDetection(); this.edgeDetection = ffed.Create(); }
public frmEdgeDetection(Bitmap img) { InitializeComponent(); FactoryFilterEdgeDetection ffed = new FactoryFilterEdgeDetection(); this.edgeDetection = ffed.Create(); this.imgBinary = img; this.imgEdgeDetected = this.edgeDetection.ApplyFilter(this.imgBinary); this.pictureBoxMain.Image = this.imgEdgeDetected; Pool.Instance.EdgeDetected = this.imgEdgeDetected; }
/** * 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); }