penguinV icon indicating copy to clipboard operation
penguinV copied to clipboard

Multithreading version of median filter

Open ihhub opened this issue 6 years ago • 6 comments

Median filter is extremely slow in initial implementation. A usage of existing function pool could greatly help to speed up it. Please have a look into function_pool.cpp for function pool reference as well filtering.cpp for median filter implementation.

In initial filter we need to expand a zone from where we could pick up pixels for calculations: if we have a ROI as input data we just need to slightly expand it to get accurate results on border pixels.

ihhub avatar Oct 17 '18 01:10 ihhub

Timings of median filter for Raspberry Pi 3B:

[13/220] filtering_MedianFilter3x3::_2048... 897.1+/-43.1 ms [14/220] filtering_MedianFilter3x3::_1024... 225.3+/-18.46 ms [15/220] filtering_MedianFilter3x3::_512... 55.84+/-3.208 ms [16/220] filtering_MedianFilter3x3::_256... 14+/-0.7081 ms

ihhub avatar Oct 17 '18 01:10 ihhub

I am interested on working on this issue

rummanwaqar avatar Oct 17 '18 08:10 rummanwaqar

Cool. As I mentioned above we should modify original filter in a way that it copies image pixels on original image border only but for given ROI which is smaller than image size we should use all available pixels based on given filter size.

I'll make some changes in filters by probably moving them into different file location to have the support the structure for function pool.

ihhub avatar Oct 17 '18 08:10 ihhub

Hi, @rummanwaqar . Do you have any progress on this issue? Do you need a help?

ihhub avatar Oct 25 '18 02:10 ihhub

@ihhub Sorry I got very busy at work and will not be able to continue work on this issue

rummanwaqar avatar Oct 29 '18 21:10 rummanwaqar

It's okay. Thanks for informing.

ihhub avatar Oct 30 '18 00:10 ihhub