Top Banner
Stereo Images Doug Blank Bryn Mawr College Based on work by J. Ben Schafer
13

Stereo Images

Jan 07, 2016

Download

Documents

butch

Stereo Images. Doug Blank Bryn Mawr College Based on work by J. Ben Schafer. What is this?. Old-fashioned “stereograph”. Two images from slightly different perspectives If you can get one eye to see one photo and the other eye to see the other photo then you can create a 3D effect. - PowerPoint PPT Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Stereo Images

Stereo Images

Doug Blank

Bryn Mawr CollegeBased on work by J. Ben Schafer

Page 2: Stereo Images

What is this?

Page 3: Stereo Images

Old-fashioned “stereograph”

• Two images from slightly different perspectives

• If you can get one eye to see one photo and the other eye to see the other photo then you can create a 3D effect

Page 4: Stereo Images

Left Eye

Page 5: Stereo Images

Right Eye

Page 6: Stereo Images

Viewmaster

Page 7: Stereo Images

But how would a computer scientist do this with our tools from Myro?

• Answer:– Anaglyphs!– Make one photo that can be seen as two

• One eye sees one image• One eye sees the other

– But you need those funny glasses!

Page 8: Stereo Images

But how would a computer scientist do this with our tools from Myro?

• Answer:– Anaglyphs!– Make one photo that can be seen as two

• One eye sees the red channel (normally the left) • One eye sees the cyan channels (blue/green)

(normally the right eye)

– But you need those funny glasses!

Page 9: Stereo Images
Page 10: Stereo Images

Sidebar: Why is red on left?

The 2 color light system on a plane or boat allows you to immediately know your position relative to the path of the plane or boat, depending on what combination of lights you see. The green light is on the right (starboard) and the red on the left (port).

So if you see a green light on the left and a red light on the right, the plane or boat is heading directly toward you!

Page 11: Stereo Images

What would the algorithm look like?

• Get a left and right picture

• Make a new picture that is the same size as left and right

• For every pixel in the new picture:– Get the red part from the left picture– Get the green and blue from the right

Page 12: Stereo Images

So what would the code look like?def anaglyph(left,right): output = makePicture(getWidth(left),getHeight(left)) for x in range(1,getWidth(left)): for y in range(1,getHeight(left)): target = getPixel(output,x,y) left_pix = getPixel(left,x,y) right_pix = getPixel(right,x,y) setRed(target,getRed(left_pix)) setGreen(target,getGreen(right_pix)) setBlue(target,getBlue(right_pix)) return output

Page 13: Stereo Images

Sources for images

• Several Websites– http://www.studio3d.com/pages/anaglyph.html– http://www.studio3d.com/pages/stereophoto.html

• Take them yourself– Take two photos with one slightly to the right

of the other– Gee, where could we get two cameras?