1 / 15

Creating Anaglyphs

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)

Samuel
Télécharger la présentation

Creating Anaglyphs

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Creating Anaglyphs

  2. 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)

  3. 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

  4. 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

  5. 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)

  6. Finishing up ObamifyMe

  7. Who knows what this is

  8. 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

  9. Left Eye

  10. Right Eye

  11. 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)

  12. 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

  13. 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

  14. 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

More Related