Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. Domains: forum.doom9.org / forum.doom9.net / forum.doom9.se |
|
|||||||
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
|
#142 | Link |
|
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 11,406
|
RT_Stats v1.18, New version.
v1.18, Fixed RT_QueryBorderCrop RGB "Matrix NOT @ PC levels - Check!" bug. Added RT_ColorSpaceXMod/YMod. Added RT_RgbChan family. Added v2.6 dll Stuff added: Code:
RT_ColorSpaceXMod(clip)
Return int, the natural cropping XMod for clip colorspace, eg YV411=4, YV12=2, YUY2=2, RGB=1
v2.5 plugin limited to v2.58 colorspaces.
RT_ColorSpaceYMod(clip,bool "Laced"=true)
Return int, the natural cropping YMod for clip colorspace, eg YV411=1, YV12=2, YUY2=1, RGB=1
Laced, bool. Default true. If Laced==true, returns doubled YMod.
v2.5 plugin limited to v2.58 colorspaces.
RT_RgbChanMin(clip,int "n"=current_frame,int "delta"=0,int "x"=0,int "y"=0,int "w"=0,int "h"=0,bool "interlaced"=false,
float "threshold"=0.0,int "chan"=0)
Returns int minimum value (0 -> 255) for an RGB channel in frame(n+delta) for area x,y,w,h. (RGB 24/32).
(chan default = 0 = R [RGBA]). Threshold is a percentage, stating how many percent of the pixels are allowed below minimum.
The threshold is optional and defaults to 0.0
***
***
***
RT_RgbChanMax(clip,int "n"=current_frame,int "delta"=0,int "x"=0,int "y"=0,int "w"=0,int "h"=0,bool "interlaced"=false,
float "threshold"=0.0,int "chan"=0)
Returns int maximum value (0 -> 255) for an RGB channel in frame(n+delta) for area x,y,w,h. (RGB 24/32).
(chan default = 0 = R [RGBA]). Threshold is a percentage, stating how many percent of the pixels are allowed below minimum.
The threshold is optional and defaults to 0.0
***
***
***
RT_RgbChanMinMaxDifference(clip,int "n"=current_frame,int "delta"=0,int "x"=0,int "y"=0,int "w"=0,int "h"=0,
bool "interlaced"=false,float "threshold"=0.0,int "chan"=0)
Returns int value range maximum - minimum difference (0 -> 255) for an RGB channel in frame(n+delta) for area x,y,w,h. (RGB 24/32).
(chan default = 0 = R [RGBA]). Threshold is a percentage, stating how many percent of the pixels are allowed below minimum.
The threshold is optional and defaults to 0.0
***
***
***
RT_RgbChanMedian(clip,int "n"=current_frame,int "delta"=0,int "x"=0,int "y"=0,int "w"=0,int "h"=0,bool "interlaced"=false,int "chan"=0)
Return the int channel median (0 -> 255) for an RGB channel in frame(n+delta) for area x,y,w,h. (RGB 24/32).
(chan default = 0 = R [RGBA])
***
***
***
RT_RgbChanAve(clip,int "n"=current_frame,int "delta"=0,int "x"=0,int "y"=0,int "w"=0, int "h"=0,bool "interlaced"=false,int "chan"=0)
Return the float average value (0.0 -> 255.0) for an RGB channel in frame(n+delta) for area x,y,w,h. (RGB 24/32).
(chan default = 0 = R [RGBA])
***
***
***
RT_RgbChanStdev(clip,int "n"=current_frame,int "delta"=0,int "x"=0,int "y"=0,int "w"=0,int "h"=0,bool "interlaced"=false,int "chan"=0)
Returns FLOAT value Standard Deviation (0.0 -> 255.0) for an RGB channel in frame(n+delta) for area x,y,w,h.
Sample standard deviation http://en.wikipedia.org/wiki/Standard_deviation
(chan default = 0 = R [RGBA])
***
***
***
RT_RgbChanInRange(clip,int "n"=current_frame,int "delta"=0,int "x"=0,int "y"=0,int "w"=0,int "h"=0,bool "interlaced"=false,int "chan"=0,
int "lo"=128,int "hi"=lo)
Returns float value (0.0 -> 1.0) being the amount of pixels with a channel value in the range "lo" to "hi" (inclusive), 1.0 is
equivalent to 100%. NOTE, differs from other funcs that return range 0.0 to 255.0. NOTE, lo defaults to 128, "hi" defaults to "lo".
(chan default = 0 = R [RGBA])
***
***
***
RT_RgbChanStats(clip,int "n"=current_frame,int "delta"=0,int "x"=0,int "y"=0,int "w"=0,int "h"=0,bool "interlaced"=false,
float "threshold"=0.0,int "chan"=0,int "lo"=128,int "hi"=lo,int "flgs"=127,string "prefix"="RCS_")
Returns multiple results as for above single frame RGB sampling functions as Global Variables (prefixed with the prefix string arg).
The args up to "interlaced", and "chan", are as for all other RGB clip functions, "threshold" used only for "RT_RgbChanMin",
"RT_RgbChanMax" and "RT_RgbChanMinMaxDifference" equivalent routines with same functionality.
"lo" and "hi" are used only with the "RT_RgbChanInRange" equivalent routine with same functionality.
The only new args are int "Flgs" which selects which results you want returned and the string "Prefix" that is prepended
to the returned global variable names.
The actual return result is a copy of the flgs args with any non valid bits reset, ie the global variables that were set.
Global variables are NOT altered for any function not selected in flgs.
Flgs_Bit_Number Add_To_Flgs Equivalent_Function Global_Var_Set_Excluding_Prefix(Where 'x' is channel number)
0 1($01) RT_RgbChanMin() "Min_x" (0->255)
1 2($02) RT_RgbChanMax() "Max_x" (0->255)
2 4($04) RT_RgbChanMinMaxDifference() "MinMaxDiff_x" (0->255)
3 8($08) RT_RgbChanMedian() "Med_x" (0->255)
4 16($10) RT_RgbChanAve() "Ave_x" (0.0->255.0)
5 32($20) RT_RgbChanStdev() "Stdev_x" (0.0->255.0)
6 64($40) RT_RgbChanInRange() "InRng_x" (0.0->1.0)
RT_RgbChanStats() allows you to inquire multiple results simultaneously, with not much more overhead than calling a single individual
routine, however, you should not select sub functions that you dont need as there may be an additional unnecessary overhead.
The Default flgs=127($7F) are all bits set and so sets ALL global vars at once.
RT_RgbChanStats(chan=0,flgs=1+2+16) would set global vars "RCS_Min_0", "RCS_Max_0" and "RCS_Ave_0" for full frame current_frame.
__________________
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; 17th June 2013 at 17:24. |
|
|
|
|
|
#143 | Link |
|
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 11,406
|
New version RT_Stats v1.19, see 1st post.
Code:
v1.19, RT_LumaSceneChange() moved cap @ 255.0 to just before return instead of on Lut, better metrics.
Originally like:- mt_lutxy(mt_polish("((x-y)/4)^2")).AverageLuma() where was capped @ 255 @ equivalent mt_lutxy step.
Changed RT_QueryBorderCrop() Thresh Massaging.
__________________
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 ??? |
|
|
|
|
|
#144 | Link |
|
Registered User
Join Date: Apr 2008
Location: California, USA
Posts: 127
|
How can I use RT-Stats to return the 6 character RGB (or 8 character RGBa) value of one user specified pixel on one specified frame in RGB-24 (or RGB-32) color space?
EDIT: RT_RgbChanMedian did the trick one channel at a time.
Last edited by Forensic; 27th June 2013 at 05:56. Reason: Self-resolved |
|
|
|
|
|
#145 | Link | |
|
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 11,406
|
Forensic, glad you got it sorted.
Min, max, median and average should all return identical results for a single pixel. EDIT: this should also be able to do it in a single call although for RGB32 could return a -ve int. Code:
RT_RGB32AsInt(clip,int "n"=current_frame,int "delta"=0,int "x"=0,int "y"=0) Compile/Runtime clip function. Given an RGB32 clip that had a pixel value created from an Int, gets that pixel and returns as the original Int. By creating single pixel clips and stacking them horizontally/vertically, you can use a frame as a two dimensional array of Int, perhaps use the frame number for a third dimension. Quote:
int to hex RT_Hex(int , width=8) Or RT_NumberString(int ,base=16, int width=8) v2.58 has bug in Hex function for -ve numbers.
__________________
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; 27th June 2013 at 15:59. |
|
|
|
|
|
|
#146 | Link |
|
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 11,406
|
RT_Stats v1.20, new version.
Changed the way RT_LumaSceneChange works. Added Bias->Pord args. Added RT_Subtitle(), Added RT_LumaSceneChange_Graffer with vb source. Mod: Code:
RT_LumaSceneChange(clip,clip2,int "n"=current_frame,int "delta"=0,int "x"=0,int "y"=0,int "w"=0,int "h"=0,
int "n2"=current_frame,int "delta2"=0,int "x2"=x,int "y2"=y,bool "interlaced"=false,int "Matrix"=(width<=720?2:3), \
Float "Bias"=0.0,Float "Gain"=1.0,Float "Cont"=1.0,Float "Rpow"=1.0,Float "Spow"=1.0,Float "SPMid"=0.5,Bool "Pord"=false)
Returns FLOAT value (0.0 -> 255.0) scene change detection between clip frame (n+delta) area x,y,w,h, and clip2 frame (n2+delta2) area x2,y2,w,h.
Note, 'x2' and 'y2' default to 'x' and 'y' respectively.
v1.20, Modified how it works. Creates a look up table (lut) which is used for the pixel differences between same pixel in frames
(n+delta) and (n+delta2). The lut is created using args "Bias" through to "Pord" and a sort of levels type internal function
creates the lut. An absolute pixel difference is taken between corresponding pixels and then the contents of the lut for that difference is
added to the sum of differences, and finally the average is taken. Is sort of like mt_lutxy("x y - abs").Lut().AverageLuma()
Additional Args:
Bias, Default 0.0, (-512 -> 512). Equivalent to Bias in RGBAdjust(), ie brightness.
Gain, Default 1.0, (-8.0 -> 8.0). Equivalent to Gain in RGBAdjust(), varies slope.
Cont, Default 1.0, (-8.0 -> 8.0). Contrast. A bit like Cont in ColorYUV.
RPow, Default 1.0, (0.1 -> 4.0). Similar to Gamma.
SPow, Default 1.0, (0.1 -> 4.0). S shaped power curve.
SPMid,Default 0.5, (0.01 -> 0.99). Mid point control for SPow.
Pord, Default False (False -> True). Governs which power function is applied first. False (default) applies RPow 1st,
True Applies SPow 1st. Only applies if both power functions not at default 1.0.
All Defaults for lut creation are linear and will be equivalent to RT_LumaDifference(). As currently implemented, may provide
alternative functionality other than scene change detection, but no idea what those applications could be.
A graphing program with VB source is provided in the zip, so you can play with sliders to choose function args.
Func versions previous to v1.20, used args similar to:- gain=4.0,rpow=0.5 with remaining args at default.
The old default, gave less prominence to big differences so that a few pixels with massive difference were limited in
the overall effect on results. New args produce a linear LUT by default.
Scene change metric between current frame and next frame, whilst ignoring 32 pixels of crud at bottom:-
SC = RT_LumaSceneChange(Last,Last,delta2=1,h=-32)
and exactly the same thing again:
SC = RT_LumaSceneChange(Last,Last,n2=current_frame+1,h=-32)
There are two arg clips for flexibility, might usually both be same, but might want to measure against two separate clips and so
implemented as above.
Scene change detection between current frame top field and bottom field, whilst ignoring 32 pixels of crud at bottom:-
SC = RT_LumaSceneChange(Last,Last,y2=1,interlaced=true,h=-32) # Expect higher metrics here.
***
***
***
RT_LumaMovement(clip,clip2,int "n"=current_frame,int "delta"=0,int "x"=0,int "y"=0,int "w"=0,int "h"=0,
int "n2"=current_frame,int "delta2"=0,int "x2"=x,int "y2"=y,bool "interlaced"=false,int "Matrix"=(width<=720?2:3),
int "Mode"=0,int "BlkW"=64,int "BlkH"=64 \
Float "Bias"=0.0,Float "Gain"=1.0,Float "Cont"=1.0,Float "Rpow"=1.0,Float "Spow"=1.0,Float "SPMid",Bool "Pord"=false)
Returns FLOAT value (0.0 -> 255.0) movement detection between clip frame (n+delta) area x,y,w,h, and clip2 frame (n2+delta2) area x2,y2,w,h.
Note, 'x2' and 'y2' default to 'x' and 'y' respectively.
There are two modes available, 0 (Default) = RT_LumaDifference() : 1 = RT_LumaSceneChange().
BLKW/BLKH (default 64), Block size. Minimum 8 (silently limited to frame dimensions), Must be EVEN.
RT_LumaMovement() splits the frames into block sized lumps and calls the desired mode RT_LumaDifference or RT_LumaSceneChange
function to get a metric for each of those blocks. The metric returned is the metric with the highest value, and so is more
sensitive to localized movement. Best control of localized movement sensitivity is by changing blk size, lower is more sensitive.
If Interlaced is true, then only every other horizontal scanline in BLKH will be scanned.
v1.20, See RT_LumaSceneChange() for additional args when Mode=1 (ignored when Mode = 0).
Code:
RT_Subtitle(clip source, string format, dat1,...,datn,int "align",int "x","y",bool "vcent"=false,bool "expx"=false,bool "expy"=false )
Standard filter function.
This function is a standard filter graph function, not a runtime/compile time function.
The v2.5 plugin limited to v2.58 colorspaces.
Prints formatted text to clip frame using Avisynth Info.h source font and DDigit font renderer, faster than using Subtitle
system fonts. The unnamed 'format' string and optional unnamed 'dat' args are used to construct the text string that is
printed on frame, uses C/CPP printf() style formatting. The args 'align', 'x', and 'y', work in a similar fashion to
Avisynth Subtitle() eg
RT_Subtitle(c,"Hello there %s and %s.\nGoodbye %d.","Fred","Ted",2013,align=4,x=100,vcent=true)
would print
Hello there Fred and Ted.
Goodbye 2013.
at x pixel position 100 and y pixel position centered, the vcent=true will vertical center a block of text (align=4 or 5 or 6),
whereas Subtitle() starts at centred position and prints downwards from there (as default vcent=false).
Align, default = 7 ie top left (as on numeric keypad).
x and y allow modification of alignment, eg x= -1, centers x at mid point, x=width, would right align,
y=height would align at bottom of frame.
It is necessary to specify the arg names of x,y,align and vcent, as the dat args can take 0 or more variables
of any type, so Avisynth cannot tell when the list of dat args ends and the named optional args begins. I did
try to use the dat args last but Avisynth seems to get confused when you use dat= etc, it throws an error
saying something like "dat arg specified more than once", even if it was not.
printf Format spec here:- http://msdn.microsoft.com/en-us/library/56e442dc%28v=vs.71%29.aspx
NOTE, the only support for printing Bool variables is %s as string, ie prints "True" or "False".
Formatting supported %[flags] [width] [.precision] type
flags, one of "-,+,0, ,#"
width, integer, "*" supported (width supplied via dat arg).
Precision, integer, "*" supported (precision supplied via dat arg).
type,
"c,C,d,i,o,u,x,X", Integer type, c,C=character, d,i=signed, o,u,x,X=unsigned.
"e,E,f,g,G", Floating point type
"s,S", String type (also Bool).
eg
FMT="%d ] \a%cAverageLuma=\a-%6.2f"
ALPHA="0123456789ABCDEFGHIJKLMNOPQRSTUV-!"
ScriptClip("""
RT_Subtitle(FMT,current_frame,RT_Ord(ALPHA,current_frame%16+1),AverageLuma(),align=5)
""")
In the above example you see the sequence "\a%c" where %c is replaced with a character from ALPHA, "\a0"
selects color 0, "\aV" selects the last color (31). "\a-" selects the default color, and "\a!" selects
the hilite color. You can in Scriptclip() select colors programmatically, perhap selecting red to show an
error or bad metrics condition. The initially selected color will always be the default color (white).
Ripped from DDigit source code:
// Color control codes as strings. ASCII Code of Final char
#define DDIGIT_CC_HILITE "\a!" // 33
#define DDIGIT_CC_DEFAULT "\a-" // 45
#define DDIGIT_CC_DARKGRAY "\a0" // 48
#define DDIGIT_CC_DODGERBLUE "\a1" // 49
#define DDIGIT_CC_ORANGERED "\a2" // 50
#define DDIGIT_CC_ORCHID "\a3" // 51
#define DDIGIT_CC_LIME "\a4" // 52
#define DDIGIT_CC_AQUAMARINE "\a5" // 53
#define DDIGIT_CC_YELLOW "\a6" // 54
#define DDIGIT_CC_WHITE "\a7" // 55
#define DDIGIT_CC_SILVER "\a8" // 56
#define DDIGIT_CC_CORNFLOWERBLUE "\a9" // 57
#define DDIGIT_CC_ORANGE "\aA" // 65
#define DDIGIT_CC_PLUM "\aB" // 66
#define DDIGIT_CC_CHARTREUSE "\aC" // 67
#define DDIGIT_CC_POWDERBLUE "\aD" // 68
#define DDIGIT_CC_GOLD "\aE" // 69
#define DDIGIT_CC_GAINSBORO "\aF" // 70
#define DDIGIT_CC_Y_0 "\aG" // 71
#define DDIGIT_CC_Y_1 "\aH" // 72
#define DDIGIT_CC_Y_2 "\aI" // 73
#define DDIGIT_CC_Y_3 "\aJ" // 74
#define DDIGIT_CC_Y_4 "\aK" // 75
#define DDIGIT_CC_Y_5 "\aL" // 76
#define DDIGIT_CC_Y_6 "\aM" // 77
#define DDIGIT_CC_Y_7 "\aN" // 78
#define DDIGIT_CC_Y_8 "\aO" // 79
#define DDIGIT_CC_Y_9 "\aP" // 80
#define DDIGIT_CC_Y_A "\aQ" // 81
#define DDIGIT_CC_Y_B "\aR" // 82
#define DDIGIT_CC_Y_C "\aS" // 83
#define DDIGIT_CC_Y_D "\aT" // 84
#define DDIGIT_CC_Y_E "\aU" // 85
#define DDIGIT_CC_Y_F "\aV" // 86
In addition to color control codes, the filter will accept "\n" or "\r" as newline, and "\f" as forward
space (move 1 right without printing anything), no other control codes are supported. "\t" and TAB control
codes are converted to a single space, I could think of no sensible way to handle tab when center or
right aligned, if there is a demand, I could maybe handle tab for left alignment only and replace with single space
for other alignment.
To embed a single BackSlash ("\") into the format string or even an argument dat string you must insert a double
BackSlash ie "\\". To embed a single percent character ("%") into a format string, you must embed a double percent
sequence ie "%%". Reason is that such characters are used for formatting eg "%f" flags a float arg to embed into
the string and eg "\n" would mean insert newline into string.
Note, the colored text is not great in YV12 and quite awful in YV411, try to avoid YV411 at all times,
tis truly nasty.
To Print contents of multiline text file on frame:
AVISource("D:\AVS\TEST.AVI")
S=RT_ReadTxtFromFile("D:\avs\avi\test.txt")
RT_Subtitle("%s",S,align=5,vcent=True)
As can be seen from above example, you can also use eg Chr(10) instead of "\n" or Chr(13), or Chr(13)+Chr(10)
instead of "\r\n" with identical results, CR, NL and CR/NL pairs are internally replaced by a single Chr(13).
To Print contents of multiline text file on frame, Scrolling upwards as for end credits:
AVISource("D:\AVS\TEST.AVI")
S=RT_ReadTxtFromFile("D:\avs\avi\test.txt")
DELAY=100
Scriptclip("""
RT_Subtitle("%s",S,align=5,y=height+DELAY-current_frame,expy=true)
""")
The above example uses the "expy" arg, which tells the filter to NOT interpret y == -1 as screen vertical
center align and to NOT interpret y=height as bottom aligned. ExpX does the same for the x arg. If you change
above to ExpY=false, as the text scrolls on screen and again when text scrolls off top of frame, there will be
a single frame where y==height OR y==-1, will align the text an cause a glitch in the video clip.
You could also embed eg color control codes into any above such scrolling text file for your amusement, eg
embedding "\a!" into the text file would switch on Hi-Lite-ed text.
If you want you can run above script with this text file as "test.txt" and because it has color control codes
embedded into it (eg the ripped DDigit source code earlier) so it will show the file, some lines of which will be
colored. This text file has NOT been prepared for that particular reason but may demo the embedded color codes.
RT_Subtitle() has the advantage of not requiring string memory as the string is created internally and
released on plugin destruction, whereas SubTitle() within ScriptClip will keep accumulating string memory
which is not released until Avisynth closes. Of course any eg concatenated strings supplied to RT_Subtitle
will be accumulated unless eg assigned to string variable external to Scriptclip.
The RT_Subtitle filter is intended to be used in providing on-frame metrics in a script, and not for final
output, use SubTitle() for that.
For any script using standard Subtitle() for metrics, it would not be at all surprising if that script were
to double (or more) in speed when replaced by RT_Subtitle, it really is quite light weight in comparison.
__________________
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; 27th July 2013 at 22:40. |
|
|
|
|
|
#147 | Link |
|
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 11,406
|
New function contained in RT_Stats v1.20 DynaCrop.avs, equivalent but more robust version of SCSelect()
Code:
Function SC_SceneSelect(clip dclip,clip start,clip end,clip motion,
\ float "dfact",float "minim",
\ Float "Bias",Float "Gain",float "Cont",Float "RPow",Float "SPow",Float "SPMid",bool "Pord",bool "Show") {
# Selects frames depending upon scene change status. Similar to SCSelect()
# Dclip, detection clip. Start, Frames after scene change. End, Frames before scene change. Motion, not scene change.
# Start, End and Motion must be same size and colorspace, Dclip can be other.
myName="SC_SceneSelect: "
df=Float(Default(dfact,4.0)) #
minim=Float(Default(minim,4.0)) # Scene change Diff has to be at least this, avoids eg scene change in near static scene.
Bias=Float(Default(Bias,0.0)) # Arg to RT_LumaSceneChange(), -511.0 -> 511.0, Default 0.0
Gain=Float(Default(Gain,1.0)) # Arg to RT_LumaSceneChange(), -8.0 -> 8.0, Default 1.0
Cont=Float(Default(Cont,1.0)) # Arg to RT_LumaSceneChange(), -8.0 -> 8.0, Default 1.0
RPow=Float(Default(RPow,1.0)) # Arg to RT_LumaSceneChange(), 0.1 -> 4.0, Default 1.0
SPow=Float(Default(SPow,1.0)) # Arg to RT_LumaSceneChange(), 0.1 -> 4.0, Default 1.0
SPMid=Float(Default(SPMid,0.5)) # Arg to RT_LumaSceneChange(), 0.01 -> 0.99, Default 0.5
Pord=Default(Pord,False) # Arg to RT_LumaSceneChange(), Default False
Show=Default(Show,False) # True = Show a little extra Info (Default False)
Assert(df>1.0,myName+"dfact MUST be greater than 1.0")
Assert(minim>0.0,myName+"minim MUST be greater than 0.0")
dclip=dclip.RoboCrop(WMod=4,HMod=4) # Dont allow common border to 'water down' metrics
Global SCM_B=0.0 Global SCM_C=0.0 Global SCM_D=0.0 Global SCM_E=0.0
Global SCM_SC=False Global TrimN=0 Global SCM_Prev=-2 # Init vars, SCM_Prev=-2 forces initalize
Start =(Show)? Start.SubTitle("START OF SCENE",align=1,size=30) : Start
End =(Show)? End.SubTitle("END OF SCENE",align=3,size=30) : End
Motion=(Show)? Motion.SubTitle("MOTION",align=5,size=30) : Motion
# Make format string only once, not at every frame
Fmt=(Show)? "%d ] Trim=%d {\a%c%.1s\a-:\a%c%.1s\a-:\a%c%.1s\a-} L=%.2f : R=%.2f\n" +
\ "%6.2f \a%c%6.2f %6.2f %6.2f\a- %6.2f\n %6.2f %6.2f %6.2f %6.2f\n \a%c%6.2f %6.2f %6.2f\a-\n" +
\ "DFact=%6.2f : Minim=%6.2f\nBias =%6.2f : Gain =%6.2f : Cont =%6.2f\nRPow =%6.2f : SPow =%6.2f : SPMid=%6.2f : Pord=%.1s":""
Motion.ScriptClip("""
NotNext = (current_frame!=SCM_Prev+1)
# If jumped about, get values for Previous frame, else keep same.
# Below Eval avoids extra calcs when scanning forward but is slower going backwards.
psc=(NotNext) ? Eval("
Global SCM_A=RT_LumaSceneChange(dclip,dclip,n=current_frame-3,n2=current_frame-2,bias=BIAS,gain=GAIN,cont=Cont,
\ rpow=RPOW,spow=SPow,Spmid=SPMid,pord=Pord)
Global SCM_B=RT_LumaSceneChange(dclip,dclip,n=current_frame-2,n2=current_frame-1,bias=BIAS,gain=GAIN,cont=Cont,
\ rpow=RPOW,spow=SPow,Spmid=SPMid,pord=Pord)
Global SCM_C=RT_LumaSceneChange(dclip,dclip,n=current_frame-1,n2=current_frame ,bias=BIAS,gain=GAIN,cont=Cont,
\ rpow=RPOW,spow=SPow,Spmid=SPMid,pord=Pord)
Global SCM_D=RT_LumaSceneChange(dclip,dclip,n=current_frame ,n2=current_frame+1,bias=BIAS,gain=GAIN,cont=Cont,
\ rpow=RPOW,spow=SPow,Spmid=SPMid,pord=Pord)
Global SCM_E=RT_LumaSceneChange(dclip,dclip,n=current_frame+1,n2=current_frame+2,bias=BIAS,gain=GAIN,cont=Cont,
\ rpow=RPOW,spow=SPow,Spmid=SPMid,pord=Pord)
AB=SCM_B-SCM_A BC=SCM_C-SCM_B CD=SCM_D-SCM_C DE=SCM_E-SCM_D # Diff of Diff
ABC=BC-AB BCD=CD-BC CDE=DE-CD # Diff Of Diff Of Diff
#
# BELOW MUST BE SAME AS MAIN CODE.
# Big enough compared to movement immediately either side of scene change
T1 = minim<SCM_C # Not static scene ?
T2 = ABC>0.0 && BCD<0.0 && CDE>0.0 # Scene Change sign OK ?
T3 =(df*SCM_B<SCM_C && df*SCM_D<SCM_C) # sufficiently bigger than either side ?
# ABOVE MUST BE SAME AS MAIN CODE.
#
return (T1 && T2 && T3)
") : SCM_SC
Global SCM_A=SCM_B Global SCM_B=SCM_C Global SCM_C=SCM_D Global SCM_D=SCM_E # Pass the parcel
Global SCM_E=RT_LumaSceneChange(dclip,dclip,n=current_frame+2,n2=current_frame+3,bias=BIAS,gain=GAIN,cont=Cont,
\ rpow=RPOW,spow=SPow,Spmid=SPMid,pord=Pord)
AB=SCM_B-SCM_A BC=SCM_C-SCM_B CD=SCM_D-SCM_C DE=SCM_E-SCM_D # Diff of Diff
ABC=BC-AB BCD=CD-BC CDE=DE-CD # Diff Of Diff Of Diff
# Big enough compared to movement immediately either side of scene change
T1 = minim<SCM_C # Not static scene ?
T2 = ABC>0.0 && BCD<0.0 && CDE>0.0 # Scene Change sign OK ?
T3 =(df*SCM_B<SCM_C && df*SCM_D<SCM_C) # sufficiently bigger than either side ?
psc=(psc||current_frame==0)
Global SCM_SC=((T1 && T2 && T3) || current_frame==FrameCount()-1) # Last frame in scene ?
Last = (psc&&!SCM_SC)?start:(SCM_SC&&!psc)?end:Last
CC=(T1&&T2&&T3)?33:45 # Hilite or Default color ?
LFACT=(SCM_C<=SCM_B || !T1 || !T2)?0.0:(SCM_B<0.000001)?999999.9:(SCM_C-0.000001)/SCM_B
RFACT=(SCM_C<=SCM_D || !T1 || !T2)?0.0:(SCM_D<0.000001)?999999.9:(SCM_C-0.000001)/SCM_D
(Show) ? RT_Subtitle(Fmt,current_frame,TrimN,CC,T1,CC,T2,CC,T3,LFACT,RFACT,SCM_A,CC,SCM_B,SCM_C,SCM_D,SCM_E,AB,BC,CD,DE,CC,ABC,BCD,CDE,
\ df,minim,bias,gain,cont,rpow,spow,spmid,pord) : NOP
Global TrimN = (SCM_SC) ? TrimN+1 : TrimN # Incr for next time
Global SCM_Prev=current_frame
Return Last
""",args="start,end,dclip,myName,Show,df,minim,Bias,Gain,Cont,RPow,SPow,SPMid,Pord,Fmt") # Needs Grunt for args
return Last
}
Code:
Import("Dynacrop.avs")
Avisource("D:\avs\test.avi")
DClip=Last
Start=Last
End=Last
Motion=Last
SC_SceneSelect(dclip,start,end,motion,show=true,dfact=4.0,minim=4.0,Bias=0.0,gain=1.0,cont=1.0,rpow=1.0,spow=1.0,SPMid=0.5,pord=false)
__________________
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; 15th July 2013 at 13:05. |
|
|
|
|
|
#148 | Link |
|
Registered User
Join Date: Apr 2008
Location: California, USA
Posts: 127
|
RT_Stats, Compile-time/Runtime Functions v1.20 - 14 July 2013
Increasing a video's gamma or histogram profile can brighten a seemingly black nighttime surveillance video. However, with only 256 shades of YUV illumination, the results can fail to be forensically useful. It seems to me that a your RT-Stats tool in RGB space could provide a much better alternative. My idea is to select the upper left most pixel and read its RGB values along with those of the preceding and postceding "N" frames. Average those temporal values and then subtract that average from the current frame's R G and B pixel values. If I now multiply that difference by "M", and add it to the original RGB pixel values, the resulting RGB values will be an exaggeration of the color deviation from average at that one pixel. If I repeat this process for every pixel of every frame, I should end up with greater detail of any changes that are occurring, even if the scene appears almost completely dark. I realize that the resulting scene will look weird, and poison noise will become amplified, but the goal is to detect movement, amplify signage (logos, license plates, etc...), and other forensic stuff.
I tried this myself using "RgbChanMedian" to read each pixel and "Overlay" to write the new pixel data. Not only was the process painfully slow (several minutes per frame) but it also caused out of memory issues due to all the looping required (thus I now have no solution). Although my work is mostly with low quality surveillance video, such a feature would encourage new uses. For example, the exaggerated color shifts would allow anyone to see the normally imperceptible temperature changes as machinery heated up (and thus red incremented by one in RGB space). EDIT: This comment led to a new thread that contains my original code, and improvements by others, all located HERE Last edited by Forensic; 24th July 2013 at 17:10. Reason: Moved to new thread |
|
|
|
|
|
#149 | Link |
|
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 11,406
|
RT_Stats v1.21 update. See 1st post.
New GUI Filselector functions. Code:
RT_FSelOpen(string "title"="Open",string "dir"="",string "filt",string "fn="",bool "multi"=false,bool "debug"=false)
Function to select EXISTING filename using GUI FileSelector.
Title = Title bar text.
Dir = Directory, "" = Current
Filt = Lots, eg "All Files (*.*)|*.*"
[Displayed text | wildcard] [| more pairs of Displayed text and wildcard, in pairs ONLY].
first one is default.
fn = Initially presented filename (if any).
multi = Multiply Select filenames. Allows selection of more than one filename at once.
debug = Send error info to DebugView window.
Returns
int, 0, user CANCELLED.
int, non zero is error (error sent to DebugView window).
String, Filename selected, Chr(10) separated multiline string if MULTI==true (and multiple files selected).
Example, to prompt for an AVI file and play it.
avi=RT_FSelOpen("I MUST have an AVI",filt="Avi files|*.avi")
Assert(avi.IsString,"RT_FSelOpen: Error="+String(avi))
AviSourcE(avi)
***
***
***
Function RT_FSelSaveAs(string "title"="Open",string "dir"="",string "filt",string "fn="",bool "debug"=false)
Function to select filename for Save using GUI.
Title = Title bar text.
Dir = Directory, "" = Current
Filt = Lots, eg "All Files (*.*)|*.*"
[Displayed text | wildcard] [| more pairs of Displayed text and wildcard, in pairs ONLY].
first one is default.
fn = Initially presented filename (if any).
debug = send errors to DebugView window.
Returns
int, 0, user CANCELLED.
int, non zero is error (error sent to DebugView window).
String, Filename selected.
***
***
***
Function RT_FSelFolder(string "title"="",string "dir"=".",bool "debug"=false)
Function to select Folder using GUI.
Title = UNDERNEATH the title bar text, for instructions.
Dir = Directory, Default "." = Current, ""=Root.
debug = Send errors to DebugView window.
Returns
int, 0, user CANCELLED.
int, non zero is error (ie -1, error sent to DebugView window, usually selecting non Folder object eg 'My Computer').
String, Folder selected (minus trailing BackSlash).
Code:
avi = RT_FSelOpen("Please select an AVI file",Filt="*.AVI|*.AVI")
Assert(avi.IsString,"RT_FSelOpen: Error="+String(avi))
AVISource(AVI)
txt = RT_FSelOpen("And now select a Text file",Filt="*.txt|*.txt")
Assert(txt.IsString,"RT_FSelOpen: Error="+String(txt))
Txt=RT_ReadTxtFromFile(txt)
Lines=RT_TxtQueryLines(Txt)
# config
DELAY=100
ALIGN=5 # As Numeric KeyPad
SCROLL=0 # 0 = Upwards : 1 = Downwards : 2 = Right to Left : 3 = Left to right : 4 = Karaoke
#
ORG=Last
Last=(SCROLL==4)? ORG.Blankclip(height=64) : Last
CMD_0 = """RT_Subtitle("%s",Txt,align=ALIGN,y=height+DELAY-current_frame,expx=true,expy=true)"""
CMD_1 = """RT_Subtitle("%s",Txt,align=ALIGN,y=-(Lines*20+DELAY) + current_frame,expx=true,expy=true)"""
CMD_2 = """RT_Subtitle("%s",Txt,align=ALIGN,x=width+DELAY-current_frame,expx=true,vcent=true)"""
CMD_3 = """RT_Subtitle("%s",Txt,align=ALIGN,x=-(width+DELAY)+current_frame,expx=true,vcent=true)"""
CMD_4 = """RT_Subtitle("%s",Txt,align=ALIGN,y=height+DELAY-current_frame,expx=true,expy=true)"""
CMD_5 = """RT_Subtitle("BAD SCROLL COMMAND (0->4)")"""
CMD = (SCROLL<0 || SCROLL>4) ? CMD_5 : Select(Scroll,CMD_0,CMD_1,CMD_2,CMD_3,CMD_4)
ScriptClip(CMD)
Return (SCROLL==4)? StackVertical(ORG,Last) : Last
__________________
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; 28th July 2013 at 15:25. |
|
|
|
|
|
#150 | Link |
|
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 11,406
|
RT_Stats v1.22, update.
v1.22, Fixed RT_RGBChanXXXX channels. Changed RT_YStdev() to Standard Deviation from Sample Standard Deviation. See 1st post.
__________________
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 ??? |
|
|
|
|
|
#151 | Link |
|
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 11,406
|
RT_Stats v1.23, update. See first post.
Code:
v1.23, Mod RT_Debug, added Repeat arg.
Mod RT_YInRangeLocate, added Baffle_W and Baffle_H args.
Added RT_RgbInRange func.
Added RT_RgbInRangeLocate func.
Code:
RT_Debug(string s1, ... , string sn,bool "name"=true,bool "Repeat"=true)
Non-clip function. Takes one or more strings, joins them together and then outputs the combined
string to OutputDebugString(), if strings are NOT space separated, it inserts a single space between them.
Useful during development Compile-time/Run-time scripts to monitor status in real time.
Can also output multiline string obtained via eg RT_ReadTxtFromFile.
Name: bool Default=True. If False, then does NOT output "RT_Debug: " at the beginning of each line, you
might want to replace with your own title in string s1.
Use DebugView utility to view and capture output. http://technet.microsoft.com/en-gb/sysinternals/bb545027
Usage eg:- RT_Debug("["+String(42)+"]","Going pretty good so far @","Line "+String(19))
Would Produce this "RT_Debug: [42] Going pretty good so far @ Line 19"
The above "RT_Debug:" title is present in all RT_Debug() output to the debugview window and you can (in DebugView),
filter out all lines that do not contain "RT_Debug:" so as to skip stuff that is of no interest (eg AVSPMod generates
some output, not sure but I think Avisynth v2.58 also generates lots of debug stuff).
NOTE, Any program can send output to DebugView window, if no debug viewer is present, it normally just disappears
down the plughole.
In DebugView, filter for eg "RT_Debug:" to skip all the extraneous stuff generated by other plugins/programs.
(In DebugView "Menu:Edit-Filter/Highlight", and enter "RT_Debug:".
v1.14, No longer converts characters 127->255 to SPACE, only chars 0->31 (excluding n/l and CR) converted to space.
Characters displayed via debugview are same as those via SubTitle, but those above 127 are dissimilar to the ones
produced via Avisynth source Info.h, used during eg plugin metrics display.
v1.23, Added Repeat arg, only used if Name==False.
If name==False and Repeat==True then outputs first string at beginning of each line, ie shows
your own name on each line where input strings contain Chr(10) line breaks. False output first string on first
line only.
Code:
RT_RgbInRange(clip,int "n"=current_frame,int "delta"=0,int "x"=0,int "y"=0,int "w"=0,int "h"=0,bool "interlaced"=false, \
int "RLo"=128,int "RHi"=RLo,int "GLo"=128,int "GHi"=GLo,int "BLo"=128,int "BHi"=BLo)
Returns float value (0.0 -> 1.0) being the amount of pixels with all channels in the range "cLo" to "cHi" (inclusive, c==R or G or B),
1.0 is equivalent to 100%.
NOTE, differs from other funcs that return range 0.0 to 255.0. NOTE, cLo defaults to 128, "cHi" defaults to "cLo".
RLo: Default 128, lower bound of pixel values of Red Channel to search for.
RHi: Default RLo, upper bound of pixel values to Red Channel search for.
GLo: Default 128, lower bound of pixel values of Green Channel to search for.
GHi: Default GLo, upper bound of pixel values to Green Channel search for.
BLo: Default 128, lower bound of pixel values of Blue Channel to search for.
BHi: Default BLo, upper bound of pixel values to Blue Channel search for.
Code:
Function RT_YInRangeLocate(clip c,int "n"=current_frame,int "Delta"=0,int "x"=0,int "y"=0,int "w"=0,int "h"=0,int "Baffle"=8,float "Thresh"=0.0, \
int "Lo"=128,int "Hi"=255,Int "Matrix"=(width<=720?2:3),String "Prefix"="YIRL_",bool "Debug"=false,int "Baffle_W"=Baffle,int "Baffle_H"=Baffle)
Clip function to scan frame n+delta for an area where percentage of pixels in luma range Lo to Hi (inclusive) breaks a threshold over at
least Baffle consecutive number of scanlines (all four sides).
Returns True on Successful location else false. On success sets Global var Coords.
RT_YInRangeLocate() tests scanlines from outer most scanlines (h and v), towards inner most, stops where it find Baffle consecutive scanlines
that contain more than Thresh percent of pixels in range Lo to Hi. Object interiors are not tested and so could be hollow.
Would also give +ve result for a disjoint shape like this
--
| |
--
Args:
n: default = current_frame in runtime environment.
Delta: Default = 0
X:Y:W:H: All default=0 as in crop. Area to search, default is full frame.
Baffle: Default=8, minimum number of scanlines that must have a percentage of pixels in range Lo to Hi, greater than Thresh. Avoids noise.
Thresh: Default=0.0 (0.0->100.0). Percentage pixels above which breaks Threshold. Default is any pixel in the range Lo to Hi will break threshold.
Lo: Default 128, lower bound of pixel values to search for.
Hi: Default 255, upper bound of pixel values to search for.
Matrix: Default for RGB is 2(PC601) if width <= 720 else 3(PC709) : YUV not used
Prefix: Default "YIRL_", prefix for Global Var coords set on successful location of object, eg YIRL_X, YIRL_Y, YIRL_W, YIRL_H.
Debug: Default false. If true outputs info to debugView.
Baffle_W, Default Baffle. Thickness of Left and Right side vertical edges, silently limited to width W of search area.
Baffle_H, Default Baffle. Thickness of Top and Bottom horizontal edges, silently limited to height H of search area.
Code:
Function RT_RgbInRangeLocate(clip c,int "n"=current_frame,int "Delta"=0,int "x"=0,int "y"=0,int "w"=0,int "h"=0,int "Baffle"=8,float "Thresh"=0.0, \
int "RLo"=128,int "RHi"=255,int "GLo"=128,int "GHi"=255,int "BLo"=128,int "BHi"=255, \
String "Prefix"="RGBIRL_",bool "Debug"=false,int "Baffle_W"=Baffle,int "Baffle_H"=Baffle)
Clip function to scan frame n+delta for an area where percentage of pixels in all 3 RGB channels range cLo to cHi (inclusive, c==R or G or B)
breaks a threshold over at least Baffle consecutive number of scanlines (all four sides).
Returns True on Successful location else false. On success sets Global var Coords.
RT_RgbInRangeLocate() tests scanlines from outer most scanlines (h and v), towards inner most, stops where it find Baffle consecutive scanlines
that contain more than Thresh percent of pixels in range cLo to cHi. Object interiors are not tested and so could be hollow.
Would also give +ve result for a disjoint shape like this
--
| |
--
Args:
n: default = current_frame in runtime environment.
Delta: Default = 0
X:Y:W:H: All default=0 as in crop. Area to search, default is full frame.
Baffle: Default=8, minimum number of scanlines that must have a percentage of pixels in range Lo to Hi, greater than Thresh. Avoids noise.
Thresh: Default=0.0 (0.0->100.0). Percentage pixels above which breaks Threshold.
Default is any pixel with all three channels in range cLo to cHi, will break threshold.
RLo: Default 128, lower bound of pixel values of Red Channel to search for.
RHi: Default 255, upper bound of pixel values to Red Channel search for.
GLo: Default 128, lower bound of pixel values of Green Channel to search for.
GHi: Default 255, upper bound of pixel values to Green Channel search for.
BLo: Default 128, lower bound of pixel values of Blue Channel to search for.
BHi: Default 255, upper bound of pixel values to Blue Channel search for.
Prefix: Default "RGBIRL_", prefix for Global Var coords set on successful location of object, eg RGBIRL_X, RGBIRL_Y, RGBIRL_W, RGBIRL_H.
Debug: Default false. If true outputs info to debugView.
Baffle_W, Default Baffle. Thickness of Left and Right side vertical edges, silently limited to width W of search area.
Baffle_H, Default Baffle. Thickness of Top and Bottom horizontal edges, silently limited to height H of search area.
Code:
RED =$AA # Object Color to look for
GREEN =$CC
BLUE =$FF
OBJECT_W = 10 # Object Width
OBJECT_H = 10 # Object Height
AREA_X = 0 # Area of frame to search (0,0,0,0=full frame, As Crop)
AREA_Y = 0
AREA_W = -0
AREA_H = -0
R_MIN = RED R_MAX = RED
G_MIN = GREEN G_MAX = GREEN
B_MIN = BLUE B_MAX = BLUE
# Overlay Converts RGB->YUV->RGB (can set inexact color). Use Layer Instead, MUST set ALPHA
RGBA=((255 * 256 + RED)*256+GREEN)*256+BLUE
COORDINATES="coordinates.txt"
# Fake input clip, for testing # EDIT: Animated fake clip partly liberated from a Cretindesalpes script
a = BlankClip(length=480,width=480,height=480)
b = a.BlankClip(width=OBJECT_W, height=OBJECT_H, color=RGBA)
a.Animate (0, a.FrameCount () - 1, "Layer", b,"add",257, 0, 0, b,"add",257, 479, 479)
NOTFOUND="NOT FOUND"
sep = ", "
Bra = "] "
RT_FileDelete(COORDINATES) # Delete coordinates file
ScriptClip ("""
Bingo=RT_RgbInRangeLocate(x=AREA_X,y=AREA_Y,w=AREA_W,h=AREA_H,
\ RLo=R_MIN,Rhi=R_MAX,GLo=G_MIN,Ghi=G_MAX,BLo=B_MIN,Bhi=B_MAX,Baffle_W=OBJECT_W,Baffle_H=OBJECT_H)
(Bingo) ? WriteFile (COORDINATES,"current_frame", "Bra", "RGBIRL_X", "sep", "RGBIRL_Y")
\ : WriteFile (COORDINATES,"current_frame", "Bra", "NOTFOUND")
""")
__________________
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; 19th September 2013 at 08:46. |
|
|
|
|
|
#152 | Link |
|
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 11,406
|
Code:
RT_Stats functions current @ v1.23
There follows a list of all function names together with CPP style argument specifiers that inform
Avisynth the argument types and optional names. Optional arguments have square brackets surrounding
their name as in [name] and are followed by a type specifier character that gives the type.
Unnamed arguments are not optional. eg "cc[arg1]b[arg2]i" would be two compulsory unnamed clip args,
followed by optional 'arg1' of type bool and optional 'arg2' of type int.
# Argument type specifier strings.
c - Video Clip
i - Integer number
f - Float number
s - String
b - boolean
. - Any type (dot)
# Array Specifiers
i* - Integer Array, zero or more
i+ - Integer Array, one or more
.* - Any type Array, zero or more
.+ - Any type Array, one or more
# Etc
###################################
RT_ColorSpaceXMod,"c"
RT_ColorSpaceYMod,"c[Laced]b"
RT_Stats,"c"
RT_GraphLink,"cc+b*"
RT_Subtitle, "cs.*[align]i[x]i[y]i[vcent]b[expx]b[expy]b"
// ------
RT_BitNOT,"i"
RT_BitAND,"ii"
RT_BitOR ,"ii"
RT_BitXOR,"ii"
RT_BitASL,"ii"
RT_BitASR,"ii"
RT_BitLSL,"ii"
RT_BitLSR,"ii"
RT_BitTST,"ii"
RT_BitCLR,"ii"
RT_BitSET,"ii"
RT_BitCHG,"ii"
RT_BitROR,"ii"
RT_BitROL,"ii"
RT_BitSetCount,"i"
// ------
RT_Hex,"i[width]i"
RT_HexValue,"s[pos]i"
RT_NumberString,"i[base]i[width]i"
RT_NumberValue,"s[base]i[pos]i"
// ------
RT_Call, "s[Hide]b[Debug]b"
RT_GetLastError, ""
RT_GetLastErrorString, ""
// ------
RT_Debug, "s+[name]b[repeat]b"
// ------
RT_GetProcessName, "[Parent]b[debug]b"
// ------
RT_Undefined,""
RT_VarExist,"s"
RT_Ord,"s[pos]i"
RT_Timer,""
// ------
RT_FileQueryLines,"s"
RT_ReadTxtFromFile,"s[Lines]i[Start]i"
RT_WriteFileList,"ss[append]b"
RT_TxtWriteFile,"ss[append]b"
RT_FileDelete,"s"
//
RT_FSelOpen ,"[title]s[dir]s[filt]s[fn]s[multi]b[debug]b"
RT_FSelSaveAs,"[title]s[dir]s[filt]s[fn]s[debug]b"
RT_FSelFolder,"[title]s[dir]s[debug]b"
// ------
RT_YDifference,"c[n]i[delta]i[x]i[y]i[w]i[h]i[x2]i[y2]i[Interlaced]b[matrix]i"
RT_LumaCorrelation,"cc[n]i[delta]i[x]i[y]i[w]i[h]i[n2]i[delta2]i[x2]i[y2]i[Interlaced]b[matrix]i"
RT_LumaDifference,"cc[n]i[delta]i[x]i[y]i[w]i[h]i[n2]i[delta2]i[x2]i[y2]i[Interlaced]b[matrix]i"
RT_LumaSceneChange,"cc[n]i[delta]i[x]i[y]i[w]i[h]i[n2]i[delta2]i[x2]i[y2]i[Interlaced]b[matrix]i" \
"[Bias]f[Gain]f[Cont]f[RPow]f[SPow]f[SPMid]f[Pord]b"
RT_LumaMovement,"cc[n]i[delta]i[x]i[y]i[w]i[h]i[n2]i[delta2]i[x2]i[y2]i[Interlaced]b[matrix]i[mode]i[blkw]i[blkh]i" \
"[Bias]f[Gain]f[Cont]f[RPow]f[SPow]f[SPMid]f[Pord]b"
//
RT_YPlaneMin, "c[n]i[delta]i[x]i[y]i[w]i[h]i[Interlaced]b[threshold]f[matrix]i"
RT_YPlaneMax, "c[n]i[delta]i[x]i[y]i[w]i[h]i[Interlaced]b[threshold]f[matrix]i"
RT_YPlaneMinMaxDifference, "c[n]i[delta]i[x]i[y]i[w]i[h]i[Interlaced]b[threshold]f[matrix]i"
RT_YPlaneMedian, "c[n]i[delta]i[x]i[y]i[w]i[h]i[Interlaced]b[matrix]i"
RT_AverageLuma, "c[n]i[delta]i[x]i[y]i[w]i[h]i[Interlaced]b[matrix]i"
RT_YPlaneStdev, "c[n]i[delta]i[x]i[y]i[w]i[h]i[Interlaced]b[matrix]i"
RT_YInRange, "c[n]i[delta]i[x]i[y]i[w]i[h]i[Interlaced]b[matrix]i[lo]i[hi]i"
RT_YStats, "c[n]i[delta]i[x]i[y]i[w]i[h]i[Interlaced]b[threshold]f[matrix]i[lo]i[hi]i[flgs]i[prefix]s"
///
RT_RgbChanMin, "c[n]i[delta]i[x]i[y]i[w]i[h]i[Interlaced]b[threshold]f[Chan]i"
RT_RgbChanMax, "c[n]i[delta]i[x]i[y]i[w]i[h]i[Interlaced]b[threshold]f[Chan]i"
RT_RgbChanMinMaxDifference, "c[n]i[delta]i[x]i[y]i[w]i[h]i[Interlaced]b[threshold]f[Chan]i"
RT_RgbChanMedian, "c[n]i[delta]i[x]i[y]i[w]i[h]i[Interlaced]b[Chan]i"
RT_RgbChanAve, "c[n]i[delta]i[x]i[y]i[w]i[h]i[Interlaced]b[Chan]i"
RT_RgbChanStdev, "c[n]i[delta]i[x]i[y]i[w]i[h]i[Interlaced]b[Chan]i"
RT_RgbChanInRange, "c[n]i[delta]i[x]i[y]i[w]i[h]i[Interlaced]b[Chan]i[lo]i[hi]i"
RT_RgbChanStats, "c[n]i[delta]i[x]i[y]i[w]i[h]i[Interlaced]b[threshold]f[Chan]i[lo]i[hi]i[flgs]i[prefix]s"
///
RT_RGB32AsFloat,"c[n]i[delta]i[x]i[y]i"
RT_RGB32AsInt,"c[n]i[delta]i[x]i[y]i"
RT_FloatAsRGBA,"f"
///
RT_YankChain, "c[n]i[delta]i"
// ------
RT_TxtQueryLines,"s"
RT_TxtGetLine,"s[Line]i"
RT_StrAddStr,"ss+"
RT_TxtAddStr,"ss+"
RT_QuoteStr,"s"
RT_StrReplace,"sss[sig]b"
RT_StrReplaceDeep,"sss[sig]b"
RT_StrReplaceMulti,"sss[sig]b"
RT_StrPad,"si[c]s"
RT_FindStr,"ss[sig]b[pos]i"
// ------
RT_TxtSort,"s[mode]i"
// ------
RT_GetWorkingDir,""
RT_FilenameSplit,"s[get]i"
RT_GetFileExtension,"s"
// ------
RT_QueryLumaMinMax,"c[Samples]i[Ignore]f[Prefix]s[Debug]b[X]i[Y]i[W]i[H]i[Matrix]i"
RT_QueryBorderCrop,"c[Samples]i[Thresh]f[Laced]b[xMod]i[yMod]i[wMod]i[hMod]i[Relative]b[Prefix]s[RLBT]i[Debug]b[Ignore]f[Matrix]i" \
"[ScanPerc]f[Baffle]i[ScaleAutoThreshRGB]b[ScaleAutoThreshYUV]b"
RT_YInRangeLocate, "c[n]i[delta]i[x]i[y]i[w]i[h]i[baffle]i[thresh]f[lo]i[hi]i[matrix]i[prefix]s[debug]b[baffle_w]i[baffle_h]i"
// ------
RT_RgbInRange, "c[n]i[delta]i[x]i[y]i[w]i[h]i[Interlaced]b[Rlo]i[Rhi]i[Glo]i[Ghi]i[Blo]i[Bhi]i"
RT_RGBInRangeLocate,"c[n]i[delta]i[x]i[y]i[w]i[h]i[baffle]i[thresh]f[Rlo]i[Rhi]i[Glo]i[Ghi]i[Blo]i[Bhi]i[prefix]s[debug]b" \
"[baffle_w]i[baffle_h]i"
// ------
RT_GetSAR, "cf"
RT_GetDAR, "cf"
RT_SignalDAR, "f"
RT_GetCropDAR,"cf[x]f[y]f[w]f[h]f"
__________________
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 ??? |
|
|
|
|
|
#153 | Link |
|
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 11,406
|
@Jmac698
If you see this (I saw you scurrying around last night ),try out RgbAmplifier on your Moon2 set (after PlanetCrop, with/without PlanetCrop luma leveling), and with/without speedup to eg 7FPS (clearly shows clouds moving across the moon images). Makes for some interesting shots.
__________________
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; 8th September 2013 at 20:30. |
|
|
|
|
|
#154 | Link |
|
Registered User
Join Date: Jan 2006
Posts: 1,869
|
interesting, will do! Funny, I was just reading about that exact topic at random and thinking about uses for exaggerating differences, and in fact there's a much more sophicated way to do this
http://people.csail.mit.edu/mrub/vidmag/ |
|
|
|
|
|
#155 | Link |
|
Registered User
Join Date: Apr 2008
Location: California, USA
Posts: 127
|
Jmac698, don't be hatin on my RgbAmplifier. I invented this in 2010 but could not use it on anything except small short test videos due to out of memory errors. I brought it back to life when RTStats introduced a new tool and, with the talents on StainlessS and Gavino, it became a very useable plug. Eulerian Video Magnification also lets you limit the affected color range but I think it is designed for clear high-res high-fps videos. RgbAmplifier is designed to work on noisy low-res low-fps videos (like surveillance videos). It is proving to be quite useful for my fellow video forensic analysts.
|
|
|
|
|
|
#156 | Link |
|
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 11,406
|
Very interesting link JMac.
Limited use though due to no motion requirement, lie detector, baby not breathing alarm, perhaps some kind of strain gauge. Dont bother trying RgbAmplifier on your original Moon set, looks appalling mulicolored mess with full amp of 10.0. EDIT: Forensic, I tried RGBAmplifier on the Face.mp4 with radius between about 7 to 25, it does actually reveal the same facial flush of the vidmag link, it does however reveal compression artifacts and all minute differences, and does not look anywhere near as good as vidmag. Not really surprising though as vidmag has a different purpose. I also did a quick hack and tried magnifying difference between current frame and the average of (current-off)+(current+off) with off of about 13 frames, even that worked quite well but again was quite noisy.
__________________
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; 10th September 2013 at 03:31. |
|
|
|
|
|
#157 | Link |
|
Registered User
Join Date: Apr 2008
Location: California, USA
Posts: 127
|
I believe that they simply came to a similar methodology as RgbAmplifier. I also propose that RgbAmplifier results would match theirs (for color variance detection) in clarity if they had provided the uncompressed version of Face.mp4. By sharing a h.264 version, the file has quantization data errors (the noise) and significant pixel disruptions at he boundaries of the slices (aka, pixel blocks). No way to know for sure without that file.
|
|
|
|
|
|
#158 | Link |
|
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 11,406
|
I also did a quick hack (now deleted) where I used ClipBlend(delay=0) [blend ALL frames encountered] and saved last frame.
Called RGBAmp hack version with only args Magnifier and new arg clip c2 (the whole clip blended frame) and amplified diff between current frame and the single blended frame. Still amp'ed the face flush and also minute differences as face moved with hair going strangely wiry, and reduced quantization anomalies. Would have been nice to have original uncompressed source to try for comparison, but I think they must also have some kind of temporal smoothing with frames close to current and perhaps at 'beat' distance from current. I did not yet read their source, think I'll stop with those experiments.
__________________
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 ??? |
|
|
|
|
|
#159 | Link |
|
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 11,406
|
RT_Stats v1.24, new version, see 1st post.
v1.24, Fixed Interlaced Y stepping. Added Mask args to Y/RGB stats, Added RT_YPNorm, RT_RgbChanPNorm (*** EXPERIMENTAL ***) Added RT_TxtFindStr and RT_FileFindStr and RT_String. New Functions added. Code:
v1.24, New. RT_TxtFindStr(String S,string FndS,bool "Sig"=True,int "Pos"=1,int "Start"=0,int "Lines"=0) Finds unnamed string FndS in unnamed multi-line text string S, starting at line 'Start' and searching 'Lines' number of string lines. S: is a multi-line text string, ie a newline [CHR(10)] separated list of strings. FndS: is a single string and will be considered terminated early at the first carriage return [Chr(13)] or newline [Chr(10)], carriage returns and newlines will not be findable using this function. Sig: Default=True, does case significant comparison, insignificant if false. Pos: Default=1, is the character start position in an individual line of the multi-line string S to start searching for the FndS string. Allows you to skip search on first Pos-1 characters within all single lines of multi-line string S. If Pos less than 1, then will return -ve number (usually -1), Not Found. Start: Default 0, is the 0 relative starting line where the searching begins within the multi-line string S. Lines: Default 0(all lines). Number of lines in multi-line string to seach, starting at line 'Start'. A -ve return is 'Not Found'. On success returns the line number of the first instance of a found string in the Start and Lines range of lines. An empty "" FndS will always return -ve result, ie Not Found (as will all errors). see RT_TxtQueryLines, to inquire number of single lines in a chr(10) separated multi-line string. see RT_TxtGetLine to extract a single line from a multi-line string [without trailing Chr(10) or Chr(13)]. NOTE, Character position 'Pos' is 1 relative whereas multi-line line 'Start' index is 0 relative. Code:
v1.24, New
RT_String(String format, dat1,...,datn,int "Esc"=1)
Returns a formatted string. The unnamed 'format' string and optional unnamed 'dat' args are used to construct the text string that is
returned, uses C/CPP printf() style formatting.
Format: compulsory string controlling format and describing the datn type args that are expected.
datn: Variable number of data args of any type (excluding clip).
Esc: Default 1, converts embedded escape sequences in format string, 2 convert escape sequences in both format and datn strings,
0 no escape sequence conversion done.
It is necessary to specify the "Esc" name if you wish to alter default, as Avisynth cannot tell when the variable number of data datn
args ends.
You might wish to turn off escape conversion if you want to send a multi-line string to Subtitle() without conversion of '\n' to Chr(10).
printf Format spec here:- http://msdn.microsoft.com/en-us/library/56e442dc%28v=vs.71%29.aspx
NOTE, the only support for printing Bool variables is %s as string, ie prints "True" or "False".
Formatting supported %[flags] [width] [.precision] type
flags, one of "-,+,0, ,#"
width, integer, "*" supported (width supplied via dat arg).
Precision, integer, "*" supported (precision supplied via dat arg).
type,
"c,C,d,i,o,u,x,X", Integer type, c,C=character, d,i=signed, o,u,x,X=unsigned (o=octal, x=Hex).
"e,E,f,g,G", Floating point type
"s,S", String type (also Bool).
Formatting Insertion point is marked with '%' character (as in Avisynth String function), if you wish to use a percent
character within the returned string, it should be inserted twice ie '%%' will produce a single '%'.
EDIT: '%' in data datn arg strings do not need double % character.
A Backslash character '\' introduces escape sequences, to insert a backslash character itself, you must supply a double
backslash sequence ie '\\'.
When 'Esc' is non zero, converts embedded escape character sequences (Case Significant):-
'\\' Converted to '\' Single Backslash
'\n' Converted to Chr(10) NewLine
'\r' Converted to Chr(13) Carriage Return
'\t' Converted to Chr(9) Horizontal TAB
'\v' Converted to Chr(11) Vertical TAB
'\f' Converted to Chr(12) FormFeed
'\b' Converted to Chr(8) BackSpace
'\a' Converted to Chr(7) Bell
'\x', where x is ANY OTHER CHARACTER not included above, will be copied verbatim, ie '\x'.
eg
RT_String("Hello there %s and %s.\nGoodbye %d.","Fred","Ted",2013)
would return same as:- "Hello there Fred and Ted." + Chr(10) + "Goodbye 2013."
Be aware that when 'Esc'=2, the string is constructed via two passes, the 1st pass inserts the data args into the format string,
2nd pass converts escape sequences, so the escape sequences could also exist in the datn args. Also, beware of constructing strings
which when joined together, form an escape sequence.
Take care when handling filenames with path backslash, suggest using 'Esc'=1 when data datn strings contain eg Filenames.
Code:
v1.24, New. RT_FileFindStr(String FileName,string FndS,bool "Sig"=True,int "Pos"=1,int "Start"=0,int "Lines"=0) Finds unnamed string 'FndS' in 'FileName' text file, starting at line 'Start' and searching 'Lines' number of text lines. FileName: Name of a file containing text to search. FndS: is a string and will be considered terminated early at the first carriage return [Chr(13)] or newline [Chr(10)], carriage returns and newlines will not be findable using this function. Sig: Default=True, does case significant comparison, insignificant if false. Pos: Default=1, is the character start position in an individual line of text to start searching for the FndS string. Allows you to skip search on first Pos-1 characters within all lines of text. If Pos less than 1, then will return -ve number (usually -1), Not Found. Start: Default 0, is the 0 relative starting line where the searching begins in the text file. Lines: Default 0(all lines). Number of lines text to seach, starting at 'Start' line. A -ve return is 'Not Found'. On success returns the line number of the first instance of a found string in the Start and Lines range of lines. An empty "" FndS will always return -ve result, ie Not Found. see RT_FileQueryLines, to inquire number lines in a text file. see RT_ReadTxtFromFile to extract a range of lines from a text file. NOTE, Character position 'Pos' is 1 relative whereas multi-line line 'Start' index is 0 relative. Code:
RT_YPNorm(clip c,int "n"=current_frame,int "delta"=0,int "x"=0,int "y"=0,int "w"=0,int "h"=0,bool "interlaced"=false,
float "mu"=0.0,int "d"=1,int "p"=1,int "u"=1,int "Matrix"=(width<=720?2:3),clip "mask"=NOT_USED,int "MaskMin"=128,"MaskMax"=255)
Return int -1 if no valid pixels in Mask clip.
Returns FLOAT value greater or equal to 0.0, being the "Minkowski P-norm" (range depends upon values of 'd' and 'u') for frame(n+delta)
area x,y,w,h, and selected Chan channel (0=R,1=G,2=B, RGB32 3=ALPHA)
mu, Float, default 0.0 (0.0 -> 255.0)
d, int, default 1 (1 -> 255) # downscale
p, int, default 1 (1 -> 16) # power
u, int, default 1 (1 -> 255) # final upscale before returning result (experimental)
Formula is: sum_over_pixels[ ((pixel-mu)/d)^p ]^(1/p) * u
or in words: d and u are scaling aids. The differences between the pixel values and mu are scaled, taken to the power of p and added up
over the frame. The sum is taken to the p-th root and finally rescaled.
mu=0, d=1, p=1, u=1 yields the average.
mu=average, d=1, p=2, u=1 yields the standard deviation (uncorrected sample standard deviation).
Implemented as requested by Martin53 (thankyou). *** EXPERIMENTAL ***
http://en.wikipedia.org/wiki/P-norm#The_p-norm_in_finite_dimensions
http://en.wikipedia.org/wiki/Minkowski_distance
Code:
RT_RgbChanPNorm(clip c,int "n"=current_frame,int "delta"=0,int "x"=0,int "y"=0,int "w"=0,int "h"=0,bool "interlaced"=false,
int "chan"=0,float "mu"=0.0,int "d"=1,int "p"=1,int "u"=1,int "mask"=NOT_USED, int "MaskMin"=128,"MaskMax"=255)
Return int -1 if no valid pixels in Mask clip.
Returns FLOAT value greater or equal to 0.0, being the "Minkowski P-norm" (range depends upon values of 'd' and 'u') for frame(n+delta)
area x,y,w,h, and selected Chan channel (0=R,1=G,2=B, RGB32 3=ALPHA)
mu, Float, default 0.0 (0.0 -> 255.0)
d, int, default 1 (1 -> 255) # downscale
p, int, default 1 (1 -> 16) # power
u, int, default 1 (1 -> 255) # final upscale before returning result (experimental)
Formula is: sum_over_pixels[ ((pixel-mu)/d)^p ]^(1/p) * u
or in words: d and u are scaling aids. The differences between the pixel values and mu are scaled, taken to the power of p and added up
over the frame. The sum is taken to the p-th root and finally rescaled.
mu=0, d=1, p=1, u=1 yields the average.
mu=average, d=1, p=2, u=1 yields the standard deviation (uncorrected sample standard deviation).
Implemented as requested by Martin53 (thankyou). *** EXPERIMENTAL ***
http://en.wikipedia.org/wiki/P-norm#The_p-norm_in_finite_dimensions
http://en.wikipedia.org/wiki/Minkowski_distance
EDIT: INSERTED THIS CODE BLOCK Code:
******************************************** ********* RGB MASKED Channel FUNCTIONS ***** ******************************************** RGB32, RGB24 source clip. The source clip c must be RGB32 or RGB24. The compiletime/runtime clip functions share some common characteristics. The 'n' and (where used) 'n2' args are the optional frame numbers and default to 'current_frame' if not specified. The x,y,w,h, coords specify the source rectangle under scrutiny and are specified as for Crop(), the default 0,0,0,0 is full frame. If 'interlaced' is true, then every other line is ommited from the scan, so if eg x=0,y=1, then scanlines 1,3,5,7 etc are scanned, if eg x=0,y=4 then scanlines 4,6,8,10 etc are scanned. The 'h' coord specifies the full height scan ie same whether interlaced is true or false, although it will not matter if the 'h' coord is specified as eg odd or even, internally the height 'h' is reduced by 1 when interlaced=true and 'h' is even. Optional mask clip Planar ONLY [v2.6 colorpspaces OK] The Planar mask clip, governs which pixels are processed by the functions. Where a luma pixel in selected area of the the mask clip is in range "MaskMin" to "MaskMax" inclusive, then those pixels will be processed. Mask MUST, be same dimensions and have at least the same number of frames as clip c. Calling without mask OR with MaskMin=0,MaskMax=255 will effectively ignore the mask and scan full x,y,w,h area. The Chan arg specifies which R or G or B channel to process [the multi-functional RT_RgbChanStats() function also allows a Chan arg of -1, which processes R and G and B simulaneously for all functions selected by flgs arg, also allowed is chan arg of -2 which additionally processes the ALPHA channel if RGB32 but throws an error if RGB24]. Default Chan is 0 (Red), 1 = Green, 2=Blue channel and 3=ALPHA channel when RGB32 ONLY else error. Code:
RT_RgbChanStats(clip c,int "n"=current_frame,int "delta"=0,int "x"=0,int "y"=0,int "w"=0,int "h"=0,bool "interlaced"=false,
float "threshold"=0.0,int "chan"=0,int "lo"=128,int "hi"=lo,int "flgs"=255,string "prefix"="RCS_",
float "mu"=0.0,int "d"=1,int "p"=1,int "u"=1,int "mask"=NOT_USED, int "MaskMin"=128,"MaskMax"=255)
Returns multiple results as for above single frame RGB channel sampling functions as Global Variables (prefixed with the prefix string arg).
The args up to "interlaced", are as for all other clip functions, "threshold" used only for "RT_RgbChanMin", "RT_RgbChanMax" and
"RT_RgbChanMinMaxDifference" equivalent routines with same functionality.
"lo" and "hi" are used only with the "RT_RgbChanInRange" equivalent routine with same functionality.
"mu" and "d" and "p" and "u" are used only with the "RT_RgbChanPNorm" equivalent routine with same functionality.
The new arg "Flgs" selects which results you want returned and the string "Prefix" that is prepended
to the returned global variable names.
The actual return result is a copy of the flgs args with any non valid bits reset, ie the global variables that were set.
Global variables are NOT altered for any function not selected in flgs.
Returns 0 if no pixels found in search area of mask within MaskMin and MaskMax.
Flgs_Bit_Number Add_To_Flgs Equivalent_Function Global_Var_Set_Excluding_Prefix_and_Chan_postfix
0 1($01) RT_RgbChanMin() "Min" (0->255)
1 2($02) RT_RgbChanMax() "Max" (0->255)
2 4($04) RT_RgbChanMinMaxDifference() "MinMaxDiff" (0->255)
3 8($08) RT_RgbChanMedian() "Med" (0->255)
4 16($10) RT_RgbChanAve() "Ave" (0.0->255.0)
5 32($20) RT_RgbChanStdev() "Stdev" (0.0->255.0)
6 64($40) RT_RgbChanInRange() "InRng" (0.0->1.0)
7 128($80) RT_RgbChanPNorm() "PNorm" (0.0->??? depends upon d and u)
The Channel Postfix is of the form "_0", where 0 is RED, 1 is GREEN and 2 is Blue, 3 is ALPHA(RGB32 ONLY), and is appended to the
base name described above. So eg RT_RgbChanMin for RED channel 0 with default Prefix is "RCS_Min_0".
RT_RgbChanstats() allows you to inquire multiple results simultaneously, with not much more overhead than calling a single individual
routine, however, you should not select sub functions that you dont need as there may be an additional unnecessary overhead.
The Default flgs=255($FF) are all bits set and so sets ALL global vars at once.
RT_RgbChanStats(flgs=1+2+16) would set global vars "RCS_Min_0", "RCS_Max_0" and "RCS_Ave_0" for full frame current_frame, Red Channel.
In addition to above Global Variables, RT_RgbChanStats() sets an int Global variable (where default prefix) of "RCS_PixelCount_0" being
the number of Red Channel pixels in mask area X,Y,W,H between MaskMin and MaskMax inclusive.
NOTE, RT_RgbChanStats() allows Chan to be -1, where ALL three R, and G, and B channels are processed simultaneouly for ALL functions
selected by flgs arg (ALPHA Channel is NOT processed).
A chan arg of -2 (RGB32 ONLY allowed) will additionally process the ALPHA channel as well as R+G+B.
Also Note, (where default Prefix) RCS_PixelCount_x is also set (identically) for all channels when Chan == -1 or -2.
__________________
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; 28th September 2013 at 20:21. |
|
|
|
|
|
#160 | Link |
|
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 11,406
|
Short lived v1.24 posted above, have decided to change RT_String() Esc arg to int, 0 = no escape conversion, 1 = conversion only in format string,
2 = convert escape sequences in both format string and inserted data strings, default 1. Will update zip on mediafire soon. (dont bother downloading v1.24).
__________________
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; 28th September 2013 at 19:03. |
|
|
|
![]() |
| Tags |
| averageluma, correlation, lumadifference, runtime |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|