Log in

View Full Version : RT_LumaCorrelation


gwendolien
19th May 2018, 15:46
Trying to use RT_LumaCorrelation I 'm getting the error"
"invalid arguments to GScriptClip

VHS_part=VHS.Crop(2*[<"X0", 0, 10, 1>], 2*[<"Y0", 0, 10, 1>], -10, -10).ConvertToYV12

corr=GScriptClip("""RT_LumaCorrelation(VHS_part, DV, n=current_frame, delta=0, x=[<"X_pos",0,10,0>], y==[<"Y_pos",0,10,0>], w=0, h=0, n2=current_frame, delta2=0, Matrix=(Width>=720?2:3))
""")
return VHS_part.Subtitle("corr = "+String(corr))

VHS_part and DV both are YV12, different sizes

Could somebody please help me out?

StainlessS
20th May 2018, 08:11
Below looks like it is roughly what you are trying to do,


VHS=ColorBars.KillAudio

X=0 # 2*[<"X0", 0, 10, 1>] ### No idea what this is supposed to be
Y=0 # 2*[<"Y0", 0, 10, 1>] ### Same again
W=-10
H=-10

X_pos = 0 # [<"X_pos",0,10,0>] ### ???
Y_pos = 0 # y==[<"Y_pos",0,10,0>] ### ???
W_pos = 0 #
H_pos = 0 #

VHS_part=VHS.Crop(X,Y,W,H).ConvertToYV12

DV=VHS_part ### give something to DV

Matrix = VHS.Width>=720?3:2 ### Matrix: Conversion matrix for conversion RGB->YUV-Y Luma.
### 0=REC601 : 1=REC709 : 2 = PC601 : 3 = PC709,
### Default, (Width > 1100 OR Height>600) then 3(PC709) else 2(PC601). YUV not used


SSS="""
n=current_frame
corr=RT_LumaCorrelation(Last,DV,n=n,n2=n ,x=X_Pos,y=Y_pos,w=W_Pos,h=H_Pos) ### ,Matrix=Matrix)
return Subtitle(String(corr,"core = %.3f"))
"""

Return VHS_part.ScriptClip(SSS)


We have just assigned VHS_part to DV, so will always show 1.0 here.

VHS_part and DV both are YV12, different sizes
what sizes and coords required ?

gwendolien
20th May 2018, 11:18
THANKS, StainleSss.
I got completely lost in even putting the problem the right way.
Apologies for the inconvenience.
I realize I have to get both clips first to the same scale before attacking the mutual alignment problems.