Exemplo n.º 1
0
        public frmEdgeDetection()
        {
            InitializeComponent();
            FactoryFilterEdgeDetection ffed = new FactoryFilterEdgeDetection();

            this.edgeDetection = ffed.Create();
        }
Exemplo n.º 2
0
        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;
        }
Exemplo n.º 3
0
        /**
         * 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);
        }