DEBLUR
Quick and dirty sharpening.
REQUIREMENTS
fft3dfilter
arearesize
-------------------------------
I wanted to write something that could "fix" blurry encodes. It works fairly well, as long as your source isn't fubar to begin with.
I just posted a few images that should show what can be done with the default settings followed by a bit of denoising (fft3dfilter(sigma=8) for these).
Anyways hope you enjoy the script!
----------------------------------
And here are a few images. Left is original, center is blurred, right is the result at the default strength with a block size of 48 (deblur2(bsize=48)).
![[Image: 0J8QYZe.png]](https://i.imgur.com/0J8QYZe.png)
(This post was last modified: 2018-04-11, 06:31 PM by MWilson.)
Quick and dirty sharpening.
REQUIREMENTS
fft3dfilter
arearesize
-------------------------------
I wanted to write something that could "fix" blurry encodes. It works fairly well, as long as your source isn't fubar to begin with.
I just posted a few images that should show what can be done with the default settings followed by a bit of denoising (fft3dfilter(sigma=8) for these).
Anyways hope you enjoy the script!
----------------------------------
Code:
function deblur2(clip v,float "blend",bool "clean",int "bsize", bool "show")
{
blend=Default(blend,.75)
clean=default(clean,true)
show=default(show,false)
bsize=default(bsize,4)
osize=bsize/2
v=v.converttoyv12()
v
fft3dfilter(16,bw=bsize,bh=bsize,ow=osize,oh=osize)
Subtract(last,v)
Subtract(v,last)
a=last
a.arearesize(width(v)/2,height(v)/2)
fft3dfilter(16,bw=bsize,bh=bsize,ow=osize,oh=osize)
gaussresize(width(a),height(a),p=1)
Subtract(last,a)
Subtract(a,last)
b=last
b
fft3dfilter(16,bw=bsize,bh=bsize,ow=osize,oh=osize)
Subtract(last,b)
Subtract(b,last)
fft3dfilter(sharpen=4)
(clean==true) ? last.fft3dfilter(16,bw=32,bh=32,ow=16,oh=16) : last
merge(v,last,blend)
x=last
(show==true) ? StackHorizontal(v,x) : x
return last
}
And here are a few images. Left is original, center is blurred, right is the result at the default strength with a block size of 48 (deblur2(bsize=48)).
![[Image: 0J8QYZe.png]](https://i.imgur.com/0J8QYZe.png)
![[Image: pilb4xO.png]](https://i.imgur.com/pilb4xO.png)