// Custom morphology operator private void Morphology( ) { if ( image.PixelFormat != PixelFormat.Format8bppIndexed ) { MessageBox.Show( "Mathematical morpholgy filters can by applied to grayscale image only", "Message", MessageBoxButtons.OK, MessageBoxIcon.Exclamation ); return; } MathMorphologyForm form = new MathMorphologyForm( MathMorphologyForm.FilterTypes.Simple ); form.Image = image; if ( form.ShowDialog( ) == DialogResult.OK ) { ApplyFilter( form.Filter ); } }
// Hit & Miss mathematical morphology operator private void hitAndMissFiltersItem_Click( object sender, System.EventArgs e ) { if ( CheckIfBinary( "Hit & Miss morpholgy filters" ) ) { MathMorphologyForm form = new MathMorphologyForm( MathMorphologyForm.FilterTypes.HitAndMiss ); form.Image = image; if ( form.ShowDialog( ) == DialogResult.OK ) { ApplyFilter( form.Filter ); } } }
// Hit & Miss mathematical morphology operator private void hitAndMissFiltersItem_Click( object sender, System.EventArgs e ) { if ( image.PixelFormat != PixelFormat.Format8bppIndexed ) { MessageBox.Show( "Hit & Miss morpholgy filters can by applied to binary image only", "Message", MessageBoxButtons.OK, MessageBoxIcon.Exclamation ); return; } MathMorphologyForm form = new MathMorphologyForm( MathMorphologyForm.FilterTypes.HitAndMiss ); form.Image = image; if ( form.ShowDialog( ) == DialogResult.OK ) { ApplyFilter( form.Filter ); } }
// Custom morphology operator private void Morphology( ) { MathMorphologyForm form = new MathMorphologyForm( MathMorphologyForm.FilterTypes.Simple ); form.Image = image; if ( form.ShowDialog( ) == DialogResult.OK ) { ApplyFilter( form.Filter ); } }