stereo images
DESCRIPTION
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 PresentationTRANSCRIPT
![Page 1: Stereo Images](https://reader034.vdocuments.site/reader034/viewer/2022051416/56813ded550346895da7c6ca/html5/thumbnails/1.jpg)
Stereo Images
Doug Blank
Bryn Mawr CollegeBased on work by J. Ben Schafer
![Page 2: Stereo Images](https://reader034.vdocuments.site/reader034/viewer/2022051416/56813ded550346895da7c6ca/html5/thumbnails/2.jpg)
What is this?
![Page 3: Stereo Images](https://reader034.vdocuments.site/reader034/viewer/2022051416/56813ded550346895da7c6ca/html5/thumbnails/3.jpg)
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](https://reader034.vdocuments.site/reader034/viewer/2022051416/56813ded550346895da7c6ca/html5/thumbnails/4.jpg)
Left Eye
![Page 5: Stereo Images](https://reader034.vdocuments.site/reader034/viewer/2022051416/56813ded550346895da7c6ca/html5/thumbnails/5.jpg)
Right Eye
![Page 6: Stereo Images](https://reader034.vdocuments.site/reader034/viewer/2022051416/56813ded550346895da7c6ca/html5/thumbnails/6.jpg)
Viewmaster
![Page 7: Stereo Images](https://reader034.vdocuments.site/reader034/viewer/2022051416/56813ded550346895da7c6ca/html5/thumbnails/7.jpg)
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](https://reader034.vdocuments.site/reader034/viewer/2022051416/56813ded550346895da7c6ca/html5/thumbnails/8.jpg)
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](https://reader034.vdocuments.site/reader034/viewer/2022051416/56813ded550346895da7c6ca/html5/thumbnails/9.jpg)
![Page 10: Stereo Images](https://reader034.vdocuments.site/reader034/viewer/2022051416/56813ded550346895da7c6ca/html5/thumbnails/10.jpg)
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](https://reader034.vdocuments.site/reader034/viewer/2022051416/56813ded550346895da7c6ca/html5/thumbnails/11.jpg)
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](https://reader034.vdocuments.site/reader034/viewer/2022051416/56813ded550346895da7c6ca/html5/thumbnails/12.jpg)
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](https://reader034.vdocuments.site/reader034/viewer/2022051416/56813ded550346895da7c6ca/html5/thumbnails/13.jpg)
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?