Image Smoothing - Closing

opening

Introduction

Image smoothing can be performed by application of morphological operations in ordered fashion.

Image gets smoothed by adding new bright pixels, here we’re considering bright pixels to be our foreground pixels.

Size of structuring element i.e. order of kernel to be used Dilation & Erosion, can be specified, which will control extent of smoothing.

Usage

import in.itzmeanjan.filterit.ImportExportImage;
import in.itzmeanjan.filterit.smoothing.Closing;

public class Main{

	public static void main(String [] args){
		System.out.println(
            ImportExportImage.exportImage(
                new Closing().smooth("eye.jpg", 5, 5), 
                "closed.jpg"));
	}

}

Result

Generated by applying closing operation on left one, while size of kernel for both dilation & erosion set to 11 x 11 i.e. order of neighbourhood used 5.

Original Smoothed
eye opened

Thanking you :)