Log in

View Full Version : Help Error contrasharpening


terminator3
19th March 2021, 01:52
good when I code this script, whatever program it is, it gives me this error:

error: Script error: There is no function named 'contrasharpening'.
















MPEG2Source("F:\xxx (C)\04.d2v")





##################
# DESENTRELAZADO # Si no esta entrelazado esta parte no seria necesaria
##################

QTGMC( Preset="medium", fpsdivisor=2)
ConvertToYV12()


crop(14, 6, -8, 0)
Spline36Resize(704, 528)



##################
# FILTRADO #
##################

original=last

prefiltrado= dfttest(sigma=12,tbsize=1)

mascara=prefiltrado.mt_edge(mode="laplace",U=3,V=3)#.mt_deflate(U=3,V=3)

#return mascara




super=Msuper(prefiltrado)

backward_vec3 = MAnalyse(super, isb = true, delta = 3, overlap=4)
backward_vec2 = MAnalyse(super, isb = true, delta = 2, overlap=4)
backward_vec1 = MAnalyse(super, isb = true, delta = 1, overlap=4)

forward_vec1 = MAnalyse(super, isb = false, delta = 1, overlap=4)
forward_vec2 = MAnalyse(super, isb = false, delta = 2, overlap=4)
forward_vec3 = MAnalyse(super, isb = false, delta = 3, overlap=4)

prefiltrado.MDegrain3(super,backward_vec1,forward_vec1,backward_vec2,forward_vec2,backward_vec3,forward_vec3,thSAD=500)

mt_merge(last, prefiltrado, mascara)

contrasharpening(last, original)

gradfun3()

StainlessS
19th March 2021, 04:12
I found this [forum search], presume is the one you are looking for [Bottom of first post].- https://forum.doom9.org/showthread.php?p=1336882#post1336882


FUNCTION ContraSharpening(clip denoised, clip original)
{
# contra-sharpening: sharpen the denoised clip, but don't add more to any pixel than what was removed previously.
# script function from Didee from the VERY GRAINY thread
s = denoised.minblur(1,1) # Damp down remaining spots of the denoised clip.
allD = mt_makediff(original,denoised) # The difference achieved by the denoising.
ssD = mt_makediff(s,s.removegrain(11,-1)) # The difference of a simple kernel blur.
ssDD = ssD.repair(allD,1) # Limit the difference to the max of what the denoising removed locally.
ssDD = SSDD.mt_lutxy(ssD,"x 128 - abs y 128 - abs < x y ?") # abs(diff) after limiting may not be bigger than before.

denoised.mt_adddiff(ssDD,U=2,V=2) # Apply the limited difference. (Sharpening is just inverse blurring.)

RETURN (last)
}


EDIT: Here seems to be original Didee script before script function encapsulation:- https://forum.doom9.org/showthread.php?p=1076491#post1076491