SharpEdge


Author V. C. Mohan
Date Sep 14, 2005

The edges derived with the options ep, es and e2 of EMarker function are not sharp enough for some applications. Combining with Laplace as done in epl and esl options can sharpen, but in many instances breaks the continuity of the boundary and so may not be satisfactory. The edges can be thinned out with one of the options of Morpher function. But the citeria used for thinning by the morpher does not depend upon the actual descriminant values.SharpEdge on the other hand finds the local maxima of the edge detection convolution. SharpEdge works on Greyscale image or luma plane only.

Test option facilitates selection of optimum parameters. In test mode the test (start)frame is repeatedly processed with varying 'lt' and 'ut' values. Window can be specified to limit processing to required part of frame and in case animation of scene permits it can be altered linearly in the given frame range.

Instead of the sharpened edges, the gradient values can be output. (this may be useful as an input to watershed plugin for limiting over segmentation).

RGB32, RGB24, YUY2 and YV12 formats are supported.
Details of parameters
Description Name Type Limits Default
Input clip clip none
Starting or test frame number to process sf integer within clip 0
End frame number to process or number of test steps ef integer within clip and not less than sf last frame-1
type of edge detection type string "ep" "es" "e2" "ep"
lower threshold at start lt integer 0 to 255 5
upper threshold at start ut integer 0 to 255 200
edge to be marked as white? white boolean true for white or false for black true
Is this a test? test boolean true for yes or false for no false
lower threshold at test end flt integer 0 to 255 100
upper threshold at test end fut integer 0 to 255 200
Process window left x at start frame lx integer within frame, less than rx 0
Process window top y at start frame ty integer within clip, less than by 0
Process window right x at start frame rx integer within clip, more than lx frame width-1
Process window bottom y at start frame by integer within frame, more than ty frame height-1
Exclude already colored areas?? xcol boolean true for yes or false for no true
value to use for marking already colored areas col integer 0 to 255 128
Process window left x at end frame elx integer within frame, less than erx lx
Process window top y at end frame ety integer within clip, less than eby ty
Process window right x at end frame erx integer within clip, more than elx rx
Process window bottom y at end frame eby integer within frame, more than ety by
Is gradient instead of edges to be output? gradient boolean true for gradient or false for edges false

Usage examples:-
#test
SharpEdge(BW,5,50,"es",test=true)
#normal process
SharpEdge(BW, 1,5,23,"ep",lt=18,ut=136,lx=224,ty=140)
SharpEdge(BW, 1,5,23,"ep", gradient=true)
To Colorit Synopsis
To my index page
down load plugin
To Avisynth