View Full Version : Median Blur
HighInBC
15th October 2004, 03:02
Does anyone know of a filter that will blur the frame by performing a median blur?
The way a median blur works is you give it a radius and it takes the most common color within the radius of each pixel and sets the pixel thusly. This accomplishes a despeckling that does not introduce new colors to the frame.
This would really help me out with my mask making projects.
Didée
15th October 2004, 09:38
Small correction: a plain median filter doesn't take the "most common color". It takes the middle value after sorting all values, shortly said. I.e. given the set of numbers {3,2,1,9,10}, the median value is 3 -- two values are smaller, two are bigger, and "3" is the median.
But apart from that nitpicking: Yes, a median filter for avisynth is severly missing. So I second your request:
Could someone please code a median filter?
Mug Funky
15th October 2004, 12:23
i "third" that request. i could do a lot of stuff with a variable radius median (like the one in photoshop).
only problem with radius based stuff is how to treat chroma? i guess giving it half the luma radius would do.
HighInBC
15th October 2004, 16:13
YES! Just like photoshop!! exactly.
scharfis_brain
15th October 2004, 16:22
hehe, I am using the median-filter to anti-alias FAXed texts :)
I would like to see it in AVISynth, too!
HighInBC
15th October 2004, 17:08
Good idea, with faxes the radius will always be the same too, so you don't have to tweak it each time.
This should not be a filter, it should be built right into avisynth, imho.
I have posted a thread about this in the development section:
http://forum.doom9.org/showthread.php?s=&threadid=83883
Please post your ideas and comments there about this possible filter.
kassandro
15th October 2004, 17:19
I wouldn't call it blurring, but RemoveGrain (http://www.RemoveGrain.de.tf)(mode=4) does essentially what HighInBC wants (with radius 1 only). For a given pixel, the middle value (as described by Didee below) is calculated of the value of the pixel and its eight neighbours. That sounds somewhat different from the describtion on the RemoveGrain web site but both describtions are identical for mode=4. RemoveGrain(mode=4) is highly SSE optimised and almost as fast as Undot.
HighInBC
15th October 2004, 18:07
Originally posted by kassandro
I wouldn't call it blurring, but RemoveGrain (http://www.RemoveGrain.de.tf)(mode=4) does essentially what HighInBC wants (with radius 1 only). For a given pixel, the middle value (as described by Didee below) is calculated of the value of the pixel and its eight neighbours. That sounds somewhat different from the describtion on the RemoveGrain web site but both describtions are identical for mode=4. RemoveGrain(mode=4) is highly SSE optimised and almost as fast as Undot.
Thanks for the tip, I did not know about that one tho I do know of another filter that does the same or similiar. However I need variable radius, 1 pixel radius is not enough for my purposes...
Using image magick on frames manually I usually use a raduis of 2 or 3.
tsp
17th October 2004, 13:54
see this thread (http://forum.doom9.org/showthread.php?s=&threadid=83883)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.