Creating Anaglyphs - PowerPoint PPT Presentation

1 / 15
About This Presentation
Title:

Creating Anaglyphs

Description:

Will cover the introduction and the unit on pictures (chapters 1-5) ... But you need those funny glasses (I have both red/cyan and yellow/blue glasses) ... – PowerPoint PPT presentation

Number of Views:1194
Avg rating:3.0/5.0
Slides: 16
Provided by: csU57
Category:

less

Transcript and Presenter's Notes

Title: Creating Anaglyphs


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
(No Transcript)
13
So what would the code look like?
  • def anaglyph(left,right)
  • output makeEmptyPicture(getWidth(left),getHeig
    ht(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

14
Slightly better code
  • def anaglyph(left,right)
  • output makeEmptyPicture(getWidth(left),getHeig
    ht(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)getBl
    ue(s1))/3)
  • setGreen(target,getGreen(s2))
  • setBlue(target,getBlue(s2))
  • return output

15
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
Write a Comment
User Comments (0)
About PowerShow.com