Log in

View Full Version : mvtools-how make a vertical mask


Terka
19th December 2007, 14:46
Please help with following:
Tried to select parts with deinterlace artefacts (FLICKER) using mvtools. But im not able to select them sucessfully. Could someone give me an advice? The idea what i want to do is visible in following script. Thank you, Terka

source avi:
http://www.pate15.de/entrelacement/page_5/anim/stockholm-mvbobmod.avi


PluginPath = "C:\Program Files\AviSynth\plugins\"
LoadPlugin(pluginpath+"mvtools.dll")
orig=avisource("c:\stockholm-mvbobmod.avi")

input=orig.DuplicateLastFrame()

Odd=input.SelectOdd()
Even=input.SelectEven()


OddNew=Even.DoubleFramerate().SelectOdd()


final=Interleave(Even,Oddnew)
comp=Interleave(Odd,Oddnew)

# todo compare Oddnew with Odd and get parts with vertical movement with
# lenght 1 or 2 pixel. Then take the masked parts from Oddnew, rest from Odd.
# tried following (see below) but not much sucessful

source=comp
vectors = source.MVAnalyse(isb = true, truemotion=true, pel=2, idx=1,search=3)
o=source.MVMask(kind=4,vectors)
StackHorizontal(o, orig) #to see if the mask is suitable

function DoubleFramerate (clip c)
{
#To double fps with MVFlowFps for 'best' results (but slower processing):
backward_vec = c.MVAnalyse( isb = true, pel=2, search=3, idx=1) #pel 2 +-ok pel 1 rozmazne
forward_vec = c.MVAnalyse( isb = false, pel=2, search=3, idx=1)
c.MVFlowFps(backward_vec, forward_vec, num=2*FramerateNumerator(c), den=FramerateDenominator(c), idx=1)
}

function DuplicateLastFrame (clip c)
{
DuplicateFrame(c,Framecount(c))
}

Terka
20th December 2007, 11:53
The file is 320kB small.
Could anyone give me an advice how to correct the script above?:thanks:

Terka
26th December 2007, 12:30
have 2 sources
1st original
2nd with some pixels moved up (in comparation to original)
and some artifacts
want to select the pixels moved up (by 1 or 2 pixels)
can this be done?

Terka
2nd January 2008, 17:59
in my mask some green parts appears, nothing useful. could someone help please?

Didée
2nd January 2008, 19:37
Why "nothing useful"? The masks of MVMask() contain the same information in luma and chroma channels. The colors might seem strange, but it's correct that way. For verification if your masking is similar to what you want, just use greyscale() on the mask.