private void СужениеToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Laboratory_work_1.Form2 form = new Laboratory_work_1.Form2();
            form.ShowDialog();
            Erosion filter = new Erosion();

            filter.kernelSize = form.kernelSize;
            Bitmap resultImage = filter.processImage(image);

            pictureBox1.Image = resultImage;
            pictureBox1.Refresh();
        }
        private void ЗакрытиеToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Laboratory_work_1.Form2 form = new Laboratory_work_1.Form2();
            form.ShowDialog();
            Dilation filter1 = new Dilation();

            filter1.kernelSize = form.kernelSize;
            Bitmap  resultImage1 = filter1.processImage(image);
            Erosion filter2      = new Erosion();

            filter2.kernelSize = form.kernelSize;
            Bitmap resultImage2 = filter2.processImage(resultImage1);

            pictureBox1.Image = resultImage2;
            pictureBox1.Refresh();
        }