Creating anaglyphs
Download
1 / 15

Session 19 - PowerPoint PPT Presentation


  • 293 Views
  • Uploaded on

Creating Anaglyphs Announcements REMINDER - In class exam on Monday, March 2 nd Closed book/closed notes Will cover the introduction and the unit on pictures (chapters 1-5) Will follow the same general format of the quizzes (may even include some of those questions a second time)

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Session 19' - Samuel


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

Announcements l.jpg
Announcements

  • REMINDER - In class exam on Monday, March 2nd

    • Closed book/closed notes

    • Will cover the introduction and the unit on pictures (chapters 1-5)

    • Will follow the same general format of the quizzes (may even include some of those questions a second time)

    • Will not ask you to write any significant code

    • I will not be here (Dr. Fienup will proctor)


Announcements3 l.jpg
Announcements

  • CHANGE - In lab exam is on Tuesday, March 10th

    • Closed book/closed notes

    • No access to the internet or your previous assignments

    • Will ask you to write two or three methods to manipulate picture(s)

    • I will be here


Announcements4 l.jpg
Announcements

  • CHANGE - Tuesday, March 3rd is now a lab

    • Introduction to sound

    • Read chapter six prior to lab

    • I will not be here

    • Dossay will answer your questions in lab


Announcements5 l.jpg
Announcements

  • PA04 is now posted

    • Use the graphics commands and pictures to create a comic strip

    • At least four frames (for which you draw lines to separate)

    • At least two characters

    • At least one character must be changed by you via code.

    • At least one piece of text

    • Due on Tuesday, March 10th (yes, the day of the in-lab exam)




That is an old fashioned stereograph l.jpg
That is an 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




But how could we do this at home l.jpg
But how could we do this “at home”

  • Answer:

    • Anaglyphs

    • Split one photo (normally the left eye) into its red channel

    • Split the other photo (normally the right eye) into its cyan channel

    • Merge

    • But you need those funny glasses (I have both red/cyan and yellow/blue glasses)


So what would the code look like l.jpg
So what would the code look like?

def anaglyph(left,right):

output = makeEmptyPicture(getWidth(left),getHeight(left))

for x in range(1,getWidth(left)):

for y in range(1,getHeight(left)):

target = getPixel(output,x,y)

s1 = getPixel(left,x,y)

s2 = getPixel(right,x,y)

setRed(target,getRed(s1))

setGreen(target,getGreen(s2))

setBlue(target,getBlue(s2))

return output


Slightly better code l.jpg
Slightly “better” code

def anaglyph(left,right):

output = makeEmptyPicture(getWidth(left),getHeight(left))

for x in range(1,getWidth(left)):

for y in range(1,getHeight(left)):

target = getPixel(output,x,y)

s1 = getPixel(left,x,y)

s2 = getPixel(right,x,y)

setRed(target,(getRed(s1)+getGreen(s1)+getBlue(s1))/3)

setGreen(target,getGreen(s2))

setBlue(target,getBlue(s2))

return output


Sources for images l.jpg
Sources for images

  • Several Websites

    • http://www.studio3d.com/pages/anaglyph.html

    • http://www.studio3d.com/pages/stereophoto.html

    • http://hazyhills.com/mars3d/

  • Take them yourself

    • Take two photos with one slightly to the right of the other


ad