private void convolveButton_Click(object sender, EventArgs e) { KassWitkinFilterBank _bank = new KassWitkinFilterBank(); _bank.FilterAngle = 15; _bank.NoOfFilters = 12; _bank.KernelDimension = 32; _bank.WidthWithPadding = (int)Tools.ToNextPow2((uint)(_bank.KernelDimension + _inputImage.Width)); _bank.HeightWithPadding = (int)Tools.ToNextPow2((uint)(_bank.KernelDimension + _inputImage.Height)); Bitmap _paddedImage = ImagePadder.Pad(_inputImage, _bank.WidthWithPadding, _bank.HeightWithPadding); List <Bitmap> filtered = _bank.Apply(_paddedImage); pictureBox1.Image = filtered[0]; pictureBox2.Image = filtered[1]; pictureBox3.Image = filtered[2]; pictureBox4.Image = filtered[3]; pictureBox5.Image = filtered[4]; pictureBox6.Image = filtered[5]; pictureBox7.Image = filtered[6]; pictureBox8.Image = filtered[7]; pictureBox9.Image = filtered[8]; pictureBox10.Image = filtered[9]; pictureBox11.Image = filtered[10]; pictureBox12.Image = filtered[11]; }
private void padImageButton_Click(object sender, EventArgs e) { Bitmap image = inputImagePictureBox.Image as Bitmap; int combinedWidth = (int)Tools.ToNextPow2(Convert.ToUInt32(image.Width)); int combinedHeight = (int)Tools.ToNextPow2(Convert.ToUInt32(image.Height)); Bitmap paddedImage = ImagePadder.Pad(image, combinedWidth, combinedHeight); paddedImagePictureBox.Image = paddedImage; paddedInputImageResolutionTextBox.Text = "" + paddedImage.Width + " X " + paddedImage.Height; }
private void padButton_Click(object sender, EventArgs e) { Bitmap lena = Grayscale.ToGrayscale(_inputImage); Bitmap mask = Grayscale.ToGrayscale(_maskImage); ////We must add int maxWidth = (int)Tools.ToNextPow2(Convert.ToUInt32(lena.Width + mask.Width)); int maxHeight = (int)Tools.ToNextPow2(Convert.ToUInt32(lena.Height + mask.Height)); Bitmap paddedImage = ImagePadder.Pad(lena, maxWidth, maxHeight); Bitmap paddedMask = ImagePadder.Pad(mask, maxWidth, maxHeight); //new PictureBoxForm(paddedImage, paddedMask).ShowDialog(); inputImagePictureBox.Image = paddedImage; paddedMaskPictureBox.Image = paddedMask; }