Exemple #1
0
        private void loadInputImageButton_Click(object sender, EventArgs e)
        {
            Bitmap bInput = Grayscale.ToGrayscale(Bitmap.FromFile(path) as Bitmap);

            inputImagePictureBox.Image = bInput;

            inputImageResolutionTextBox.Text = "" + bInput.Width + " X " + bInput.Height;
        }
        private void loadButton_Click(object sender, EventArgs e)
        {
            Bitmap bInputImage = Grayscale.ToGrayscale(Bitmap.FromFile(path) as Bitmap);

            int newWidth  = (int)Tools.ToNextPow2((uint)bInputImage.Width);
            int newHeight = (int)Tools.ToNextPow2((uint)bInputImage.Height);

            Bitmap lenaResized = ImageResizer.Resize(bInputImage, newWidth, newHeight);

            inputImagePictureBox.Image = lenaResized as Image;
        }
        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;
        }
Exemple #4
0
        public static int[,] ToGrayscale2(Bitmap colorBitmap)
        {
            Bitmap bmp = Grayscale.ToGrayscale(colorBitmap);

            return(ImageDataConverter.ToInteger(bmp));
        }
Exemple #5
0
        private void loadInputImageButton_Click(object sender, EventArgs e)
        {
            _inputImage = Grayscale.ToGrayscale(Bitmap.FromFile(imagePath) as Bitmap);

            inputImagePictureBox.Image = _inputImage as Image;
        }