Reformer

From Avisynth wiki
(Difference between revisions)
Jump to: navigation, search
m (Requirements: AviSynth 2.6)
Line 3: Line 3:
  
 
{{Filter3
 
{{Filter3
|1=<!-- author -->[http://www.avisynth.nl/users/vcmohan/ V.C.Mohan]
+
|1=<!-- author --> [http://www.avisynth.nl/users/vcmohan/ V.C.Mohan]
|2=<!-- version -->1.0.0.0.0
+
|2=<!-- version --> 9 Apr 2018
|3=<!-- download 2.5.8 version URL -->2.5.8 version[http://www.avisynth.nl/users/vcmohan/Reformer/Reformer.zip Reformer] 2.6.0 alpha5 version URL -->[http://www.avisynth.nl/users/vcmohan/Reformer/Reformer_2_6.zip Reformer]
+
|3=<!-- URL --> [http://www.avisynth.nl/users/vcmohan/movePlus/movePlus.7z movePlus.7z]
|4=<!-- category -->External filters
+
|4=<!-- category --> External filters
|5=<!-- license -->[http://www.gnu.org/licenses/gpl-2.0.txt GPLv2]
+
|5=<!-- license --> [https://www.gnu.org/licenses/gpl-2.0.txt GPLv2]
|6=<!-- discussion URL -->[http://forum.doom9.org/showthread.php?t=166716&highlight=Reformer Reformer plugin]}}
+
|6=<!-- discussion URL -->[https://forum.doom9.org/showthread.php?t=166716&highlight=Reformer Reformer plugin]}}
  
 
<br>
 
<br>
 
== Description ==
 
== Description ==
 
<!-- a one-sentence description -->
 
<!-- a one-sentence description -->
Function q2r quadrilateral to rectangle and vice versa r2q for perspective correction of image  and a full description is at  [http://www.avisynth.nl/users/vcmohan/Reformer/Reformer.html click me].
+
Reform uses matrix algebra for transformations. Reform has two modes viz: rectangle to quadrilateral and quadrilateral to rectangle. Lanczos or cubic or linear or nearest point interpolation methods can be opted. [http://www.avisynth.nl/users/vcmohan/movePlus/Reform.html Full Description]
<br>
+
 
 
<br>
 
<br>
 
== Requirements ==
 
== Requirements ==

Revision as of 20:54, 18 June 2018


Abstract
Author V.C.Mohan
Version 9 Apr 2018
Download movePlus.7z
Category External filters
License GPLv2
Discussion Reformer plugin


Contents

Description

Reform uses matrix algebra for transformations. Reform has two modes viz: rectangle to quadrilateral and quadrilateral to rectangle. Lanczos or cubic or linear or nearest point interpolation methods can be opted. Full Description


Requirements

* Not available in AviSynth 2.5.8.


"cc[resize]s[ltopx]f[ltopy]f[lbotx]f[lboty]f[rtopx]f[rtopy]f[rbotx]f[rboty]f" "[leftx]f[rightx]f[ytop]f[ybot]f" "[eltopx]f[eltopy]f[elbotx]f[elboty]f[ertopx]f[ertopy]f[erbotx]f[erboty]f" "[eleftx]f[erightx]f[eytop]f[eybot]f"

Syntax and Parameters

q2r or r2q(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")


clip   =
Input clip.


clip   =
background clip.


resize  string = "lanczos"
type of interpolation to be used for resizing. lanczos, bicubic, bilinear, nearest point .


ltopx  float = 0
quadrilateral left top x.


ltopy  float = 0
quadrilateral left top y .


lbotx  float = 0
quadrilateral left bottom x .


lboty  float = height - 1
quadrilateral left bottom y .


rtopx  float = frame width -1
quadrilateral right top x .


rtopy  float = 0
quadrilateral right top y .


rbotx  float = width- 1
quadrilateral right bottom x .


rboty  float = height- 1
quadrilateral right bottom y .


leftx  float = 0
Rectangle left x


rightx  float = width - 1
Rectangle right x


ytop  float = 0
Rectangle top y
rbotx  float = width- 1
Rectangle bottom y .




Examples

## This is some example code to blur  an image.
imagereader("C:\..........jpg", end = 10)
a = avisource("C;\..........avi").converttoYUY2()
converttoyv16()
# Rectangle to quadrilateral
r2q(last,last,leftx = 100,rightx = 400, ytop = 200, ybot = 480,ltopx=200,ltopy=150, rbotx = 500, rboty = 400, resize= "lanczos")
# quad to rectangle excercise
c= last
  1. bg = blankclip(last,color = 0)
ScriptClip("""

h = height(bg)-1 w = width(bg)-1

   t = 0.061 *(current_frame)
   t2 = 0.127 *( current_frame)
   a = 0.501 + 0.5 * sin(t/pi)
   t1x = (-0.2*cos(t2)) * w
   t1y = (0.5-0.5*cos(t2)) * h
   t2x = (1.0+0.2*cos(t2)) * w
   t2y = (0.5-0.5*cos(t2)) * h
   t3x = (1.0+0.2*cos(t2)) * w
   t3y = (0.5+0.5*cos(t2)) * h
   t4x = (-0.2*cos(t2)) * w
   t4y = (0.5+0.5*cos(t2)) * h
   c1x = (0.5+a*cos(t)) * w
   c1y = (0.5+a*sin(t)) * h
   c2x = (0.5-a*sin(t)) * w
   c2y = (0.5+a*cos(t)) * h
   c3x = (0.5-a*cos(t)) * w
   c3y = (0.5-a*sin(t)) * h
   c4x = (0.5+a*sin(t)) * w
   c4y = (0.5-a*cos(t)) * h
  1. r2q(c, c,leftx=t1x,rightx=t2x,ytop=t1y,ybot=t3y,ltopx=c1x,ltopy=c1y, rtopx=c2x,rtopy=c2y, rbotx=c3x,rboty=c3y,lbotx=c4x,lboty=c4y, resize = "line")

q2r( bg,leftx=t1x,rightx=t2x,ytop=t1y,ybot=t3y,ltopx=c1x,ltopy=c1y, rtopx=c2x,rtopy=c2y, rbotx=c3x,rboty=c3y,lbotx=c4x,lboty=c4y, resize = "point" )


Back to External Filters

Personal tools