Reform
Raffriff42 (Talk | contribs) (redirect for convenient searching) |
(Reform: add documentation) |
||
Line 1: | Line 1: | ||
− | + | {{FilterCat4|External_filters|Plugins|Adjustment_filters|Transformation}} | |
− | {{ | + | {{Filter3 |
+ | |1={{Author/vcmohan}} | ||
+ | |2=Dec 27, 2012 | ||
+ | |3=[http://www.avisynth.nl/users/vcmohan/Reform/Reform.zip Reform.zip] | ||
+ | |4=External filters | ||
+ | |5=[https://www.gnu.org/licenses/gpl-2.0.txt GPLv2] | ||
+ | |6=[https://forum.doom9.org/showthread.php?t=166716&highlight=Reformer Doom9 Forum]}} | ||
+ | |||
+ | <br> | ||
+ | == Description == | ||
+ | Reform plugin does a geometric transformation and in certain cases may produce artifacts. [[Reformer]] Plugin which does Matrix operations gives better results and if possible switch to that plugin. | ||
+ | |||
+ | This plugin is meant for correcting minor distortions. If used for very large distortions most likely the linearity assumptions and interpolation quality will suffer. Artifacts may appear especially in case of deskew function. | ||
+ | |||
+ | There are 2 functions included in this plugin. These are: | ||
+ | |||
+ | *<code>Deskew</code>: Converts a quadrilateral to a rectangle. | ||
+ | |||
+ | *<code>Skew</code>: Converts a rectangle to a quadrilateral. | ||
+ | |||
+ | Most of the parameters can be linearly varied over the length of the effect, and so it can be used to distort or correct distorted faces or objects progressively. The parameters for both these functions are identical. For reading coordinates correctly the plugin [[Grid]] can be used. Interpolation options are Lanczos 6x6, cubic 4x4, linear 2x2 and nearest point It has to be ensured that the quadrilateral is convex | ||
+ | |||
+ | |||
+ | * See official documentation: http://www.avisynth.nl/users/vcmohan/Reform/Reform.html | ||
+ | <br> | ||
+ | == Requirements == | ||
+ | * [x86]: [[AviSynth+]] or [https://sourceforge.net/projects/avisynth2/ AviSynth 2.6] | ||
+ | * Supported color formats: [[RGB24]], [[RGB32]], [[YUY2]], [[YV12]] | ||
+ | |||
+ | <br> | ||
+ | == [[Script variables|Syntax and Parameters]] == | ||
+ | :{{Template:FuncDef|Deskew (clip, clip, string "resize", float "ltopx", float "ltopy", float "lbotx", float "lboty", float "rtopx", float "rtopy", float "rbotx", float "rboty", float "leftx", float "rightx", float "ytop", float "ybot", float "eltopx", float "eltopy", float "elbotx", float "elboty", float "ertopx", float "ertopy", float "erbotx", float "erboty", float "eleftx", float "erightx", float "eytop", float "eybot")}} | ||
+ | |||
+ | :{{Template:FuncDef|Skew (clip, clip, string "resize", float "ltopx", float "ltopy", float "lbotx", float "lboty", float "rtopx", float "rtopy", float "rbotx", float "rboty", float "leftx", float "rightx", float "ytop", float "ybot", float "eltopx", float "eltopy", float "elbotx", float "elboty", float "ertopx", float "ertopy", float "erbotx", float "erboty", float "eleftx", float "erightx", float "eytop", float "eybot")}} | ||
+ | <br> | ||
+ | ::{{Par2| |clip| }} | ||
+ | :::Input clip to be skewed or deskewed. | ||
+ | <br> | ||
+ | ::{{Par2| |clip| }} | ||
+ | :::Background clip. | ||
+ | <br> | ||
+ | ::{{Par2|resize|string|"lanczos"}} | ||
+ | :::Resize interpolation to use: <code>"lanczos" | "line" | "point"</code> | ||
+ | <br> | ||
+ | ::{{Par2|ltopx|float|0}} | ||
+ | ::{{Par2|ltopy|float|0}} | ||
+ | :::Quadrilateral left top x and y coordinates. | ||
+ | <br> | ||
+ | ::{{Par2|lbotx|float|0}} | ||
+ | ::{{Par2|lboty|float|height-1}} | ||
+ | :::Quadrilateral left bottom x and y coordinates. | ||
+ | <br> | ||
+ | ::{{Par2|rtopx|float|width-1}} | ||
+ | ::{{Par2|rtopy|float|0}} | ||
+ | :::Quadrilateral right top x and y coordinates. | ||
+ | <br> | ||
+ | ::{{Par2|rbotx|float|width-1}} | ||
+ | ::{{Par2|rboty|float|height-1}} | ||
+ | :::Quadrilateral right bottom x and y coordinates. | ||
+ | <br> | ||
+ | ::{{Par2|leftx|float|0}} | ||
+ | ::{{Par2|rightx|float| width-1}} | ||
+ | :::Rectangle coordinates: leftx and rightx. | ||
+ | <br> | ||
+ | ::{{Par2|ytop|float|0}} | ||
+ | ::{{Par2|ybot|float|height-1}} | ||
+ | :::Rectangle coordinates: top y and bottom y. | ||
+ | <br> | ||
+ | ::{{Par2|eltopx|float|ltopx}} | ||
+ | ::{{Par2|eltopy|float|ltopy}} | ||
+ | :::End frame, Quadrilateral left top x and y coordinates. | ||
+ | <br> | ||
+ | ::{{Par2|elbotx|float|lbotx}} | ||
+ | ::{{Par2|elboty|float|lboty}} | ||
+ | :::End frame, Quadrilateral left bottom x and y coordinates. | ||
+ | <br> | ||
+ | ::{{Par2|ertopx|float|rtopx}} | ||
+ | ::{{Par2|ertopy|float|rtopy}} | ||
+ | :::End frame, Quadrilateral right top x and y coordinates. | ||
+ | <br> | ||
+ | ::{{Par2|erbotx|float|rbotx}} | ||
+ | ::{{Par2|erboty|float|rboty}} | ||
+ | :::End frame, Quadrilateral right bottom x and y coordinates. | ||
+ | <br> | ||
+ | ::{{Par2|eleftx|float|leftx}} | ||
+ | ::{{Par2|erightx|float|rightx}} | ||
+ | :::End frame Rectanlge coordinates: left x and right x. | ||
+ | <br> | ||
+ | ::{{Par2|eytop|float|ytop}} | ||
+ | ::{{Par2|eybot|float|ybot}} | ||
+ | :::End frame Rectanlge coordinates: top y and bottom y. | ||
+ | <br> | ||
+ | |||
+ | == Examples == | ||
+ | Script example: | ||
+ | <pre> | ||
+ | ColorBars().ConvertToRGB32() | ||
+ | img = avisource("..........") | ||
+ | bg = blankclip(img, color = ...) | ||
+ | |||
+ | deskew(img, bg,ltopx=44,ltopy=17,lbotx=34,lboty=470,rtopx=612,rtopy=70,rbotx=684,rboty=426) | ||
+ | deskew(img, bg,ltopx=44,ltopy=17,lbotx=34,lboty=470,color=$ff00, resize = "point") | ||
+ | |||
+ | skew(img, bg,ltopx=44,ltopy=17,lbotx=34,lboty=470,rtopx=612,rtopy=70,rbotx=684,rboty=426) | ||
+ | skew(img, bg,ltopx=44,ltopy=17,lbotx=34,lboty=470,color=$ff00, resize = "line") | ||
+ | </pre> | ||
+ | <br> | ||
+ | <br> | ||
+ | ----------------------------------------------- | ||
+ | '''Back to [[External_filters|External Filters]] ←''' |
Revision as of 22:50, 8 June 2020
Abstract | |
---|---|
Author | V. C. Mohan |
Version | Dec 27, 2012 |
Download | Reform.zip |
Category | External filters |
License | GPLv2 |
Discussion | Doom9 Forum |
Contents |
Description
Reform plugin does a geometric transformation and in certain cases may produce artifacts. Reformer Plugin which does Matrix operations gives better results and if possible switch to that plugin.
This plugin is meant for correcting minor distortions. If used for very large distortions most likely the linearity assumptions and interpolation quality will suffer. Artifacts may appear especially in case of deskew function.
There are 2 functions included in this plugin. These are:
Deskew
: Converts a quadrilateral to a rectangle.
Skew
: Converts a rectangle to a quadrilateral.
Most of the parameters can be linearly varied over the length of the effect, and so it can be used to distort or correct distorted faces or objects progressively. The parameters for both these functions are identical. For reading coordinates correctly the plugin Grid can be used. Interpolation options are Lanczos 6x6, cubic 4x4, linear 2x2 and nearest point It has to be ensured that the quadrilateral is convex
- See official documentation: http://www.avisynth.nl/users/vcmohan/Reform/Reform.html
Requirements
Syntax and Parameters
- Deskew (clip, clip, string "resize", float "ltopx", float "ltopy", float "lbotx", float "lboty", float "rtopx", float "rtopy", float "rbotx", float "rboty", float "leftx", float "rightx", float "ytop", float "ybot", float "eltopx", float "eltopy", float "elbotx", float "elboty", float "ertopx", float "ertopy", float "erbotx", float "erboty", float "eleftx", float "erightx", float "eytop", float "eybot")
- Skew (clip, clip, string "resize", float "ltopx", float "ltopy", float "lbotx", float "lboty", float "rtopx", float "rtopy", float "rbotx", float "rboty", float "leftx", float "rightx", float "ytop", float "ybot", float "eltopx", float "eltopy", float "elbotx", float "elboty", float "ertopx", float "ertopy", float "erbotx", float "erboty", float "eleftx", float "erightx", float "eytop", float "eybot")
- clip =
- Input clip to be skewed or deskewed.
- clip =
- clip =
- Background clip.
- clip =
- string resize = "lanczos"
- Resize interpolation to use:
"lanczos" | "line" | "point"
- Resize interpolation to use:
- string resize = "lanczos"
- float ltopx = 0
- float ltopy = 0
- Quadrilateral left top x and y coordinates.
- float ltopx = 0
- float lbotx = 0
- float lboty = height-1
- Quadrilateral left bottom x and y coordinates.
- float lbotx = 0
- float rtopx = width-1
- float rtopy = 0
- Quadrilateral right top x and y coordinates.
- float rtopx = width-1
- float rbotx = width-1
- float rboty = height-1
- Quadrilateral right bottom x and y coordinates.
- float rbotx = width-1
- float leftx = 0
- float rightx = width-1
- Rectangle coordinates: leftx and rightx.
- float leftx = 0
- float ytop = 0
- float ybot = height-1
- Rectangle coordinates: top y and bottom y.
- float ytop = 0
- float eltopx = ltopx
- float eltopy = ltopy
- End frame, Quadrilateral left top x and y coordinates.
- float eltopx = ltopx
- float elbotx = lbotx
- float elboty = lboty
- End frame, Quadrilateral left bottom x and y coordinates.
- float elbotx = lbotx
- float ertopx = rtopx
- float ertopy = rtopy
- End frame, Quadrilateral right top x and y coordinates.
- float ertopx = rtopx
- float erbotx = rbotx
- float erboty = rboty
- End frame, Quadrilateral right bottom x and y coordinates.
- float erbotx = rbotx
- float eleftx = leftx
- float erightx = rightx
- End frame Rectanlge coordinates: left x and right x.
- float eleftx = leftx
- float eytop = ytop
- float eybot = ybot
- End frame Rectanlge coordinates: top y and bottom y.
- float eytop = ytop
Examples
Script example:
ColorBars().ConvertToRGB32() img = avisource("..........") bg = blankclip(img, color = ...) deskew(img, bg,ltopx=44,ltopy=17,lbotx=34,lboty=470,rtopx=612,rtopy=70,rbotx=684,rboty=426) deskew(img, bg,ltopx=44,ltopy=17,lbotx=34,lboty=470,color=$ff00, resize = "point") skew(img, bg,ltopx=44,ltopy=17,lbotx=34,lboty=470,rtopx=612,rtopy=70,rbotx=684,rboty=426) skew(img, bg,ltopx=44,ltopy=17,lbotx=34,lboty=470,color=$ff00, resize = "line")
Back to External Filters ←