Skip to content

Latest commit

 

History

History
66 lines (43 loc) · 1.85 KB

modeFilter.md

File metadata and controls

66 lines (43 loc) · 1.85 KB

Mode Filter

Introduction

Given an image & order ( > 0 ), we'll compute max intensity around each pixel location, and replace intensity at that location in sink image, with computed max intensity.

Performance

While incorporating concurrency in generalized Mode Filter, I was processing each pixel location concurrently, which was adding cost to computation time ( due to increased communication needed to be made while job scheduling, for very large images ).

So, I've improved it by concurrently processing each row of image matrix. Here's result.

Before

performanceModeFilter_2

After

performanceModeFilter_1

Test

I've tested both the implementations ( specified above ) on a 1920 x 1275 image ( left image ).

Source Sink
dream order_3_ModeFiltered_2

Usage

  • Code for applying order-3 Mode Filter on an image
import in.itzmeanjan.filterit.ImportExportImage;
import in.itzmeanjan.filterit.filter.ModeFilter;


public class Main{

	public static void main(String [] args){
		System.out.println(
            ImportExportImage.exportImage(
                new ModeFilter().filter("dream.jpg", 3), "modeFiltered.jpg"));
	}

}
  • Compile & run ( make sure you've added in.itzmeanjan.filterit.jar in your project )

Results

All filters applied on order-0 image.

Order Image
0 sample_image
1 order_1_ModeFiltered
2 order_2_ModeFiltered
3 order_3_ModeFiltered
4 order_4_ModeFiltered
5 order_5_ModeFiltered