steptoe
14th January 2014, 11:58
Basically, I'm trying to convert LRemoveDust_YV12 to something similar that happens with RemoveDirtMC
LRemoveDust doesn't really touch spots/scratches where RemoveDirtMC does, but I'm trying to get the speed of LRemoveDust with the work of RemoveDirtMC
I just can't get my head around using the previous and next frame and then interleave these to reduce the grain and reduce the dirt, with the ability to choose the strength of dirt to remove and also choose the option of grain mode. So, in effect its reducing the grain and reducing the dirt
Did that make any sense ?
Merging these two scripts together to get the best of both ....
RemoveDirtMC
function RemoveDirt(clip input, int limit, bool _grey)
{
clensed=input.Clense(grey=_grey, cache=8)
alt=input.RemoveGrain(2)
return RestoreMotionBlocks(clensed,input,alternative=alt,pthreshold=2,cthreshold=8, gmthreshold=40,dist=4,dmode=2,debug=false,noise=limit,noisy=12,grey=_grey)
}
function RemoveDirtMC(clip,int limit, bool "_grey")
{
_grey=default(_grey, false)
limit = default(limit,6)
bvec = clip.MVAnalyse(isb=false, blksize=16, delta=1, pel=2, truemotion=true, idx=1)
fvec = clip.MVAnalyse(isb=true, blksize=16, delta=1, pel=2, truemotion=true, idx=1)
backw = clip.MVFlow(bvec)
forw = clip.MVFlow(fvec)
clp=interleave(backw,clip,forw)
clp=clp.RemoveDirt(limit,_grey)
clp=clp.SelectEvery(3,1)
return clp
}
LRemoveDust
function LRemoveDust(clip input, int _mode, int "limit")
{
limit = default(limit,4)
LL = string(limit)
STR = "x "+LL+" + y < y "+LL+" - x "+LL+" - y > y "+LL+" + x ? ?"
repmode = 2
clensed = Clense(input)
rep = Repair(clensed, input, mode=repmode)
rg = RemoveGrain(rep, mode=_mode)
trep = TemporalRepair(rg, rep)
trep2 = isyuy2(input)
\ ? trep.converttoyv12()
\ : trep
input2 = isyuy2(input)
\ ? input.converttoyv12()
\ : input
limit!=0 ? yv12lutxy(trep2,input2,yexpr=STR,U=2,V=2) : last
out = isyuy2(input)
\ ? last.converttoyuy2().mergechroma(trep)
\ : last
return out
}
I know one uses MVTools and the other uses masktools. But can it be done so they both work together
LRemoveDust doesn't really touch spots/scratches where RemoveDirtMC does, but I'm trying to get the speed of LRemoveDust with the work of RemoveDirtMC
I just can't get my head around using the previous and next frame and then interleave these to reduce the grain and reduce the dirt, with the ability to choose the strength of dirt to remove and also choose the option of grain mode. So, in effect its reducing the grain and reducing the dirt
Did that make any sense ?
Merging these two scripts together to get the best of both ....
RemoveDirtMC
function RemoveDirt(clip input, int limit, bool _grey)
{
clensed=input.Clense(grey=_grey, cache=8)
alt=input.RemoveGrain(2)
return RestoreMotionBlocks(clensed,input,alternative=alt,pthreshold=2,cthreshold=8, gmthreshold=40,dist=4,dmode=2,debug=false,noise=limit,noisy=12,grey=_grey)
}
function RemoveDirtMC(clip,int limit, bool "_grey")
{
_grey=default(_grey, false)
limit = default(limit,6)
bvec = clip.MVAnalyse(isb=false, blksize=16, delta=1, pel=2, truemotion=true, idx=1)
fvec = clip.MVAnalyse(isb=true, blksize=16, delta=1, pel=2, truemotion=true, idx=1)
backw = clip.MVFlow(bvec)
forw = clip.MVFlow(fvec)
clp=interleave(backw,clip,forw)
clp=clp.RemoveDirt(limit,_grey)
clp=clp.SelectEvery(3,1)
return clp
}
LRemoveDust
function LRemoveDust(clip input, int _mode, int "limit")
{
limit = default(limit,4)
LL = string(limit)
STR = "x "+LL+" + y < y "+LL+" - x "+LL+" - y > y "+LL+" + x ? ?"
repmode = 2
clensed = Clense(input)
rep = Repair(clensed, input, mode=repmode)
rg = RemoveGrain(rep, mode=_mode)
trep = TemporalRepair(rg, rep)
trep2 = isyuy2(input)
\ ? trep.converttoyv12()
\ : trep
input2 = isyuy2(input)
\ ? input.converttoyv12()
\ : input
limit!=0 ? yv12lutxy(trep2,input2,yexpr=STR,U=2,V=2) : last
out = isyuy2(input)
\ ? last.converttoyuy2().mergechroma(trep)
\ : last
return out
}
I know one uses MVTools and the other uses masktools. But can it be done so they both work together