1 / 63

NUS Computing Camp for Junior Colleges & High School Students Stereogram Generation Workshop

NUS Computing Camp for Junior Colleges & High School Students Stereogram Generation Workshop. Dr Ben Leong NUS School of Computing 28 Nov 2012. What are stereograms?. How do stereograms work?. Because there is a small separation between our eyes, they perceive slightly different images

Download Presentation

NUS Computing Camp for Junior Colleges & High School Students Stereogram Generation Workshop

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. NUS Computing Camp for Junior Colleges & High School StudentsStereogram Generation Workshop Dr Ben Leong NUS School of Computing 28 Nov 2012

  2. What are stereograms?

  3. How do stereograms work? • Because there is a small separation between our eyes, they perceive slightly different images • These differences allow us to perceive depth. • Autostereograms work by repeating patterns in such a way as to give us an illusion of depth

  4. D C A B How do stereograms work? Image plane

  5. Generation of stereograms • Key idea: compute the sets of points that are constrained to be of the same colour • Note that we can compute the required image one line at a time • How do we compute these sets? • Use simple geometry

  6. Generation of stereograms • Create a 3-d model of the object • Use a function f(x,y) to define the depth of an object • Decide on some parameters • Distance between eyes and image • Position of object relative to image plane • Distance between the two eyes • Compute one line at a time

  7. Generation of stereograms Image plane

  8. Generation of stereograms Image plane

  9. Generation of stereograms Image plane How far?

  10. Generation of stereograms -z Image plane A s D E

  11. STEREOGRAM GENERATOR depth map stereogram How would YOU create a stereogram? • We have already written the program that will automatically generate a stereogram based on the method described. • What you need to do is to create a depth map and feed it to the stereogram generator:

  12. How would YOU create a stereogram? • Our stereogram generator is written in Scheme • You will learn how to manipulate some simple objects to build your own depth maps and create your own stereograms • Simple programming 

  13. Plan for Today • You will get a worksheet that will guide you through what we have discussed • My lab assistants will help you • Create cool stereograms and share with your friends and family

  14. Primitive building blocks (show rcross-bb)

  15. Primitive building blocks (show corner-bb)

  16. Primitive building blocks (show sail-bb)

  17. Primitive building blocks (show nova-bb)

  18. Primitive building blocks (show heart-bb)

  19. Primitive building blocks (show circle-bb)

  20. Primitive building blocks (show spiral-bb)

  21. Primitive Operation:Rotating to the Right (clear) (show (quarter-turn-right sail-bb))

  22. Derived Operation:Rotating Upside Down (clear) (show (turn-upside-down sail-bb))

  23. How about Rotating to the Left? (clear) (show (quarter-turn-left sail-bb))

  24. Flipping Objects (clear) (show (flip-horiz nova-bb)) (clear) (show (flip-vert nova-bb))

  25. Means of Combination:Stacking (clear) (show (stack rcross-bb sail-bb))

  26. Multiple Stacking (clear) (show (stack rcross-bb (stack rcross-bb sail-bb)))

  27. Placing objects one beside the other (clear) (show (beside sail-bb rcross-bb))

  28. A complex object (clear) (show (stack (beside (quarter-turn-right rcross-bb) (turn-upside-down rcross-bb)) (beside rcross-bb (quarter-turn-left rcross-bb)))) This operation is also known asmake-cross

  29. Naming your objects with define (clear) (define myPic (make-cross sail-bb)) (show myPic) (define myPic2 (make-cross nova-bb)) (show myPic2)

  30. Repeating the pattern (clear) (show (make-cross (make-cross nova-bb)))

  31. Repeating multiple times (clear) (show (repeat-pattern 4 make-cross nova-bb))

  32. What about 3 rows? (clear) (show (stack-frac 1/3 rcross-bb sail-bb)) (clear) (show (stack-frac 1/3 rcross-bb (stack rcross-bb rcross-bb)))

  33. Repeating n times (clear) (show (stackn 3 nova-bb)) (clear) (show (stackn 5 nova-bb))

  34. A rectangular repeated pattern (clear) (show (stackn 5 (quarter-turn-right (stackn 5 (quarter-turn-left nova-bb)))))

  35. Another regular pattern (clear) (show (nxn 3 (make-cross rcross-bb)))

  36. Creating 3D objects • We use greyscale to represent depth • Black is nearest to you • White is furthest away means

  37. Creating 3D objects means

  38. Overlay Operation (clear) (show (overlay sail-bb rcross-bb))

  39. Advanced Overlay Operation (clear) (show (overlay-frac 1/4 corner-bb heart-bb))

  40. Scaling (clear) (show (scale 1/2 heart-bb))

  41. Wait, did we say we’re creating stereograms? • Yeah, that’s the easy part! • Do: (stereogram <depth map>) • Example: (show (overlay sail-bb rcross-bb)) (stereogram (overlay sail-bb rcross-bb))

  42. Your First Stereogram

  43. Loading from/Saving to File • You can also create a depth map using some paint program and load using: (load-map <filename>) • You can save your work with: (save <filename>)

  44. What if you cannot see stereograms?

  45. Think Different Image plane

  46. Think Different Image plane

  47. Think Different Image plane

  48. 3D Anaglyphs Image plane Use filters to show one image to each eye!

  49. What else can we do to create an illusion of 3D?

More Related