pinterf / masktools

MaskTools v2 fork
Other
46 stars 11 forks source link

mt_expand : filler value parameter should be <=0 for chroma #9

Closed TbtBI closed 4 years ago

TbtBI commented 4 years ago

Hi, I have error "mt_expand : filler value parameter should be <=0 for chroma" when I use this script and masktools2 >2.2.12. Avisynth+ 3.4 used. Same behavior for both x86 and x64. Plugins required by the script - GRunT, RT_Stats, CallCmd. Image - https://i.vgy.me/jlS191.png

Import("DetectSub_MI_.avsi")
X        = 400
Y        = 550
W        = 1150
H        = 180

ImageSource("jlS191.png",end=0).ConvertToYV12

#return Overlay(Last.BlankClip(width=w,Height=h),x=x,y=y,opacity=0.3)

TEXTCOL   = $FAFAFA
TEXTVAR   = 5                             # Text RGB channels can vary by as much as TEXTVAR, eg $FEFEFE with TEXTVAR=1 ranges $FDFDFD -> $FFFFFF
HALOCOL   = $080808
HALOVAR   = 8                             # Halo RGB channels can vary by as much as HALOVAR, eg $FEFEFE with HALOVAR=1 ranges $FDFDFD -> $FFFFFF
TEXT_W    = 5                             # minimum text pixel 'thickness' Horizontal (horizontal thickness of vertical strokes)
TEXT_H    = 5                             # minimum text pixel 'thickness' Vertical (vertical thickness of horizontal strokes)
HALO_L    = 4                             # Left Halo width in pixels
HALO_R    = 4                             # Right Halo width in pixels
HALO_T    = 4                             # Top Halo height in pixels
HALO_B    = 4                             # Bot Halo height in pixels
THYSCNT   = 0                             # Text Mask Mt_Hysteresis inpand count (prior to mt_hysteresis), Dont Mt_Hysteresis if 0
HHYSCNT   = 0                             # Halo Mask Mt_Hysteresis inpand count (prior to mt_hysteresis), Dont Mt_Hysteresis if 0
DHYSCNT   = 0                             # Detect clip Mt_Hysteresis inpand count (prior to mt_hysteresis), Dont Mt_Hysteresis if 0
THRESH_W  = -8                            # -ve, specifies Abs(Pixel width)  {Else +ve = Percent width 0.0->100.0%) {0.0=any pixel in range)
THRESH_H  = -8                            # -ve, specifies Abs(Pixel Height) {Else +ve = Percent width 0.0->100.0%) {0.0=any pixel in range)
BAFFLE_W  = 10                            # Width of outermost Vertical edges.
BAFFLE_H  = 10                            # Height of outermost Horizontal edges.
RESCAN    = true                          # Switching on might get rid of the odd stray pixel (most likely not, was already pretty good, suggest always on).
SHOW      = true                          # Show metrics.
AREACOLOR = $8040FF                       # Subtitle area marker color
SHOWAREA  = true                          # Set True to mark subtitle scan area.  (Show=False:No Effect)
STACK     = 2                             # 0=Movie, 1=Movie + detection clip, 2=Movie  detection clip + Text and Halo Mask clips. (Show=False:No Effect)
SHOWINPAND =true                        # Show Mt_Inpand masks without doing Mt_Hysteresis, ie for THysCnt, HHysCnt, DHysCnt. (Show=False:No Effect)
DB        = "MyDB.DB"                     # If Named, then DB not deleted on exit. (Maybe DBase used by other scripts later)
DEBUG     = false                         # To DebugView (Google). RT_ v2.00 beta02 extends RT_YInRangeLocate() debug info a little.
OverRide  = ""                            # ""=Not used, "*..." multiline string of ranges, "OverRide.txt"=Text file of ranges.

DetectSub_MI(Last,Override=Override,
    \ x=X,y=Y,w=W,h=H,
    \ Text_w=TEXT_W,Text_h=TEXT_H,TextCol=TEXTCOL,TextVar=TEXTVAR,
    \ Halo_L=HALO_L,Halo_T=HALO_T,Halo_R=HALO_R,Halo_B=HALO_B,HaloCol=HALOCOL,HaloVar=HALOVAR,
    \ THysCnt=THYSCNT,HHysCnt=HHYSCNT,DHysCnt=DHYSCNT,ShowInPand=SHOWINPAND,
    \ Baffle_w=BAFFLE_W,Baffle_h=BAFFLE_H,Thresh_w=THRESH_W,Thresh_h=THRESH_H,ReScan=RESCAN,
    \ Show=SHOW,stack=STACK,ShowArea=SHOWAREA,AreaColor=AREACOLOR,db=DB,Debug=DEBUG)
pinterf commented 4 years ago

The error message is appropriate. In the script I can see mt_expand with parameter chroma="1" which is invalid. Allowed chroma parameters are (http://avisynth.nl/index.php/MaskTools2):

"none" or "ignore" : set u = v = 1. Since 2.2.9-
"process" : set u = v = 3.
"copy" or "copy first" : set u = v = 2.
"copy second" : set u = v = 4.
"copy third" : set u = v = 5.
"copy fourth" : set u = v = 6. Since v2.2.7
"xxx", where xxx is a number : set u = v = -xxx. 
pinterf commented 4 years ago

Probably either the description or the implementation is wrong Namely this line: "xxx", where xxx is a number : set u = v = -xxx. Correct one: "xxx", where xxx is a negative number : fills both u and v plane content (and not parameters) to -xxx (same as used for u and v parameters). I suppose the script didn't want to set u and v plane content to 1. Probably it aimed to not process chroma so those parameters should be: chroma="none" or chroma="ignore". Maybe the script was prepared not for masktools2 but for an earlier implementation?

TbtBI commented 4 years ago

The script is from 2016. https://forum.doom9.org/showthread.php?p=1782036#post1782036 Here a doom9 user used it and I wanted to try it. But using masktools 2.20@2a0cc98 that error appeared.

Thanks for you time. Regards.