@didee
ich hab jetzt mal wie du es beschrieben hast aus der deblend- eine Verlaufsmaske gemacht und sie "verlaufsmaske.bmp" genannt.
Wenn ich jetzt das Script mit folgender Zeile:
DeLogo( 144,48, "LO", "swr", Cmix=1.0, Lmix=2.0, i=false, PP=false, name2="verlaufsmaske.bmp", amount=1 )
aufrufe, dann ist das Logo wieder astrein zu erkennen, so als ob man gar nichts dran gemacht hätte. Rufe ich das Script mit:
DeLogo( 144,48, "LO", "swr", Cmix=1.0, Lmix=2.0)
auf, zeigt das deutliche Wirkung.
Was könnte denn an erstgenanntem Scriptaufruf falsch sein?
Hier noch das DeLogo-Script, das ich verwende:
function delogo( clip clp, int Lwidth, int Lheight, string loc, string name,
\ float "Cmix", float "Lmix", string "name2", bool "i", bool "PP",float "amount")
{
name2=default(name2,"")
PP=default(PP,false)
amount=default(amount,1.0)
logomask=(name2=="")?clp:imagereader(name2).loop().trim(0,framecount(clp)).converttoyv12(matrix="PC.601")
# return logomask.histogram(mode="levels")
Lmix=default(Lmix,0.0)
Cmix=default(Cmix,0.0)
i=default(i,false)
ox=clp.width
oy=clp.height
x1 = (LeftStr(loc,1)=="L") ? 0 : ox-Lwidth
y1 = (RightStr(loc,1)=="O") ? 0 : oy-Lheight
logo = clp.crop(x1,y1,Lwidth,Lheight)
row = (x1==0) ? (y1==0) ? clp.crop(Lwidth,0,-0,Lheight) : clp.crop(Lwidth,oy-Lheight,-0,-0)
\ : (y1==0) ? clp.crop(0,0,x1,Lheight) : clp.crop(0,oy-Lheight,x1,-0)
rest = (y1==0) ? clp.crop(0,Lheight,-0,-0): clp.crop(0,0,-0,oy-Lheight)
ConvertToRGB(logo)
# log1=VD_DeLogo(false, "", "ana2.bmp", "alpha-G3.bmp", "color-G3.bmp", "repair.bmp", 1.5, 3.0, 1, 1, i).ConvertToYV12()
log1=VD_DeLogo(false, "", name+"_deblend.bmp", name+"_alpha.bmp", name+"_color.bmp", name+"_repair.bmp", 1.5, 3.0, 1, 1, i).ConvertToYV12()
log2 = (Cmix==0.0 && Lmix==0.0)
\ ? log1 : VD_DeLogo(false, "", name+"_deblend.bmp", name+"_alpha.bmp", name+"_color.bmp", name+"_repair_c.bmp", 2.5, 3.0, 1, 1, i).ConvertToYV12()
LL=string(int(round(Lmix)))
LL1=string(int(round(Lmix*100.0)))
# log1.DEdgemask(0,255,0,255,"1 1 1 1 0 1 1 1 1",U=2,V=2)
# log1.yv12convolution("1 8 28 56 76 56 28 8 1","1 8 28 56 76 56 28 8 1")
PP ? (i ? log1.yv12convolution("1 8 28 56 76 56 28 8 1","1 0 28 0 76 0 28 0 1")
\ : log1.yv12convolution("1 8 28 56 76 56 28 8 1","1 8 28 56 76 56 28 8 1") )
\ : log1
# log1.yv12convolution("1 8 28 56 76 56 28 8 1","1 0 6 0 15 0 20 0 15 0 6 0 1")
log1=Lmix<=1.0?log1:yv12lutxy(last,log1,yexpr="x y "+LL+" + > x "+LL+" - x y "+LL+" - < x "+LL+" + y ? ?",U=2,V=2)
Cmix==0.0 ? log1 : MergeChroma(log1,log2,Cmix)
Lmix==0.0 ? last
\: Lmix >1.0 ? yv12lutxy(last,log2,yexpr="x y "+LL+" + > x "+LL+" - x y "+LL+" - < x "+LL+" + y ? ?",U=2,V=2)
\: yv12lutxy(last,log2,yexpr="x 100 "+LL1+" - * y "+LL1+" * + 100 /",U=2,V=2)
# \: MergeLuma(last,log2,Lmix) ## -->"Access violation" ... yippieh ... müsse mache yv12lutxy ...
# PP?yv12convolution("1 8 28 56 76 56 28 8 1","1 0 28 0 76 0 28 0 1",U=2,V=2):last
PP?(i?separatefields.Removegrain(2).weave:removegrain(2)):last
PP?temporalsoften(2,11,11,23,2).AddGrain(5,.0,.0):last
# PP?repair(last.sharpen(1),last,mode=1,modeU=3):last
name2==""?last:maskedmerge(logo,last,logomask.FitY2UV(),Y=3,U=3,V=3)
row2 = (x1==0) ? stackhorizontal(last,row) : stackhorizontal(row,last)
y1==0 ? stackvertical( row2,rest) : stackvertical( rest,row2)
return last
}
Gruß, Punchy