View Single Post
Old 23rd July 2005, 23:39   #41  |  Link
MOmonster
Registered User
 
Join Date: May 2005
Location: Germany
Posts: 495
@yaz
I had some time to work on my functions the last night. My next just better Cdeint version Iīll offer next week. But I also created the function for your use.
So here is my motion_interpolate_deblend function:
Code:
crop(8,8,-8,-8)

ord = last.getparity() ? 1 : 0

a = tdeint(mode=1)

c = leakkernelbob(order=ord).BilinearResize(480,288)	

motion_interpolate_deblend(a, tclip=c, thresh=45)



Function motion_interpolate_deblend(clip input, clip "tclip", float "thresh") 
{
###### PREPARATION ######
e = input.selecteven()
o = input.selectodd()
tempe1 = e.MVAnalyse(isb=true, sx=4,sy=4, lambda=4000)
tempe2 = e.MVAnalyse(isb=false, sx=4,sy=4, lambda=4000)
eout = MVInterpolate(e, tempe1, tempe2, nb=1, bl=0.5, el=0.5, fbw=4).trim(1,0)
tempo1 = o.MVAnalyse(isb=true, sx=4,sy=4, lambda=4000)
tempo2 = o.MVAnalyse(isb=false, sx=4,sy=4, lambda=4000)
oout = MVInterpolate(o, tempo1, tempo2, nb=1, bl=0.5, el=0.5, fbw=4)

global intout = interleave(oout,eout)
global diffval = default(thresh,50.0)/100.0 + 1.0
global output = input
global blendclip = tclip

###### FRAMES FOR BLENDPARAMETERS ######
global frame_c0 = blendclip
global frame_c1 = blendclip.trim(1,0)
global frame_c2 = blendclip.trim(2,0)

###### VAR.. ######
global diff_c2 = 1
global btest1 = 1
global btest0 = 1

###### Conditional Function Chain, evaluated from bottom to top (!) ######
b99=scriptclip(input, "(btest0 / btestb + btest0 / btest1) < diffval ? intout : output")

b4=FrameEvaluate(b99, "global btest1 = LumaDifference(MergeLuma(frame_c0,frame_c2,blendl), frame_c1) / 
		\	(diff_c1 < diff_c2 ? diff_c1 : diff_c2)")
b3=FrameEvaluate(b4, "global blendl = diff_c1 < diff_c2 ? 0.5 * Exp(0.85 * Log(diff_c1 / diff_c2)) :
				\	1 - 0.5 * Exp(0.85 * Log(diff_c2 / diff_c1))
		global btest0 = btest1")
b2=FrameEvaluate(b3, "global diff_c2 =  YDifferenceToNext(frame_c1)
		global btestb = btest0")      
b1=FrameEvaluate(b2, "global diff_c1 = diff_c2")
return(b1) 
}
It use the newer simpler and better Cdeblend, but it doesnīt double the frames, it interpolates the motion.
I donīt like the results of mvinterpolate too much, just to blocky for my eyes. But of course better than your strange blends.
Higher thresh values mean detecting more blends (everything higher than 75 is too heavy I think).
Just try it out. I donīt tested it till now together with Cdeint, but you can try if they run together. Alone it just runs stable for me.
I hope this help you a little bit.

ps: I donīt know much about the mvtools parameter. If you want to tweak them, therefore you should ask anybody else.

Last edited by MOmonster; 26th July 2005 at 00:00.
MOmonster is offline   Reply With Quote