Quantcast
Channel: VideoHelp Forum
Viewing all articles
Browse latest Browse all 45423

how to remove grain without loosing min details

$
0
0
while detail enhancement some grains have been produced. while i'm trying to remove these annoying grains, its makes the output dull again.
is there any way of balancing this?
here is the original cliphttp://www.sendspace.com/file/po6v18
http://www.sendspace.com/file/jh8sb2
http://www.sendspace.com/file/n9m99p
and here is my script

Code:

MPEG2Source("blah.d2v", cpu2="xxooxo")
Crop(10, 82, -10, -82)
LanczosResize(784, 424)
colormatrix()
removegrain(mode=17)
backward_vec2 = last.MVAnalyse(isb = true, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1)
backward_vec1 = last.MVAnalyse(isb = true, delta = 1, pel = 2, overlap=4, sharp=1, idx = 1)
forward_vec1 = last.MVAnalyse(isb = false, delta = 1, pel = 2, overlap=4, sharp=1, idx = 1)
forward_vec2 = last.MVAnalyse(isb = false, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1)
a=last.MVDegrain2(backward_vec1,forward_vec1,backward_vec2, forward_vec2,thSAD=400,idx=2)
b = a.McTemporalDenoise(settings="high",strength=255,adapt=true, SHmode=3,Sovershoot=2)
SeeSaw(a,b, NRlimit=3, NRlimit2=5, Sstr=1.6, Slimit=5, Spower=5, sootheS=20, bias=90)
FineSharp(sstr=2.0)


function FineSharp(clip c, int "mode", float "sstr", float "cstr", float "xstr", float "lstr", float "pstr", float "ldmp")
{
mode  = default(mode, 1  )  #  1 to 3, weakest to strongest. When negative -1 to -3, a broader kernel for equalisation is used.
sstr  = default(sstr, 2.0 )  #  strength of sharpening, 0.0 up to ??
 
_cstr = spline(sstr, 0,0, 0.5,0.1, 1.0,0.6, 2.0,0.9, 2.5,1.00, 3.0,1.09, 3.5,1.15, 4.0,1.19, 8.0,1.249, 255.0,1.5)
_cstr = (mode>0) ? _cstr : pow(_cstr,1./1.25)

cstr  = default(cstr, _cstr)  #  strength of equalisation, 0.0 to ? 2.0 ? (recomm. 0.5 to 1.25, default AUTO)
xstr  = default(xstr, 0.19 )  #  strength of XSharpen-style final sharpening, 0.0 to 1.0 (but, better don't go beyond 0.249 ...)

                              #  Viscera parameters
lstr  = default(lstr, 1.49 )  #  modifier for non-linear sharpening
pstr  = default(pstr, 1.272)  #  exponent for non-linear sharpening
ldmp  = default(ldmp, sstr+0.1) # "low damp", to not overenhance very small differences (noise coming out of flat areas)

str1  = sstr
str2  = cstr
SSTR  = string(sstr)
CSTR  = string(cstr)
LSTR  = string(lstr)
PSTR  = string(pstr)
LDMP  = string(ldmp)
rg=mode>0?11:20
 
b = (abs(mode)==1) ? c.removegrain(11,-1).removegrain(4,-1)
\ : (abs(mode)==2) ? c.removegrain(4,-1).removegrain(11,-1)
\ : (abs(mode)==3) ? c.removegrain(4,-1).removegrain(11,-1).removegrain(4,-1) : c
 
shrpD = mt_lutxy(c,b,"x y - abs "+LSTR+" / 1 "+PSTR+" / ^ "+SSTR+" * x y - x y - abs 0.001 + / * x y - 2 ^ x y - 2 ^ "+LDMP+" + / * 128 +")
 
shrp = (str1<0.01) ? c : c.mt_adddiff(shrpD,U=2,V=2)

shrp = (str2<0.01) ? shrp : shrp.mt_makediff(shrpD.mt_lut("x 128 - "+CSTR+" * 128 +").removegrain(rg,-1),U=2,V=2)

shrp = (xstr<0.01) ? shrp
\    : mt_lutxy(shrp,shrp.removegrain(20,-1),"x x y - 9.9 * +",U=2,V=2).repair(shrp,12,0).mergeluma(shrp,1.0-xstr)

return(shrp)
}



p.s.: i know, perhaps i've made my script unnecessarily long and complicated. can a simpler script can better this one?
any suggestion for any respect (especially for the crushed black and blown white parts )are strongly welcome, thanx in advance

Viewing all articles
Browse latest Browse all 45423

Trending Articles