Skip to content

Latest commit

 

History

History
49 lines (33 loc) · 1.71 KB

minFilter.md

File metadata and controls

49 lines (33 loc) · 1.71 KB

Min Filter

Introduction

Given an image, we'll replace each pixel intensity with minimum value from its neighbouring pixels, where order of neighbourhood can be variable X ( > 0).

Performance

  • Prior to this writing, I wrote concurrent MinFilter implementation where each pixel was getting processed in different worker thread ( depending upon availability in thread pool ).
  • Now implementation has been improved by processing each row of image matrix concurrently.
  • Previously each thread was doing little work, but for large images ( & for higher order filtering ) communication cost ( work distribution ) was too high due to presence of large number of pixels in image.
  • So, I considered reducing number of works created, by processing each row concurrently on possibly different worker threads.
  • Check below for performance improvement, due to updating implementation

Sample

I applied both MinFilter implementations on sample of dimension 2560 x 1440, with order value set to 5.

Source Sink
moon minFiltered

Before

performanceMinFilter_2

After

performanceMinFilter_1

Results

All filters applied on order-0 image.

Order Image
0 sample_image
1 order_1_MinFiltered
2 order_2_MinFiltered
3 order_3_MinFiltered
4 order_4_MinFiltered
5 order_5_MinFiltered

Thanking you 😊