View Single Post
Old 6th February 2020, 19:02   #89  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
RoboCrop v1.12, update, see first post.

Added ScanPerc, allows detect when image is wholly one or other side of clip center.
Code:
Function RoboCrop(clip c,int "Samples"=40,Float "Thresh"=-40.0,bool "Laced"=true,int "WMod",int "HMod",int "RLBT"=15,bool "Debug"=false, \
    float "Ignore"=0.4,int "Matrix"=(c.Width>1100||c.Height>600?3:2), int "Baffle"=4, bool "ScaleAutoThreshRGB"=true,
    bool "ScaleAutoThreshYUV"=false, int "CropMode"=2,bool "Blank"=false,bool "BlankPC"=false,bool "Align"=True,bool "Show"=false, \
    String "LogFn"="",bool "LogAppend"=false, Float "ATM"=4.0,int "Start"=Undefined,Int "End"=Undefined, \
    Int "LeftAdd"=0,Int "TopAdd"=0,Int "RightAdd"=0,Int "BotAdd"=0, \
    Int "LeftSkip"=0,Int "TopSkip"=0,Int "RightSkip"=0,Int "BotSkip"=0 \
    Float "ScanPerc=49.0 )
Code:
    Float ScanPerc, Default 49.0, Range 1.0->99.0. Precentage of clip dimensions to scan for border edges.
      Default 49.0%, Starts scan from nearly the middle of frame to outer edge of frame looking for borders.
      Specialist use, might use eg 99.0% when image wholly to one of other side of the middle of frame.
      eg, when 99.0, starts scan for TOP edge at nearly bottom of frame, scanning upwards.
                     starts scan for BOT edge at nearly top of frame, scanning downwards.
                     starts scan for LFT edge at nearly RHS of frame, scanning leftwards.
                     starts scan for RGT edge at nearly LHS of frame, scanning rightwards.

Code:
BlankClip(width=1024,height=768,Pixel_type="YV12").trim(0,-1)
W=Last.BlankClip(width=320,height=240,color=$FF00FF)
OverLay(W,x=680,y=416)
RoboCrop(Samples=1,debug=true,ScanPerc=99,show=true)
Return Last#.info
ScanPerc=99.0 [Show=True]


Show=true [from old version 1.06]

Show=true [from old version 1.10]

Bottom image above: Left edge, single dots line, other edges a bit wiggly ie cropping moved inwards [CROPMORE] to adhere to X/Y/W/H Mod requirements.

EDIT: AutoCrop() fails badly [with defaults] on a 10 mins clip surrounding above frame from Cabaret. [chops off half of frame, not much image left]
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 6th February 2020 at 22:56.
StainlessS is offline   Reply With Quote