View Full Version : Checkerboard script?
invincible
23rd April 2011, 20:31
I have 2 files: left view and right view. I want to make an avisynth script to checkerboard format. I don't know that. Please help. :rolleyes:
TheSkiller
24th April 2011, 13:16
You mean something like one clip on the left and the other on the right?
That can be done with StackHorizontal().
left=whateversource
right=whateversource
StackHorizontal(left,right)
ajp_anton
24th April 2011, 14:33
Logically, based on the name, I think you're supposed to merge the two videos using a checkerboard mask.
It seems stupid though, since you're effectively throwing away half of the resolution in both videos, and the remaining pixels are located weirdly. Also, don't know how large the squares should be... the chroma planes probably won't like 1pix areas.
invincible
26th April 2011, 20:58
checkerboard 3D:
http://static.desktopnexus.com/thumbnails/112240-bigthumbnail.jpg
stackhorizontal is side by side.
J_Darnley
26th April 2011, 21:54
We know what a checkerboard is. How big do you need the pattern to be? Like you posted? 55 pixels?
IanB
26th April 2011, 22:25
Jeez! The easy option, make a mask with full back and white squares as required, Black(0)=Transparent, White(255)=opaqueC1=...Source(...)
C2=...Source(...)
M=ImageSource("checkerboard.bmp")
Overlay(C1, C2, Mask=M, Mode="blend")The other option 8 StackVerticals of 8 StackHorizontals with 64 Crops.
Zarxrax
26th April 2011, 22:51
Aw I just finished making the script only to have my thunder stolen by you, IanB :P
Though I took the liberty of generating the checkerboard within avisynth :P
black = BlankClip(length=240, width=32, height=32, pixel_type="RGB32", fps=24, fps_denominator=1, audio_rate=44100, stereo=False, sixteen_bit=True, color=$000000)
white = BlankClip(length=240, width=32, height=32, pixel_type="RGB32", fps=24, fps_denominator=1, audio_rate=44100, stereo=False, sixteen_bit=True, color=$ffffff)
wide1 = stackhorizontal(black,white,black,white,black,white,black,white,black,white,black,white,black,white,black,white,black,white,black,white)
wide2 = stackhorizontal(white,black,white,black,white,black,white,black,white,black,white,black,white,black,white,black,white,black,white,black)
checkerboard = stackvertical(wide1,wide2,wide1,wide2,wide1,wide2,wide1,wide2,wide1,wide2,wide1,wide2,wide1,wide2,wide1)
clip1 = colorbars()
clip2 = colorbars().Invert()
Overlay(clip1,clip2,mask=checkerboard)
invincible
27th April 2011, 02:52
The image I posted is just a sample. I want to make a 3d movie script in checkerboard format. follow image above, In 1 frame of checkerboard: black is a pixel of left eye frame, white is a pixel of right eye frame. If left and right resolution is 1920x1080 then resolution of checkerboard is 3840x1080. It like pixel-sequential :P
Left frame
a11 a12 a13
a21 a22 a23
a31 a32 a33
Right frame
b11 b12 b13
b21 b22 b23
b31 b32 b33
checkerboard frame:
a11 b11 a12 b12 a13 b13
a21 b21 a22 b22 a23 b23
a31 b31 a32 b32 a33 b33
aii, bii is pixel. I have left and right frame attached below. plz Help me to make checkerboard script.
IanB
27th April 2011, 09:22
So you want 2 lots of 9 crops, which you do a StackVertical of 3 StackHorizontals....Source("Src1...")
a11=crop(0,0, 640,360)
a12=crop(640,0, 640,360)
a13=...1280...
a21=crop(0,360, 640,360)
....
a33=...1280, 720...
...Source("Src2...")
b11=crop(0,0, 640,360)
b12=crop(640,0, 640,360)
b13=...1280...
b21=crop(0,360, 640,360)
....
b33=...1280, 720...
W1 = stackhorizontal(a11, b11, a12, b12, a13, b13)
W2 = stackhorizontal(a21, b21, ....)
W3 = ... a33, b33)
stackvertical(W1, W2, W3)This stuff is really easy, it just takes a lot of typing.
GScript by Gavino can take some of the pain out of the typing.
Gavino
27th April 2011, 10:22
In 1 frame of checkerboard: black is a pixel of left eye frame, white is a pixel of right eye frame. If left and right resolution is 1920x1080 then resolution of checkerboard is 3840x1080.
That's not like the checkerboard image you posted - it's not a checkerboard at all, it's alternating columns of black and white.
So you want 2 lots of 9 crops, which you do a StackVertical of 3 StackHorizontals.
Far simpler would be to double the width of both clips with PointResize, then merge the clips with a mask as previously suggested. The mask can be created more easily using mt_lutspa.
L = ... # left image
R = ... # right image
L = L.PointResize(3840, 1080)
R = R.PointResize(3840, 1080)
mask = BlankClip(L, pixel_type="YV12").mt_lutspa(mode="absolute", expr="x 2 % 255 *")
Overlay(L, R, mask=mask)
Didée
27th April 2011, 10:40
Found some reference about that "Checkerboard" format here (http://www.3d-forums.com/checkerboard-and-line-line-3d-tv-t8.html) (1st link in 2nd post).
In any case, this stuff won't play well with 4:2:0 pixel format (YV12) ...
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.