3

I'm looking for a FAST 2D cross-shaped median filter algorithm. The naive algorithm is to slide the cross over the image and find the median of the pixels in the cross by some sorting algorithm. The cross-shaped kernel could be '+' (horizontal and vertical cross) and 'x' (diagonal cross).

I am aware of available algorithms that uses histograms but they seem to work only for square shaped kernels. See this question and this question

james
  • 1,107
  • 14
  • 29
  • @Piglet this is a specific question about finding a fast 2D cross-shaped median algorithm. Why is it too broad and off-topic? – james Apr 13 '18 at 09:40
  • You can still use the same histogram concept. You just need to replace the rules that add and remove pixel values based on your filter shape. – Nico Schertler Apr 13 '18 at 11:42
  • Yes, I can still use the same histogram method to work out the median. but for cross shaped kernels, the number of pixels in the kernel is much less than squared kernels and sliding the window does not create lots of redundant operations like squared kernels. I doubt the histogram method would out perform the conventional method. – james Apr 13 '18 at 13:57
  • What size of kernel are we talking about? – Nico Schertler Apr 13 '18 at 14:52
  • say 5x5 squared kernel, there are 25 pixels. but for '+' cross kernel within the same square, there are only 9 pixels. – james Apr 13 '18 at 15:37

0 Answers0