PDA

View Full Version : VD "Perspective" filter available for AviSynth?


Prakel
29th May 2007, 13:46
Hi there,

I am wondering if there is a plugin for AviSynth that can do the same as the VirtualDub-filter "perspective"?

So far I used the reform.dll by (?) to do that:

clip2=skew(clip1,0,464, 130, 170, 136, 568, 582, 184, 560, 556,0,resize="cubic")

Although it has good features like the ability to change the deformation over time, the quality of the result is far from acceptable (very "steppy"). I guess the interpolation algorithms don't work correctly, because there is no visible difference between the three available. VD has the perspective filter which is of high quality (anti-aliasing and much better interpolation).

Is there a filter for AviSynth of similar quality?

Thanks for reading
Prakel

neuron2
29th May 2007, 13:50
You can import and use the VirtualDub filter in an Avisynth script.

Prakel
29th May 2007, 15:06
You can import and use the VirtualDub filter in an Avisynth script.

Alright, but what are the parameters?

Edit: I followed the instructions here: http://avisynth.org/oldwiki/index.php?page=Section+4%3A+Importing+filters+from+VirtualDub#q4.43

The problem is, it does only save the new clip dimensions, not any other settings.
So the original question is still valid...

neuron2
29th May 2007, 17:31
Oops, it's an internal filter so you can't import it.

Somebody would have to make an external plugin out of it.

foxyshadis
29th May 2007, 22:13
Reform does use linear interpolation internally, but I agree that it looks pretty bad, especially on edges. You can always force it to use better: Resize up beforehand and back down after, which is all antialiasing really is. (Slower, unfortunately.)

ss=2.5
spline36resize(m(4,width*ss), m(4,height*ss))
skew(ltopx=int(130*ss), ltopy=int(170*ss), lbotx=int(136*ss), lboty=int(568*ss), rtopx=int(582*ss), rtopy=int(184*ss), rbotx=int(560*ss), rboty=int(556*ss),color=0,resize="line")
spline36resize(m(4,width/ss),m(4,height/ss))

function m(int r, float x) {return(x<16?16:int(round(x/float(r))*r))}

Even a factor as low as 1.2 looks better, but you really need at least 2.5 to make the very thin lines look nice. Cropping it as much as possible will speed up the resize steps.

Prakel
30th May 2007, 10:34
Reform does use linear interpolation internally, but I agree that it looks pretty bad, especially on edges. You can always force it to use better: Resize up beforehand and back down after, which is all antialiasing really is. (Slower, unfortunately.)

ss=2.5
spline36resize(m(4,width*ss), m(4,height*ss))
skew(ltopx=int(130*ss), ltopy=int(170*ss), lbotx=int(136*ss), lboty=int(568*ss), rtopx=int(582*ss), rtopy=int(184*ss), rbotx=int(560*ss), rboty=int(556*ss),color=0,resize="line")
spline36resize(m(4,width/ss),m(4,height/ss))

function m(int r, float x) {return(x<16?16:int(round(x/float(r))*r))}

Even a factor as low as 1.2 looks better, but you really need at least 2.5 to make the very thin lines look nice. Cropping it as much as possible will speed up the resize steps.

Yep, thx. Tried that with different resizers. For some reason spline36resize is not available... Freshly installed 2.5.7. Any ideas on that? :-)

IanB
30th May 2007, 16:03
Check your spelling very carefully, Spline36Resize.

Failing that cut and paste your exact full script into a post.

@F, Round returns an int, so the Int(Round(... is redundant.

foxyshadis
31st May 2007, 07:05
int(round(x/float(r))*r) =p

IanB
31st May 2007, 09:38
function m(int r, float x) {return(x<16?16:int(round(x/float(r))*r))}

function m(int r, float x) {return x<16 ? 16 : round(x/r)*r}float / int return float (and does float division)
round(float) returns int
int * int returns int

Or are you reporting a parser arithmetic bug?

Prakel
31st May 2007, 10:53
:thanks:

foxyshadis
31st May 2007, 22:49
You're right, it originally had 4.0 where r is for some reason and I never realized it changed to an int. Sigh, I'm silly.