Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
17th October 2004, 19:37 | #21 | Link |
Registered User
Join Date: Dec 2003
Location: MO, US
Posts: 999
|
Little late now, but I had a go at a YV12 only median filter yesterday as well. It is similar to the filters in mask tools in that it takes 3 parameters (Y, U, V) so each plane can have its own radius, or depending on the settings planes can be copied, memset to specific values, or simply not processed at all. Also, this filter will handle the edges of the image (less then radius distance away). In a little speed test it appeared to be about twice as fast as medianblur for the same radius.
Also, it seems the reason tsp's filter does not do anything is that it literally doesn't... at the end it returns the original frame instead of the processed frame. I've been there before . EDITED: removed link. tsp's is faster now and supports all the same things.. grab his. Last edited by tritical; 31st October 2004 at 05:27. |
17th October 2004, 20:36 | #22 | Link |
Registered User
Join Date: Aug 2004
Location: Denmark
Posts: 807
|
embarrasing . Fixed that little bug, same link. Doesn't change the fact that it is slow. Working on another sort algorithm. Should speed the filter up.
Also I have added the feature to add seperate radius for each plane. if the radius is set to 0 the plane is unchange and if set to -1 the plane isn't processed at all. the syntax is now: medianblur(clip,radiusy,radiusu,radiusv) Last edited by tsp; 17th October 2004 at 21:13. |
18th October 2004, 05:19 | #23 | Link |
interlace this!
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,555
|
wow, tsp's medianblur does very funny (and cool looking) things to the picture. almost like a motion-blur. perhaps MVtools will give cleaner vectors if i feed it with this?
question: why is photoshop's median so much faster? adobe are definitely not known for optimizing anything (ever...).
__________________
sucking the life out of your videos since 2004 |
18th October 2004, 15:25 | #27 | Link | |
ffdshow/AviSynth wrangler
Join Date: Feb 2003
Location: Austria
Posts: 2,441
|
Quote:
Isn't a full-fledged convolution a bit overkill for this case? np: Phoenecia - Biorepo (Brownout) |
|
18th October 2004, 15:29 | #28 | Link |
Registered User
Join Date: Jan 2002
Location: France
Posts: 2,856
|
A convolution by a kernel filled with ones amounts to count the white pixels. And some convolutions ( YV12Convolution at least ) are optimized in order not to recompute lines / columns already computed, so it will be almost as fast.
|
19th October 2004, 21:04 | #29 | Link |
Registered User
Join Date: Aug 2004
Location: Denmark
Posts: 807
|
Updated medianblur. It is now minimum 3 times faster for radius 1 to about 10^6 times faster for radius 150 and up. You can get it here and the sourcecode here.
The filter now creates a variable called DEBUG that containes the time in msec that the filter uses to calculate each frame. Get the time like this: Code:
scriptclip("subtitle(string(DEBUG),x=50,y=50)",after_frame=true) |
21st October 2004, 03:21 | #30 | Link |
interlace this!
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,555
|
wow, that is a lot faster.
seems to mess up chroma on non-mod16 resolutions. that's not really a problem though. [edit] here's a very simple median-denoiser. i have a photoshop action that does the same thing (only much slower) for making jpegs more compressible. Code:
clean = last.medianblur(4) mask = yv12lutxy(last,clean,yexpr="x y - abs 256 6 / *") maskedmerge(clean,last,mask)
__________________
sucking the life out of your videos since 2004 Last edited by Mug Funky; 21st October 2004 at 03:38. |
21st October 2004, 17:51 | #31 | Link |
Registered User
Join Date: Aug 2004
Location: Denmark
Posts: 807
|
I finnished version 0.3 of medianblur. It is now even faster and can now process the borders too. Get it here (52 KB). Sourcecode is included.
Next I will add a temporal filter or a binary median blur. |
23rd October 2004, 12:39 | #33 | Link |
Registered User
Join Date: Apr 2002
Location: Germany
Posts: 5,391
|
Thanks tsp and tritical for implementing this. Please continue the race to make your filter faster than the other one's
BTW, anyone noticed yet that a median blur makes a wonderful base for removing edge halos ... ?
__________________
- We´re at the beginning of the end of mankind´s childhood - My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!) |
24th October 2004, 11:12 | #34 | Link |
Registered User
Join Date: Dec 2003
Location: MO, US
Posts: 999
|
Well I think that race is over before it got started . tsp had to go and do it the smart way , that spoils all the fun. I'll leave mine up just because it has this median resize algo that I remembered seeing in a book I read (though it is pretty crappy). It also has a center weighted median option though tsp's filter could have a center weighted option added fairly easily and be faster. tsp's is definitely faster if you want a plain median blur so I would recommended his filter...
|
25th October 2004, 14:35 | #35 | Link |
Registered User
Join Date: Apr 2002
Location: Germany
Posts: 5,391
|
Hmh. The results of MedianBlur() and TMedian() are very different.
Actually, TMedian() gives the result I expect from a median filter. MedianBlur() produces a strange "widening" of small features such as thin lines, which were rather supposed to disappear instead of getting widened: Am I missing something here?
__________________
- We´re at the beginning of the end of mankind´s childhood - My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!) |
27th October 2004, 14:03 | #39 | Link |
Pig on the wing
Join Date: Mar 2002
Location: Finland
Posts: 5,733
|
Should this thread be moved to the usage forum? Many people don't peek in here often - including me.
Thanks for the filter, it might be useful with my TV caps
__________________
And if the band you're in starts playing different tunes I'll see you on the dark side of the Moon... |
|
|