45deg line Gabor filtering by accord

using System;
using System.Media;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Accord;
using Accord.Imaging;
using Accord.Imaging.Filters;
using Accord.Controls;

namespace Gabor_Moddagy
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        // form load ------------------------------------------------
        private void Form1_Load(object sender, EventArgs e)
        {
            pictureBox1.SizeMode = PictureBoxSizeMode.Zoom;
            pictureBox2.SizeMode = PictureBoxSizeMode.Zoom;

        }

        // Gabor Filtering button ---------------------------------------------
        private void button1_Click(object sender, EventArgs e)
        {
            Bitmap img1 = (Bitmap)pictureBox1.Image;

            // resize ---------------------------------
            ResizeBilinear filtResize = new ResizeBilinear(511, 511);
            // apply the filter
            Bitmap newImage = filtResize.Apply(img1);

            // Adaptive Threshold ----------------------
            BradleyLocalThresholding filter = new BradleyLocalThresholding();
            // apply the filter
            filter.ApplyInPlace(img1);

            // Invert ----------------------------------
            //Invert filtInvert = new Invert();
            // apply the filter
            //filtInvert.ApplyInPlace(img1);

            // Create a new Gabor filter ---------------
            GaborFilter filtGabor = new GaborFilter();
            // Apply the filter
            Bitmap output = filtGabor.Apply(img1);

            // Show the output
            pictureBox2.Image = output;

            //ImageBox.Show(output);

            SystemSounds.Beep.Play();
        }
    }
}

댓글

이 블로그의 인기 게시물

Draw Circle on PictureBox when Button Click - Winform

2D FFT of Gray Image by AForge