Emulgator
17th August 2010, 13:51
Sometimes an anamorphotic lens has been mounted offset or
tilted or not completely locked or poorly manufactured.
The outcome of such shootings or captures has the picture along x-axis
one side squeezed, the other side stretched.
Does anybody know of a solution to this ?
I have tried VCMohan's perspective, but this is tailored to fix
2-axis perspective correction and already does too much.
The x-axis outcome is dependent on source pixel location on a reference point on y-axis.
I have found no way to exclude y from calculations.
Warpedresize treats all resizings centered.
I found no way to introduce an offset to one side only to have one side stretched, the other side squeezed along the x-axis.
Defish treats all resizings centered as well.
Some samples to illustrate the source behaviour:
The person to the left looks horizontally squeezed,
the person to the right looks horizontally stretched.
http://www.dvd-manufactur.de/files/A_06_15_0186.jpg
http://www.dvd-manufactur.de/files/A_06_15_0306.jpg
http://www.dvd-manufactur.de/files/A_27_10_A+B+C_0289.jpg
elguaxo
17th August 2010, 15:51
The person to the left looks horizontally squeezed,
the person to the right looks horizontally stretched.
That's the "Shawscope":
http://i.imgur.com/4uAgK.jpg
Things near the left or right margins are supposed to look horizontally squeezed.
Like this:
http://i.imgur.com/y9nvN.jpg
;)
edit: although your screens don't show this effect and one side is squeezed and the other is not. Maybe those frames are not complete? Anyway, here is a good read http://www.davidbordwell.net/essays/shaw.php
Emulgator
17th August 2010, 16:37
Very interesting essay indeed, many thanks !
But if sides do differ, (and they do) I will need an asymmetric correction.
This must have been introduced on scanning, I have a clip where sides are flipped after a bad splice for seconds,
then flip back and when I apply FlipHorizontal for that range in Avisynth it becomes obvious that sides don't match, although content should.
AVIL
17th August 2010, 16:43
Hi.
You can slice the clip with crop in columns, apply over each different horizontal resize ratios with any good resizer (my preferred is spline36resize) and rejoint after with stackhorizontal. More slices more work but better results. I won´t spect a miracle though.
Good luck
Emulgator
17th August 2010, 16:46
Ok, a thought worth trying.
Emulgator
17th August 2010, 20:58
And here is the result. Works like a charm.
http://www.dvd-manufactur.de/files/32_00_unfixed_7489.jpg
http://www.dvd-manufactur.de/files/32_00_fixed_7489.jpg
And here is the small gift to you:
#[*# ........................................Start of Emulgator's 16 Stripes Anamorph Offset+Tilt Fix 1.2 from 17. August 2010..........................................................
# Divides picture in 16 equally spaced vertical stripes,
# Resizes these stripes with increasing (xinc=positive) or decreasing (xinc=negative) width per section, symmetrically to x=width/2,
# Stacks the resized stripes horizontally together. RGB24 to get single pixel resizing.
IsRGB? NOP : ConvertToRGB24(interlaced=false)
xinc=-0.95 # xinc tells how much the increase of width per section shall be,
# starting from x=width/2 going to the right. xinc can be given in 0.125 steps
DilatationOverlay=1 ## Comment Overlay in/out to see what values have been applied.
xp=16 ## xp tells how many source sections of equal width are made up.
xstart=round((xp/2)*-xinc)
n=0
da=xstart+round(n*xinc)
ha=Spline36Resize((width/xp)+da, height, (n)*width/xp, 0, -(xp-(n+1))*width/xp, -0)
n=n+1
db=xstart+round(n*xinc)
hb=Spline36Resize((width/xp)+db, height, (n)*width/xp, 0, -(xp-(n+1))*width/xp, -0)
n=n+1
dc=xstart+round(n*xinc)
hc=Spline36Resize((width/xp)+dc, height, (n)*width/xp, 0, -(xp-(n+1))*width/xp, -0)
n=n+1
dd=xstart+round(n*xinc)
hd=Spline36Resize((width/xp)+dd, height, (n)*width/xp, 0, -(xp-(n+1))*width/xp, -0)
n=n+1
de=xstart+round(n*xinc)
he=Spline36Resize((width/xp)+de, height, (n)*width/xp, 0, -(xp-(n+1))*width/xp, -0)
n=n+1
df=xstart+round(n*xinc)
hf=Spline36Resize((width/xp)+df, height, (n)*width/xp, 0, -(xp-(n+1))*width/xp, -0)
n=n+1
dg=xstart+round(n*xinc)
hg=Spline36Resize((width/xp)+dg, height, (n)*width/xp, 0, -(xp-(n+1))*width/xp, -0)
n=n+1
dh=xstart+round(n*xinc)
hh=Spline36Resize((width/xp)+dh, height, (n)*width/xp, 0, -(xp-(n+1))*width/xp, -0)
n=n+1
di=-dh
hi=Spline36Resize((width/xp)+di, height, (n)*width/xp, 0, -(xp-(n+1))*width/xp, -0)
n=n+1
dj=-dg
hj=Spline36Resize((width/xp)+dj, height, (n)*width/xp, 0, -(xp-(n+1))*width/xp, -0)
n=n+1
dk=-df
hk=Spline36Resize((width/xp)+dk, height, (n)*width/xp, 0, -(xp-(n+1))*width/xp, -0)
n=n+1
dl=-de
hl=Spline36Resize((width/xp)+dl, height, (n)*width/xp, 0, -(xp-(n+1))*width/xp, -0)
n=n+1
dm=-dd
hm=Spline36Resize((width/xp)+dm, height, (n)*width/xp, 0, -(xp-(n+1))*width/xp, -0)
n=n+1
dn=-dc
hn=Spline36Resize((width/xp)+dn, height, (n)*width/xp, 0, -(xp-(n+1))*width/xp, -0)
n=n+1
do=-db
ho=Spline36Resize((width/xp)+do, height, (n)*width/xp, 0, -(xp-(n+1))*width/xp, -0)
n=n+1
dp=-da
hp=Spline36Resize((width/xp)+dp, height, (n)*width/xp, 0, -(xp-(n+1))*width/xp, -0)
StackHorizontal(ha, hb, hc, hd, he, hf, hg, hh, hi, hj, hk, hl, hm, hn, ho, hp)
dsum=da+db+dc+dd+de+df+dg+dh+di+dj+dk+dl+dm+dn+do+dp
DilatationOverlay==1 ? Eval("""Subtitle(y=16, size=12, "Number of Horizontal Dilatation sections : "+string(xp))
Subtitle(y=28, size=12, "Horizontal Dilatation increase per section : "+string(xinc))
Subtitle(y=40, size=12, "Horizontal Dilatation start value at outer left section : "+string(xstart))
Subtitle(y=28, x=width-20, align=9, size=12, "Total Horizontal Dilatation: "+string(dsum))
Subtitle(y=40, x=width-20, align=9, size=12, "Outer right section number : "+string(n))
Subtitle(y=52, size=12, "Horizontal Dilatation values per section : " \
+"a"+string(da)+" | b"+string(db)+" | c"+string(dc)+" | d"+string(dd) \
+" | e"+string(de)+" | f"+string(df)+" | g"+string(dg)+" | h"+string(dh) \
+" ||| i"+string(di)+" | j"+string(dj)+" | k"+string(dk)+" | l"+string(dl) \
+" | m"+string(dm)+" | n"+string(dn)+" | o"+string(do)+" | p"+string(dp))
""") : NOP
#*]# ............................................End of Emulgator's 16 Stripes Anamorph Offset+Tilt Fix 1.2 from 17. August 2010...........................................................
Mug Funky
18th August 2010, 06:18
try simpleresize.
i believe it has a warpedresize function designed to spoof 16:9 with 4:3 frames and vice versa, much how the old rear projection TVs used to do before HD was big.
Emulgator
18th August 2010, 13:14
Thanks MugFunky !
Yes, i have already tried trbarry's simpleresize with the contained warpedresize,
but this also works only symmetric to width/2 and height/2.
Now I inserted warpedresize after my script with hWarp = 1.03
to squeeze the left and right borders back a bit.
This looks ok.
scharfis_brain
21st August 2010, 10:52
the easiest way to go should be addborders to the right side of the image in order to make an asymmetrical resizing,
then do a warped-resize,
then chop off the previously added borders.
Emulgator
25th August 2010, 18:06
Yes, another good idea !
For more nonlinear situations...
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.