DeBarrel

From Avisynth wiki
(Difference between revisions)
Jump to: navigation, search
(Description)
m (Removed space between negative sign and actual number (Between - 0.5 to 0.5 -> Between -0.5 to 0.5))
 
(8 intermediate revisions by one user not shown)
Line 10: Line 10:
 
|6=<!-- discussion URL -->[https://forum.doom9.org/showthread.php?t=136083&highlight=DeBarrel Original DeBarrel plugin], [https://forum.doom9.org/showthread.php?t=174163 movePlus]
 
|6=<!-- discussion URL -->[https://forum.doom9.org/showthread.php?t=136083&highlight=DeBarrel Original DeBarrel plugin], [https://forum.doom9.org/showthread.php?t=174163 movePlus]
 
}}
 
}}
<br>
 
  
 +
<br>
 
== Description ==
 
== Description ==
 
<!-- a one-sentence description -->
 
<!-- a one-sentence description -->
Line 17: Line 17:
  
 
<br>
 
<br>
 
 
== Requirements ==
 
== Requirements ==
 
* AviSynth+ r2347 or later
 
* AviSynth+ r2347 or later
Line 23: Line 22:
 
<br>
 
<br>
 
== [[Script variables|Syntax and Parameters]] ==
 
== [[Script variables|Syntax and Parameters]] ==
:{{Template:FuncDef|<!-- function name -->Barrel (''clip'', ''<!-- par 1 type -->float'' "<!-- par 1 name -->a", ''<!-- par 2 type -->float'' "<!-- par 2 name -->b", ''<!-- par 3 type -->float'' "<!-- par 3 name -->c", ''<!-- par 4 type -->bool'' "<!-- par 4 name -->pin", ''<!-- par 5 type -->bool'' "<!-- par 5 name -->test", ''<!-- par 6 type -->float'' "<!-- par 6 name -->ea", ''<!-- par 7 type -->float'' "<!-- par 7 name -->eb", ''<!-- par 8 type -->float'' "<!-- par 8 name -->ec",, ''<!-- par 9 type -->int'' "<!-- par 9 name -->nsteps", ''<!-- par 10 type -->int'' "<!-- par 10 name -->frame", ''<!-- par 11 type -->int'' "<!-- par 11 name -->color",''<!-- par 12 type -->float'' "<!-- par 12 name -->vh",''<!-- par 13 type -->bool'' "<!-- par 13 name -->ind",''<!-- par 14 type -->float'' "<!-- par 14 name -->ya",''<!-- par 15 type -->float'' "<!-- par 15 name -->yb",''<!-- par 16 type -->float'' "<!-- par 16 name -->yc", ''<!-- par 17 type -->float'' "<!-- par 17 name -->yea", ''<!-- par 18 type -->float'' "<!-- par 18 name -->yeb", ''<!-- par 19 type -->float'' "<!-- par 19 name -->yec", ''<!-- par 20 type -->bool'' "<!-- par 20 name -->ypin",)}}
+
:{{Template:FuncDef| Barrel (clip, float "a", float "b", float "c", bool "pin", float "vh", bool "test", float "ea", float "eb", float "ec", int "nsteps", Int "frame", Int "color", bool "ind", bool "ypin", float "ya", float "yb", float "yc", float "yea", float "yeb", float "yec")}}
 
<br>
 
<br>
 
::{{Par2| |clip| }}
 
::{{Par2| |clip| }}
:::Input clip.     
+
::: Input clip
 
<br>
 
<br>
::{{Par2|<!-- par 1 type -->float|<!-- par 1 name -->a|<!-- par 1 default value -->0.005}}
+
::{{Par2|a|float|0.005}}
:::<!-- par 1 description -->distortion coefficient a .
+
::: Coefficient a (xa in independent mode and start val in test mode)
 +
::::* Between -0.5 and 0.5
 
<br>
 
<br>
::{{Par2|<!-- par 2 type -->float|<!-- par 2 name -->b|<!-- par 2 default value -->0.005}}
+
::{{Par2|b|float|0.005}}
:::<!-- par 2 description -->distortion coefficient b .
+
::: Coefficient b (xb in independent mode and start val in test mode)
 +
::::* Between -0.5 and 0.5
 
<br>
 
<br>
::{{Par2|<!-- par 3 type -->float|<!-- par 3 name -->c|<!-- par 3 default value -->0.005}}
+
::{{Par2|c|float|0.005}}
:::<!-- par 3 description -->distortion coefficient c .
+
::: Coefficient c (xc in independent mode and start val in test mode)
 
+
::::* Between -0.5 and 0.5
 
<br>
 
<br>
::{{Par2|<!-- par 4 type -->bool|<!-- par 4 name -->pin|<!-- par 4 default value -->false}}
+
::{{Par2|pin|bool|false}}
:::<!-- par 4 description -->Is distortion pin cushion type?.
+
::: Whether to correct pin cushion or barrel type distortion
 +
::::* true = pin
 +
::::* false = barrel
 
<br>
 
<br>
::{{Par2|<!-- par 5 type -->bool|<!-- par 5 name -->test|<!-- par 5 default value -->false}}
+
::{{Par2|vh|bool|1.0}}
:::<!-- par 5 description -->Is this a test run?
+
::: Vertical to horizontal distortion ratio
 +
::::* Between 0.1 and 10
 
<br>
 
<br>
::{{Par2|<!-- par 6 type -->float|<!-- par 6 name -->ea|<!-- par 6 default value -->a}}
+
::{{Par2|test|bool|false}}
:::<!-- par 6 description -->distortion coefficient a at end step of test run.Value required only if test is true  
+
::: Whether in test mode
 +
::::* true = test
 +
::::* false = normal
 
<br>
 
<br>
::{{Par2|<!-- par 7 type -->float|<!-- par 7 name -->eb|<!-- par 7 default value -->b}}
+
::{{Par2|ea|float|0.05}}
:::<!-- par 7 description -->distortion coefficient b at end step of test run.Value required only if test is true.
+
::: End value of coefficient a in test mode (xea in independent mode)
 +
::::* Between -0.5 and 0.5
 
<br>
 
<br>
::{{Par2|<!-- par 8 type -->float|<!-- par 8 name -->ec|<!-- par 8 default value -->c}}
+
::{{Par2|eb|float|0.05}}
:::<!-- par 8 description -->distortion coefficient c at end step of test run.Value required only if test is true.
+
::: End value of coefficient b in test mode (xeb in independent mode)
 +
::::* Between -0.5 and 0.5
 
<br>
 
<br>
::{{Par2|<!-- par 9 type -->int|<!-- par 9 name -->nsteps|<!-- par 9 default value -->20}}
+
::{{Par2|ec|float|0.05}}
:::<!-- par 9 description -->number of steps parameters a, b, c to reach values ea, eb and ec in test run..
+
::: End value of coefficient c in test mode (xec in independent mode)
 +
::::* Between -0.5 and 0.5
 
<br>
 
<br>
::{{Par2|<!-- par 10 type -->int|<!-- par 10 name -->frame|<!-- par 10 default value -->0}}
+
::{{Par2|nsteps|int|20}}
:::<!-- par 10 description -->frame number to be used in test run.
+
::: Number of steps for variation (test mode only)
 +
::::* Between 0 and 100
 
<br>
 
<br>
::{{Par2|<!-- par 11 type -->int|<!-- par 11 name -->color|<!-- par 11 default value -->0}}
+
::{{Par2|frame|Int|0}}
:::<!-- par 11 description -->color value as rrggbb to be used to mark distortion pattern in test run.
+
::: Input frame number for over lay (test mode only)
 +
::::* Within input clip
 
<br>
 
<br>
::{{Par2|<!-- par 12 type -->float|<!-- par 12 name -->vh|<!-- par 12 default value -->1.0}}
+
::{{Par2|color|Int|0}}
:::<!-- par 12 description -->in case of cinemascope or other cases wherein width or height is elongated ratio of vertical to horizontal over normal.
+
::: Color of dots in test mode and left out borders in normal
 +
::::* In RRGGBB format
 
<br>
 
<br>
::{{Par2|<!-- par 13 type -->bool|<!-- par 13 name -->ind|<!-- par 13 default value -->false}}
+
::{{Par2|ind|bool|false}}
:::<!-- par 13 description -->Does horizontal and vertical distortions have independent coefficients?.
+
::: Whether x and y have independent coefficients
 +
::::* true for independent
 +
::::* false for pin cushion or barrel
 
<br>
 
<br>
::{{Par2|<!-- par 14 type -->float|<!-- par 14 name -->ya|<!-- par 14 default value -->a}}
+
::{{Par2|ypin|bool|false}}
:::<!-- par 14 description -->distortion coefficient for vertical ya (in case ind = true)
+
::: Whether Y direction has pin cushion distortion?
 +
::::* true for pin cushion
 +
::::* false for barrel
 
<br>
 
<br>
::{{Par2|<!-- par 15 type -->float|<!-- par 15 name -->yb|<!-- par 15 default value -->b}}
+
::{{Par2|ya|float|0.05}}
:::<!-- par 15 description -->distortion coefficient for vertical yb (in case ind = true).
+
::: Value of coefficient ya (start value in test mode )
 +
::::* Between -0.5 and 0.5
 
<br>
 
<br>
::{{Par2|<!-- par 16 type -->float|<!-- par 16 name -->yc|<!-- par 16 default value -->c}}
+
::{{Par2|yb|float|0.05}}
:::<!-- par 16 description -->distortion coefficient for vertical yc (in case ind = true).
+
::: Value of coefficient yb (start value in test mode)
 +
::::* Between -0.5 and 0.5
 
<br>
 
<br>
::{{Par2|<!-- par 17 type -->float|<!-- par 17 name -->yea|<!-- par 17 default value -->a}}
+
::{{Par2|yc|float|0.05}}
:::<!-- par 17 description -->distortion coefficient at end step for vertical yea (in case ind = true and test = true)  
+
::: Value of coefficient yc (start value in test mode)
 +
::::* Between -0.5 and 0.5
 
<br>
 
<br>
::{{Par2|<!-- par 18 type -->float|<!-- par 18 name -->yeb|<!-- par 18 default value -->b}}
+
::{{Par2|yea|float|0.05}}
:::<!-- par 18 description -->distortion coefficient at end step  for vertical yeb (in case ind = true and test = true).
+
::: End value of coefficient ya (test mode only)
 +
::::* Between -0.5 and 0.5
 
<br>
 
<br>
::{{Par2|<!-- par 19 type -->float|<!-- par 19 name -->yec|<!-- par 19 default value -->c}}
+
::{{Par2|yeb|float|0.05}}
:::<!-- par 19 description -->distortion coefficient at end step  for vertical yc (in case ind = true and test = true).
+
::: End value of coefficient yb (test mode only)
<br>
+
::::* Between -0.5 and 0.5
::{{Par2|<!-- par 20 type -->bool|<!-- par 20 name -->ypin|<!-- par 20 default value -->false}}
+
:::<!-- par 20 description -->if vertical distortions have independent distortions, is it pin cushion type?.
+
 
<br>
 
<br>
 +
::{{Par2|yec|float|0.05}}
 +
::: End value of coefficient yc (test mode only)
 +
::::* Between -0.5 and 0.5
 +
 
<br>
 
<br>
  
 
== Examples ==
 
== Examples ==
 
<!-- example code block: 1st char in each line = space -->
 
<!-- example code block: 1st char in each line = space -->
  ## This is some example code to test for an image with independent distortions.
+
  blankclip(width = 720, height = 480, pixel_type = "RGB32", color = $ffffff, length = 10)
Avisource("example.avi").converttoRGB32()
+
grid()
   
+
  Barrel()
  Barrel(test=true,pin=false,  ind = true,a= 0.05,b= 0.011,c= 0.001, ea = .02, eb=0.012,ec= 0.001, ya= 0.1, yb= 0.011,yc= 0.001, yea= 0.01, yeb= 0.005, yec = 0.005 , ypin = true, color = $ffffff)
+
 
<!-- new code block: no leading space -->
+
Pin Cushion Distortion
 +
  Barrel(a = 0.005, b = 0.005, c = 0.005, pin = false)
  
## This is another example.
 
Avisource("example.avi").converttoYV12()
 
Barrel(a = 0.005, b = 0.0015, c = 0.0025,pin = false))
 
<br>
 
 
<br>
 
<br>
 
-----------------------------------------------
 
-----------------------------------------------
 
'''Back to [[External_filters|External Filters]] &larr;'''
 
'''Back to [[External_filters|External Filters]] &larr;'''

Latest revision as of 14:11, 19 June 2019


Abstract
Author V.C.Mohan
Version 30 Dec 2016
Download movePlus.7z
Category External filters
License GPLv3
Discussion Original DeBarrel plugin, movePlus


Contents

[edit] Description

Corrects Barrel type or Pin Cushion type distortions in an image that result in due to camera lens projecting image on to a flat film or sensor array. Full Description


[edit] Requirements

  • AviSynth+ r2347 or later


[edit] Syntax and Parameters

Barrel (clip, float "a", float "b", float "c", bool "pin", float "vh", bool "test", float "ea", float "eb", float "ec", int "nsteps", Int "frame", Int "color", bool "ind", bool "ypin", float "ya", float "yb", float "yc", float "yea", float "yeb", float "yec")


clip   =
Input clip


float  a = 0.005
Coefficient a (xa in independent mode and start val in test mode)
  • Between -0.5 and 0.5


float  b = 0.005
Coefficient b (xb in independent mode and start val in test mode)
  • Between -0.5 and 0.5


float  c = 0.005
Coefficient c (xc in independent mode and start val in test mode)
  • Between -0.5 and 0.5


bool  pin = false
Whether to correct pin cushion or barrel type distortion
  • true = pin
  • false = barrel


bool  vh = 1.0
Vertical to horizontal distortion ratio
  • Between 0.1 and 10


bool  test = false
Whether in test mode
  • true = test
  • false = normal


float  ea = 0.05
End value of coefficient a in test mode (xea in independent mode)
  • Between -0.5 and 0.5


float  eb = 0.05
End value of coefficient b in test mode (xeb in independent mode)
  • Between -0.5 and 0.5


float  ec = 0.05
End value of coefficient c in test mode (xec in independent mode)
  • Between -0.5 and 0.5


int  nsteps = 20
Number of steps for variation (test mode only)
  • Between 0 and 100


Int  frame = 0
Input frame number for over lay (test mode only)
  • Within input clip


Int  color = 0
Color of dots in test mode and left out borders in normal
  • In RRGGBB format


bool  ind = false
Whether x and y have independent coefficients
  • true for independent
  • false for pin cushion or barrel


bool  ypin = false
Whether Y direction has pin cushion distortion?
  • true for pin cushion
  • false for barrel


float  ya = 0.05
Value of coefficient ya (start value in test mode )
  • Between -0.5 and 0.5


float  yb = 0.05
Value of coefficient yb (start value in test mode)
  • Between -0.5 and 0.5


float  yc = 0.05
Value of coefficient yc (start value in test mode)
  • Between -0.5 and 0.5


float  yea = 0.05
End value of coefficient ya (test mode only)
  • Between -0.5 and 0.5


float  yeb = 0.05
End value of coefficient yb (test mode only)
  • Between -0.5 and 0.5


float  yec = 0.05
End value of coefficient yc (test mode only)
  • Between -0.5 and 0.5


[edit] Examples

blankclip(width = 720, height = 480, pixel_type = "RGB32", color = $ffffff, length = 10)
grid()
Barrel()

Pin Cushion Distortion

Barrel(a = 0.005, b = 0.005, c = 0.005, pin = false)



Back to External Filters

Personal tools