View Full Version : Anyone ever use Resizers to clean up an image?
Jeff D
21st April 2004, 20:28
Thinking about how photo programs that when you zoom out can cause a blury image to "appear" clear I'm wondering if the same idea can be used for cleaning up a a dirty or possibly fuzzy source.
What I was thinking was to do multiple step process...
Resize up to 4x the source dimensions
Resize that down 1/2 (2x the source size)
Resize down again 1/2 (same as source size)
(or just resize back to source size in one step)
I was thinkng of experimenting around with this when I discovered I didn't have any sources that I could play with to test this idea out.
Anyone ever play aound with an idea like this?
scharfis_brain
21st April 2004, 20:56
this will nearly the same like a soft (and dumb) spatial smoother.
test it yourself:
x=avisource("x.avi")
# you may want to change bicubic into lanczos or others...
y=x.bicubicresize(x.width*4,x.height*4).reduceby2().reduceby2()
interleave(x,y)
btwe. mipsmooth uses the resizing approach to claen up noisy video
Soulhunter
21st April 2004, 21:03
Originally posted by Jeff D
What I was thinking was to do multiple step process...
Resize up to 4x the source dimensions
Resize that down 1/2 (2x the source size)
Resize down again 1/2 (same as source size)
Hmm, your example would only blur the picture due the interpolation... :rolleyes:
EDIT: Nah, scharfi was faster !!!
Bye
Jeff D
22nd April 2004, 00:09
Thaks guys, I didn't think the process would produce great results, but more curious about the "idea".
Mipsmooth is interesting, I think I'll give that a look too.
Mug Funky
22nd April 2004, 15:45
[self pimp mode]
here's one...
function DenoiseMix (clip c, int "cut", int "rolloff", float "gamma",
\ int "radius", int "th", int "temp_radius", int "scenechange", bool "show")
{
radius=default(radius,8)
temp_radius=default(temp_radius,1)
scenechange=default(scenechange,20)
cut=default(cut,127)
rolloff=default(rolloff,10)
gamma=default(gamma,1.5)
th=default(th,3)
show=default(show,false)
low = c.bilinearresize(4*(c.width/radius),4*(c.height/radius))
\ .temporalsoften(temp_radius,th,th,scenechange,2)
\ .bicubicresize(c.width,c.height,1,0)
highmask = overlay(low,c,mode="difference")
\ .levels(cut,gamma,cut+rolloff,0,255,coring=false)
show==true ? highmask.greyscale() : overlay(low,c,mask=highmask)
}
defaults will do, there's some other options to slow it down, but the only one you'll need to change is "rolloff" depending on how noisy the source is.
example:
denoisemix(rolloff=30) for a _really_ noisy source.
it works like a mix between vaguedenoiser and mipsmooth, but faster (and waaaay simpler... i haven't a clue about wavelets).
to use, put the above into a text file named "denoisemix.avsi" and place in avisynth plugins directory.
jorel
23rd April 2004, 00:27
@ scharfis_brain and all
i tested the script only to compare:
x=avisource("x.avi")
# you may want to change bicubic into lanczos or others...
y=x.bicubicresize(x.width*4,x.height*4).reduceby2().reduceby2()
interleave(x,y)
and can't see differences without resize or using xxresizes
the quality don't change or are despicables !
;)
@ Mug Funky
your script like posted is excellent in my little test with 2000 frames!
:)
Mug Funky
23rd April 2004, 16:54
thanks jorel :)
you might also find an increase in compressibility (nowhere near as much as with kassandro's excellent "removedirt" though)
What do you think about this idea:
1. Upsize the video using fast bilinear
2. Apply a sharpen filter (simple 3x3 convolution)
3. Downsize to the desired (original?) resolution
Whenever I did that with photos I got amazing results - but I never tried it with video...
bb
Paced
25th April 2004, 11:17
@Mug Funky
Excellent script, thanks for sharing :cool:
jorel
26th April 2004, 02:09
Originally posted by bb
What do you think about this idea:
1. Upsize the video using fast bilinear
2. Apply a sharpen filter (simple 3x3 convolution)
3. Downsize to the desired (original?) resolution
Whenever I did that with photos I got amazing results - but I never tried it with video...
bb
can you post a script using the right parameters and filters for dvd ntsc source?
i want to test your idea, seems cool !
thanks in advance.
Mug Funky
26th April 2004, 09:13
jorel: you might want to take a look at this thread... it's not what bb suggested, but it's interesting nonetheless, and producing some good results.
don't even try to understand what didee's talking about... i can barely understand it myself. but the sharpen script works very well. (oh, i hadn't posted the function of his one... poo. i'll do that asap.)
http://forum.doom9.org/showthread.php?s=&threadid=74900
jorel
26th April 2004, 13:53
Originally posted by Mug Funky
jorel: you might want to take a look at this thread... it's not what bb suggested, but it's interesting nonetheless, and producing some good results.
don't even try to understand what didee's talking about... i can barely understand it myself. but the sharpen script works very well. (oh, i hadn't posted the function of his one... poo. i'll do that asap.)
http://forum.doom9.org/showthread.php?s=&threadid=74900
:p i know what you mean about what didee's talking.
that thread is only for masters. i got your script in your last edition
in the first page of the thread: "Last edited by Mug Funky on 26th April 2004 at 08:34"
well here show that was the last edition.
thanks for that Mug Funky !
Originally posted by jorel
can you post a script using the right parameters and filters for dvd ntsc source?
i want to test your idea, seems cool !
thanks in advance.
It's just an idea, and I believe it has to be worked out. I was thinking of something like this:
AviSource("C:\Films\DV\HomeVideo.avi")
SimpleResize(1080, 864)
Sharpen(1.0)
SimpleResize(720,576)
But I'm pretty sure it's not as easy as this one. May make it worse instead of better, I don't know, because I did not spend any time on testing.
bb
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.