Log in

View Full Version : recalculate Msuper after MDegrain3?


franketto
28th June 2014, 09:53
I make a denoise with MDegrain3 and after it I want to remove scratches using the vectors just calculated, like this:


super = MSuper(source, hpad=32, vpad=32,pel=2)
bks = 8
ov = 4
bvec3 = MAnalyse(super, isb=true, blksize=bks, delta=3, overlap=ov)
bvec2 = MAnalyse(super, isb=true, blksize=bks, delta=2, overlap=ov)
bvec = MAnalyse(super, isb=true, blksize=bks, delta=1, overlap=ov)
fvec = MAnalyse(super, isb=false, blksize=bks, delta=1, overlap=ov)
fvec2 = MAnalyse(super, isb=false, blksize=bks, delta=2, overlap=ov)
fvec3 = MAnalyse(super, isb=false, blksize=bks, delta=3, overlap=ov)

clp = source.MDegrain3(super,bvec,fvec,bvec2,fvec2,bvec3,fvec3,thSAD=400)

# HERE, after Mdegrain3 should Msuper be remaked? super = MSuper(clp, hpad=32, vpad=32,pel=2)

backw = MCompensate(clp, super, bvec)
forw = MCompensate(clp, super, fvec)
backw2 = MCompensate(clp, super, bvec2)
forw2 = MCompensate(clp, super, fvec2)
backw3 = MCompensate(clp, super, bvec3)
forw3 = MCompensate(clp, super, fvec3)

#removeDirt:
_grey = false
limit =30
clipa = interleave(backw3, backw2, backw, clp, forw, forw2, forw3)
clipb1 = RemoveDirtJ(clipa,limit, _grey)
V1 = SelectEvery(clipb1, 7, 3)



Should I redo Msuper just after the Mdegrain3, before Mcompensate? As the vectors are the same from Manalyse, but the clip is the one denoised.

fvisagie
28th June 2014, 15:04
It's for scenarios like this that MRecalculate() was provided, to refine motion vectors (possibly using smaller blocks) to capture fine motion detail, edges and more complex motion. As to whether you should insert this step at all, perhaps compare with and without. In that case you might as well compare results with a second MSuper() instead.

Cheers,
Francois

Bloax
28th June 2014, 15:29
To keep the MDegrain3 results for additional MVTools2 processing you would have to make another Super clip from the MDegrain3 results, yes.
super = MSuper(source, hpad=32, vpad=32,pel=2)
bks = 8
ov = 4
bvec3 = MAnalyse(super, isb=true, blksize=bks, delta=3, overlap=ov)
bvec2 = MAnalyse(super, isb=true, blksize=bks, delta=2, overlap=ov)
bvec = MAnalyse(super, isb=true, blksize=bks, delta=1, overlap=ov)
fvec = MAnalyse(super, isb=false, blksize=bks, delta=1, overlap=ov)
fvec2 = MAnalyse(super, isb=false, blksize=bks, delta=2, overlap=ov)
fvec3 = MAnalyse(super, isb=false, blksize=bks, delta=3, overlap=ov)

clp = source.MDegrain3(super,bvec,fvec,bvec2,fvec2,bvec3,fvec3,thSAD=400)

# HERE, after Mdegrain3 should Msuper be remaked?
# Yes it should:
super2= MSuper(clp, hpad=32, vpad=32,pel=2)

backw = MCompensate(clp, super2, bvec)
forw = MCompensate(clp, super2, fvec)
backw2 = MCompensate(clp, super2, bvec2)
forw2 = MCompensate(clp, super2, fvec2)
backw3 = MCompensate(clp, super2, bvec3)
forw3 = MCompensate(clp, super2, fvec3)

franketto
28th June 2014, 19:55
Thank you.
Now I 'll do the extra MSuper.

But I tried also without and the result seems good anyway. It's not easy to see well the difference, because it's removing scratches and in fact it removes them but probably the edges aren't perfect because it refers to the clip before Mdegrain3.