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.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 16th January 2012, 18:29   #1  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
ShowChannels() v0.09 - 15 Jan 2019

ShowChannels(), (c) 2012/2019 StainlessS,
Requires VS2008 CPP runtimes.

Plugins for Avisynth v2.5 & v2.6, x86 & x64

Planar, YUY2 and RGB.
Code:
  v0.0, 1st public release.
  v0.1, 16 Jan  2012, better formatting, added MinPerc/MaxPerc args.
  v0.2, 15 Sept 2012, Fixed RGB offset bug.
  v0.3beta, 7 Oct 2012, Added Setvar stuff
  v0.4, 15 Oct 2012, Added AccFile
  v0.5, 31 Oct 2012, Added x,y,w,h coords, not colorspace restricted (real pain in the bum to implement).
      Can use odd coords for eg YV12, and even sample a single pixel.
  v0.6, 05 Dec 2012. Added Interlaced arg for Planar only. Now gets correct chroma for planar interlaced , even down to single pixel.
  v0.7, 20 Apr 2013, Added Compile for v2.6 stuff.
  v0.8, 30 Mar 2015, v2.6 dll compile with Avisynth Version 6 Header.
  v0.9, 15 Jan 2019, Moved to VS2008, Added version resource + x64.
Code:
ShowChannels(), (c) 2012/2019 StainlessS,     https://forum.doom9.org/showthread.php?t=163829
Requires VS2008 CPP runtimes.

Plugins for Avisynth v2.5 & v2.6, x86 & x64

Planar, YUY2 and RGB.

Simple plugin whose only function is to display the average Y,U and V
values for a YUV frame or R,G, and B for an RGB frame.
Also shows accumulated average for all frames visited so far.

Typical output for a YUV clip:-
---------------------------

347 ] Frames Visited = 348

          This Frame           Accumulated
       Y     U      V        Y     U      V
 Ave  77.00 125.52 125.42   70.91 125.87 125.78
 Min   4     80     95       0     69     83
 Max 255    177    165     255    190    174
~Min  14     95    101      12     92    101
~Max 234    167    148     235    167    151

---------------------------

where
 'AVE' shows average for current frame and accumulated average for all visited frames.

 'MIN' shows minimum value for a channel, this frame and accumulated.

 'MAX' shows maximum value for a channel, this frame and accumulated.

 '~MIN' shows loose minimum value for a channel, this frame and accumulated.

 '~MAX' shows loose maximum value for a channel, this frame and accumulated.

Loose minimum uses the filter arg float MinPerc, a percentage of total pixels to ignore
when finding the loose minimum, allows to ignore extreme stray pixels (noise).

Loose maximum uses the filter arg float MaxPerc, a percentage of total pixels to ignore
when finding the loose maximum, allows to ignore extreme stray pixels (noise).

The "loose" values are made to filter out very bright
or very dark noise creating an artificially low or high minimum / maximum.

The Accumulated Ave is a "Average of Averages", or "Average Mean" or "Mean Average", take your pick but accumulated seemed more appropriate
considering that it was not restricted to describing just the averages. Accumulated Min is the minimum of all minimums so far, etc.

Usage:-

ShowChannels(clip c,float "MinPerc"=0.1, float "MaxPerc"=0.1, bool "ver"=false,bool "Setvar"=false,String "Prefix"="SC_", \
         bool "Show"=true,String ="AccFile"="",int "x"=0,int "y"=0,int "w"=0,int "h"=0,bool "Interlaced"=false)

  Where:-
    c is the clip

    MinPerc is percentage of pixels to ignore for loose minimum. (default 0.1%, ie 1/1000 of total pixels)
    ColorYUV (Analyze=true) Loose Minimum ignores 1/256 of the darkest pixels, and ShowChannels 0.1% or 1/1000 by default,
    so a Minperc of 0.4% would be about the same as ColorYUV uses.

    MaxPerc is percentage of pixels to ignore for loose maximum. (default 0.1%, ie 1/1000 of total pixels)
    ColorYUV (Analyze=true) Loose Maximum ignores 1/256 of the lightest pixels, and ShowChannels 0.1% or 1/1000 by default,
    so a Maxperc of 0.4% would be about the same as ColorYUV uses.

    ver display version info, false OFF [default] , true ON

    Setvar if true then sets Global Variables using Prefix string.

    Prefix (default "SC_"), prefix to Global variable names when using SetVar.

    Show, false switches off normal text display, you may want to set false if using SetVar.

    AccFile, default "", name of text file to output final Accumulated values for entire file.

    x,y,w,h, sets coordinates, all default to 0 as for crop, ie full image. NOT colorspace limited, eg can use odd values
      even for YV12 and YUY2.

    Interlaced (default false). Planar formats only, alters interpretation for the chroma, false=Progressive, true=interlaced.

    Default Global variable names when SetVar=true and using Default Prefix = "SC_"

      "SC_Visited"    = Frames visited

      Channel 0 (Y or R)
      "SC_Ave_0","SC_Min_0","SC_Max_0","SC_LMn_0","SC_LMx_0","SC_AAve_0","SC_AMin_0","SC_AMax_0","SC_ALMn_0","SC_ALMx_0",
      Channel 1 (U or G, NOT Y8)
      "SC_Ave_1","SC_Min_1","SC_Max_1","SC_LMn_1","SC_LMx_1","SC_AAve_1","SC_AMin_1","SC_AMax_1","SC_ALMn_1","SC_ALMx_1",
      Channel 2 (V or B, NOT Y8)
      "SC_Ave_2","SC_Min_2","SC_Max_2","SC_LMn_2","SC_LMx_2","SC_AAve_2","SC_AMin_2","SC_AMax_2","SC_ALMn_2","SC_ALMx_2",

      For Y8, channels 1 and 2 will all be set to -1
--------------------------------------------------------------------------------
Typical Global Variable settings for RGB something like:-

    SC_Ave_0=124.55    SC_Ave_1=126.06    SC_Ave_2=199.77
    SC_Min_0=0         SC_Min_1=0         SC_Min_2=0
    SC_Max_0=255       SC_Max_1=255       SC_Max_2=255
    SC_LMn_0=0         SC_LMn_1=0         SC_LMn_2=0
    SC_LMx_0=255       SC_LMx_1=255       SC_LMx_2=255
    SC_AAve_0=129.24   SC_AAve_1=132.12   SC_AAve_2=126.68
    SC_AMin_0=0        SC_AMin_1=0        SC_AMin_2=0
    SC_AMax_0=255      SC_AMax_1=255      SC_AMax_2=255
    SC_ALMn_0=0        SC_ALMn_1=0        SC_ALMn_2=0
    SC_ALMx_0=255      SC_ALMx_1=255      SC_ALMx_2=255
--------------------------------------------------------------------------------
Contents of AccFile for a small sample clip showing typical output using defaults:

SC_AAve_0=98.971779  SC_AMin_0=0  SC_AMax_0=255 SC_ALMn_0=14  SC_ALMx_0=241
SC_AAve_1=122.572746 SC_AMin_1=66 SC_AMax_1=200 SC_ALMn_1=99  SC_ALMx_1=160
SC_AAve_2=137.286911 SC_AMin_2=72 SC_AMax_2=209 SC_ALMn_2=108 SC_ALMx_2=175
SC_Visited=4000

--------------------------------------------------------------------------------

Lastly, you may find it better to crop off any borders when ascertaining frame/accumulated values, or set coordinates to suit.

ssS
Available from Mediafire via below sig:-

Zip includes 3 dll's, + source + full VS2008 project files for easy rebuild. (~128KB)

EDIT:
Code:
AviSource("D:\Parade.avi")
Showchannels(ver=True)
__________________
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; 16th January 2019 at 19:21. Reason: Update
StainlessS is offline   Reply With Quote
Old 15th September 2012, 10:09   #2  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
New Version ShowChannels v0.2, Fixed RGB Offset Bug.
__________________
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 ???
StainlessS is offline   Reply With Quote
Old 20th September 2012, 00:57   #3  |  Link
jmac698
Registered User
 
Join Date: Jan 2006
Posts: 1,867
I'd like to use the values programmaticly.
jmac698 is offline   Reply With Quote
Old 20th September 2012, 14:15   #4  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
From this thread (1st post):-
http://forum.doom9.org/showthread.php?t=165479

Code:
# Requires GScript and ShowChannels plugins. 
AviSource("D:\avs\avi\1.avi").trim(0,0999)

  Sum = 0.0
  SumHi=0.0    # Hi part Extra precision (need for long scans)
  SumLo=0.0    # Lo part Extra precision
  GScript("""
    for(n=0,FrameCount()-1) {
      Tmp = RT_AverageLuma(n)      
      RT_Debug("RT_Debug:","["+String(n)+"]","AveLuma = "+String(Tmp)) # Real Time Debug Info using DebugView
#       Sum = Sum + Tmp    # Were gonna use extra precision instead    
      SumLo = SumLo + Tmp
      SumHi = SumHi + floor(SumLo / 256.0)  # Hi part, Extra Precision
      SumLo = frac(SumLo / 256.0) * 256.0   # Lo part, Extra Precision
    }
  """)
#   Sum=Sum/Float(FrameCount())     # Were gonna use extra precision instead
  Sum = (SumHi / Float(FrameCount()) * 256.0) + (SumLo / Float(FrameCount()))
  s=ShowChannels(ver=true)          # Show eg Ave Luma for frame and Accumulated Ave luma for all frames visited
  s.Subtitle(String(Sum),Align=1)
  
# The sum variable shown on bottom left via Subtitle, is the accumulated Average Luma for entire clip, will be valid on the LAST FRAME.
# ShowChannels used for result comparison.
The extra precision is recommended, although you might want to use the Avisynth built in runtime funcs (if Planar only).

EDIT: the only other sensible way would I think be use env->invoke() in plugin to set some Global vars
in the scripts, but some thought might be needed in the naming of the global vars, ie
YUV current and Accumulated, RGB same and Y same in Y8. Maybe use channel numbers rather than eg "Y" or "R"
and take care over Y8.
You have the source, should not be too hard to figure out the invoke thing. (I've never used invoke but there are several
threads in development on using it).

EDIT: Sorry, I'm a bit otherwise involved at the moment.
__________________
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; 20th September 2012 at 19:47.
StainlessS is offline   Reply With Quote
Old 20th September 2012, 22:55   #5  |  Link
IanB
Avisynth Developer
 
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,167
You don't need to env>Invoke() for vars, just env->SetGlobalVar()
IanB is offline   Reply With Quote
Old 21st September 2012, 09:00   #6  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Thankyou Mr B, musta been half asleep.

@Jmac,
OK, I've got a hour or so, I will I think use SetVar, using a user selected name prefix
defaulting to eg "SC_", resulting eg "SC_Ave_" & "SC_AAve_" [Accumulated] and appending "0=x" where x is return value for
channel 0 (Y=R=0,U=G=1,V=B=2). Unused values in Y8 will be given a value of -1.

Typical return for RGB something like:-

Code:
SC_Ave_0=124.55    SC_Ave_1=126.06    SC_Ave_2=199.77
SC_Min_0=0         SC_Min_1=0         SC_Min_2=0
SC_Max_0=255       SC_Max_1=255       SC_Max_2=255
SC_LMn_0=0         SC_LMn_1=0         SC_LMn_2=0
SC_LMx_0=255       SC_LMx_1=255       SC_LMx_2=255
SC_AAve_0=129.24   SC_AAve_1=132.12   SC_AAve_2=126.68
SC_AMin_0=0        SC_AMin_1=0        SC_AMin_2=0
SC_AMax_0=255      SC_AMax_1=255      SC_AMax_2=255
SC_ALMn_0=0        SC_ALMn_1=0        SC_ALMn_2=0
SC_ALMx_0=255      SC_ALMx_1=255      SC_ALMx_2=255
Also, see here for some nice work in wiki by Wilbert on CPP interface:-
http://avisynth.org/mediawiki/index....=Cplusplus_API
http://avisynth.org/mediawiki/index...._API/VideoInfo
__________________
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; 21st September 2012 at 09:10.
StainlessS is offline   Reply With Quote
Old 7th October 2012, 16:08   #7  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Jmac,

Here is beta (source incl), dont know if implemented correctly as no idea how SetGlobalVar should be called (env->SaveString)
but seems to be alright, give it a go, temporary link here:
EDIT: LINK REMOVED. See 1st post.

EDIT: Used env->SaveString for variable names in constructor only.
EDIT: You can ignore the beta status, env->SaveString is used correctly.

Code:
ShowChannels() v0.3beta

(c) 2012 StainlessS

Plugin for Avisynth 2.5

Planar, YUY2 and RGB.

Simple plugin whose only function is to display the average Y,U and V 
values for a YUV frame or R,G, and B for an RGB frame.
Also shows accumulated average for all frames visited so far.

Typical output for a YUV clip:-
---------------------------

347 ] Frames Visited = 348

          This Frame           Accumulated
       Y     U      V        Y     U      V
 Ave  77.00 125.52 125.42   70.91 125.87 125.78
 Min   4     80     95       0     69     83
 Max 255    177    165     255    190    174
~Min  14     95    101      12     92    101
~Max 234    167    148     235    167    151

---------------------------

where
 'AVE' shows average for current frame and accumulated average for all visited frames.

 'MIN' shows minimum value for a channel, this frame and accumulated.

 'MAX' shows maximum value for a channel, this frame and accumulated.

 '~MIN' shows loose minimum value for a channel, this frame and accumulated.

 '~MAX' shows loose maximum value for a channel, this frame and accumulated.

Loose minimum uses the filter arg float MinPerc, a percentage of total pixels to ignore
when finding the loose minimum, allows to ignore extreme stray pixels.

Loose maximum uses the filter arg float MaxPerc, a percentage of total pixels to ignore
when finding the loose maximum, allows to ignore extreme stray pixels.
      
Usage:-

ShowChannels(clip Last,float MinPerc, float MaxPerc, bool ver,bool "Setvar"=false,String "Prefix"="SC_",bool "Show"=true)

        Where:-
                Last is the clip

                MinPerc is percentage of pixels to ignore for loose minimum. (default 0.1%, ie 1/1000 of total pixels)

                MaxPerc is percentage of pixels to ignore for loose maximum. (default 0.1%, ie 1/1000 of total pixels)

                ver display version info, false OFF [default] , true ON


        BETA

        Setvar if true then sets Global Variables using Prefix.

        Prefix (default "SC_"), prefix to Global variable names.

        Show, false switches off normal display, set false if using SetVar.

    Default Global variable names when SetVar=true and using Default Prefix = "SC_"

    "SC_Visited"    = Frames visited

    Channel 0 (Y or R)
    "SC_Ave_0","SC_Min_0","SC_Max_0","SC_LMn_0","SC_LMx_0","SC_AAve_0","SC_AMin_0","SC_AMax_0","SC_ALMn_0","SC_ALMx_0",
    Channel 1 (U or G, NOT Y8)
    "SC_Ave_1","SC_Min_1","SC_Max_1","SC_LMn_1","SC_LMx_1","SC_AAve_1","SC_AMin_1","SC_AMax_1","SC_ALMn_1","SC_ALMx_1",
    Channel 2 (V or B, NOT Y8)
    "SC_Ave_2","SC_Min_2","SC_Max_2","SC_LMn_2","SC_LMx_2","SC_AAve_2","SC_AMin_2","SC_AMax_2","SC_ALMn_2","SC_ALMx_2",

    For Y8, channels 1 and 2 will all be set to -1
A test script (Included)

Code:
Avisource("D:\avs\avi\1.avi").ConvertToYV12() #.Trim(0,100)

A=showchannels()
showchannels(setvar=true,show=false)
ScriptClip("""
	Line0 = "Visited = "+String(SC_Visited)
	Line1 = (IsRGB()) ? "              R          G           B          R          G           B"
		\ :"              Y          U           V          Y          U           V"
	Line2 = "Ave = "+String(SC_Ave_0,"%0.2f")+"  "+String(SC_Ave_1,"%0.2f")+"  "+String(SC_Ave_2,"%0.2f") + "    "+String(SC_AAve_0,"%0.2f")+
	\ "  "+String(SC_AAve_1,"%0.2f")+"  "+String(SC_AAve_2,"%0.2f")
	Line3 = "Min =  "+String(SC_Min_0)+"         "+String(SC_Min_1)+"         "+String(SC_Min_2)+"           "+String(SC_AMin_0)+"         "
	\ +String(SC_AMin_1)+"         "+String(SC_AMin_2)
	Line4 = "Max =  "+String(SC_Max_0)+"      "+String(SC_Max_1)+"        "+String(SC_Max_2)+"         "+String(SC_AMax_0)+"       "
	\ +String(SC_AMax_1)+"       "+String(SC_AMax_2)
	Line5 = "LMn =  "+String(SC_LMn_0)+"       "+String(SC_LMn_1)+"        "+String(SC_LMn_2)+"         "+String(SC_ALMn_0)+"         "
	\ +String(SC_ALMn_1)+"       "+String(SC_ALMn_2)
	Line6 = "LMx =  "+String(SC_LMx_0)+"      "+String(SC_LMx_1)+"        "+String(SC_LMx_2)+"         "+String(SC_ALMx_0)+"       "
	\ +String(SC_ALMx_1)+"       "+String(SC_ALMx_2)
	
#	Subtitle(line0,y=00)
#	Subtitle(line1,y=20)
#	Subtitle(line2,y=40)
#	Subtitle(line3,y=60)
#	Subtitle(line4,y=80)
#	Subtitle(line5,y=100)
#	Subtitle(line6,y=120)
	
	lines = line0+"\n"+line1+"\n"+line2+"\n"+line3+"\n"+line4+"\n"+line5+"\n"+line6
	Subtitle(lines,y=0,lsp=20)


""",after_frame=True)		# Important, after_frame=True
StackHorizontal(A,Last)
return last
EDIT: Methinks we can expect a color correction script.
__________________
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; 21st October 2012 at 18:44.
StainlessS is offline   Reply With Quote
Old 8th October 2012, 04:48   #8  |  Link
Mounir
Registered User
 
Join Date: Nov 2006
Posts: 773
I still don't have a clue what the loose values mean ? Anyone knows ?
Mounir is offline   Reply With Quote
Old 8th October 2012, 05:13   #9  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Code:
Loose minimum uses the filter arg float MinPerc, a percentage of total pixels to ignore
when finding the loose minimum, allows to ignore extreme stray pixels.

Loose maximum uses the filter arg float MaxPerc, a percentage of total pixels to ignore
when finding the loose maximum, allows to ignore extreme stray pixels.
Same as loose minimum/maximum in ColorYUV Analyze=true
Code:
analyze can be true or false. This will print out color statistics on the screen. 
There are maximum and minimum values for all channels. 
There is an average for all channels.
There is a "loose maximum" and "loose minimum". The "loose" values are made to filter out very bright
or very dark noise creating an artificially low or high minimum / maximum.
__________________
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 October 2012 at 05:29.
StainlessS is offline   Reply With Quote
Old 8th October 2012, 09:21   #10  |  Link
Mounir
Registered User
 
Join Date: Nov 2006
Posts: 773
That's interesting. So if i believe this info i should pay more attention to these loose values because they return more accurate values (noise in dark/bright areas being eliminated of the equation)

I like the accumulated feature but it would be even better if we could analyse a whole video automatically and get the result in a text file because currently i do it manually and skip many frames doing so (in avspmod)...not very accurate

keep up the good work
Mounir is offline   Reply With Quote
Old 8th October 2012, 18:33   #11  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
YPlaneMin/YPlaneMax has the same sort of thing where what I've called 'MinPerc/MaxPerc' uses name of 'Threshold'.

Code:
YPlaneMin   |   v2.x   |   YPlaneMin(clip, float threshold) 
YPlaneMax   |   v2.x   |   YPlaneMax(clip, float threshold) 

threshold is a percentage, stating how many percent of the pixels are allowed above or below minimum.
The threshold is optional and defaults to 0.
The Accumulated Ave is a "Average of Averages", or "Average Mean" or "Mean Average", take your pick but accumulated seemed more appropriate
considering that it was not restricted to describing just the averages. Accumulated Min is the minimum of all minimums so far, etc.

Comment From ColorYUV source
Code:
 // When 1/256th of all pixels have been reached, trigger "Loose min/max"
So ColorYUV ignores 1/256 of the darkest/lightest pixels, YPlaneMin ignores 0% default, and ShowChannels 0.1% or 1/1000 by default,
so a Minperc/Maxperc of 0.4% would be about the same as ColorYUV uses.

You could write a script which outputs the final accumulated Showchannels values to a file where eg
SC_AAve_1 (U) and SC_AAve_2 (V) might suggest a correction to a color cast imperfection, in a perfect world
you might expect the accumulated average to be ~128. (EDIT: correctable in ColorYUV using off_u and off_v)
For accumulated Ave luma, I would think that gamma might have to be taken into consideration, it tends to be lower
than 128 for YUV. EDIT: or 126 for mid point of 16-235

EDIT:
@Mounir
What format would you want the file to be written ?
Just final accumulated values for entire file?
__________________
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; 9th October 2012 at 11:37.
StainlessS is offline   Reply With Quote
Old 9th October 2012, 04:20   #12  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
@Jmac698

You seem not to read prior to the last post in a thread, tried to PM you to say, "See post #7",
BUT, your PM box is FULL (must be nice to be so popular).
__________________
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; 9th October 2012 at 04:22.
StainlessS is offline   Reply With Quote
Old 15th October 2012, 03:28   #13  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
ShowChannels() v0.4, New version, 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 ???
StainlessS is offline   Reply With Quote
Old 21st October 2012, 22:51   #14  |  Link
jmac698
Registered User
 
Join Date: Jan 2006
Posts: 1,867
Ok, got it - nice!
For another purpose, including a box region to sample would be very convenient. Yes I can do something with crop, but it's a bit awkward, plus I do need to use full luma precision in some cases, well actually I do.

What I'm thinking of is a color correction script where you've got recorded colorbars. These take 1/7 the width of the video line, and can end up on odd pixels, at least when measuring the luma part.

What I'd do is find the accumulated average (for accuracy against noise) over several frames in 7 separate regions. I'll be using the values for all planes, but bear in mind they have diffrent resolutions too. It would be nice too to return the hue and saturation values instead of plain "plane" u v. It's just atan2(u,v) and sqrt(u*u+v*v) (but don't quote me on that, really you have to look it up).
Of course I can calculate that in script, it's just convenient.
jmac698 is offline   Reply With Quote
Old 21st October 2012, 23:37   #15  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Quote:
and can end up on odd pixels, at least when measuring the luma part.
Single region to examine, accepted.

I think, I like the Unix type model of restriction to a simple function, but doing it flexibly and well. H & S feels like another filter.
I'll take a look at doing the 1st part, if I ever do the second, it will be some time, I've got a load of stuff I've been heaping on the
back burner and I really want to get that backlog cleared.
__________________
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 ???
StainlessS is offline   Reply With Quote
Old 22nd October 2012, 00:25   #16  |  Link
jmac698
Registered User
 
Join Date: Jan 2006
Posts: 1,867
Hmm, it doesn't feel different to me at all - in fact it sounds more appropriate. If this is truly a video oriented filter, we should always be talking in terms of luma hue and saturation. This U/V planes business is very low level and you rarely ever refer to it directly.
So as such, it's a purely mathematical filter on an internal representation of video, very low level, and not very video-sih.
jmac698 is offline   Reply With Quote
Old 22nd October 2012, 01:04   #17  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
And how would one calc the average HUE (of a clip), being circular in nature, also, min/max loose min/max and accumulated,
would not really make sense, and way too specific a function measuring eg one specific color in colorbars. If it can
be done as required in script then would be a shame to cripple speed even a little just for that one off functionality.

EDIT:
You have the source, you can do a specific version to do exactly as you require, eg ShowHSL or whatever..
__________________
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; 22nd October 2012 at 01:51.
StainlessS is offline   Reply With Quote
Old 22nd October 2012, 01:11   #18  |  Link
Mounir
Registered User
 
Join Date: Nov 2006
Posts: 773
What about implementing a slice display graph and gamut display
more info here: http://www.synthetic-ap.com/products/tg/index.html
Mounir is offline   Reply With Quote
Old 22nd October 2012, 01:32   #19  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Looks like (I think Wilbert's) VScope.

I really want to get away from doing user suggested mods, I have things I really would like to get running and will
have limited time to do so from a few weeks hence. Perhaps Jmac will incorporate the slice & gamut display
in his new plugin ShowHSL(). Hehe
__________________
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 ???
StainlessS is offline   Reply With Quote
Old 22nd October 2012, 02:03   #20  |  Link
jmac698
Registered User
 
Join Date: Jan 2006
Posts: 1,867
The plugin is still useful (at least to me), I'm just saying it makes sense to call it a low-level mathematical plugin, and that's fine if that's what you want it to be.

As for user mods, well that is really part of the fun of coding, getting the feedback and being helpful, and receiving praise. For example I loved following AvsP development, he did a great job of taking suggestions and people were really happy, and I think that's one of the reasons it's such a great program.

Of course, most of us do a plugin mainly for our own uses at first, and there is limited time. These suggestion were certainly not critical, just enhancements.

There's a min/max hue, even though it's circular. Take the average and find the CCW and CW values from that. Let's say in noisy colourbars, it's +-3% of some roughly reddish colour. That makes sense to me.

If all hues are present, you get +- 180degrees, of course.
jmac698 is offline   Reply With Quote
Reply

Tags
channels, info, max, min

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:59.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.