Image Synthesis Rabie A. Ramadan, PhD 3. 2 Our Problem.

Slides:



Advertisements
Similar presentations
Sampling and Reconstruction
Advertisements

Computer Graphics- SCC 342
Computer Vision Lecture 7: The Fourier Transform
CS 352: Computer Graphics Chapter 7: The Rendering Pipeline.
CS 4363/6353 BASIC RENDERING. THE GRAPHICS PIPELINE OVERVIEW Vertex Processing Coordinate transformations Compute color for each vertex Clipping and Primitive.
Computer Graphics Viewing, Rendering, Antialiasing گرد آوري و تاليف: دكتر احمد رضا نقش نيل چي دانشگاه اصفهان گروه مهندسي كامپيوتر.
Computer Graphics Visible Surface Determination. Goal of Visible Surface Determination To draw only the surfaces (triangles) that are visible, given a.
CS 551 / CS 645 Antialiasing. What is a pixel? A pixel is not… –A box –A disk –A teeny tiny little light A pixel is a point –It has no dimension –It occupies.
Advanced Computer Graphics CSE 190 [Spring 2015], Lecture 5 Ravi Ramamoorthi
School of Computing Science Simon Fraser University
Sampling Pixel is an area!! – Square, Rectangular, or Circular? How do we approximate the area? – Why bother? Color of one pixel Image Plane Areas represented.
Fourier Transform Analytic geometry gives a coordinate system for describing geometric objects. Fourier transform gives a coordinate system for functions.
Image Enhancement in the Frequency Domain Part I Image Enhancement in the Frequency Domain Part I Dr. Samir H. Abdul-Jauwad Electrical Engineering Department.
CSCE 641 Computer Graphics: Fourier Transform Jinxiang Chai.
1 Computer Science 631 Lecture 3: Morphing, Sampling Ramin Zabih Computer Science Department CORNELL UNIVERSITY.
CPSC 641 Computer Graphics: Fourier Transform Jinxiang Chai.
Computational Photography: Fourier Transform Jinxiang Chai.
CSC418 Computer Graphics n Aliasing n Texture mapping.
Advanced Computer Graphics CSE 190 [Spring 2015], Lecture 3 Ravi Ramamoorthi
The Digital Image.
Topic 7 - Fourier Transforms DIGITAL IMAGE PROCESSING Course 3624 Department of Physics and Astronomy Professor Bob Warwick.
Fundamentals Rawesak Tanawongsuwan
Basics of Signal Processing. SIGNALSOURCE RECEIVER describe waves in terms of their significant features understand the way the waves originate effect.
C O M P U T E R G R A P H I C S Jie chen Computer graphic -- Programming with OpenGL I.
Antialiasing CAP4730: Computational Structures in Computer Graphics.
storing data in k-space what the Fourier transform does spatial encoding k-space examples we will review:  How K-Space Works This is covered in the What.
Week 2 - Wednesday CS361.
Image Synthesis Rabie A. Ramadan, PhD 2. 2 Java OpenGL Using JOGL: Using JOGL: Wiki: You can download JOGL from.
Texture Mapping. Scope Buffers Buffers Various of graphics image Various of graphics image Texture mapping Texture mapping.
Buffers Textures and more Rendering Paul Taylor & Barry La Trobe University 2009.
Image Synthesis Rabie A. Ramadan, PhD D Images.
Digital Media Dr. Jim Rowan ITEC Vector Graphics Elegant way to construct digital images that –have a compact representation –are scalable –are.
CS 638, Fall 2001 Multi-Pass Rendering The pipeline takes one triangle at a time, so only local information, and pre-computed maps, are available Multi-Pass.
Image Synthesis Rabie A. Ramadan, PhD 1. 2 About my self Rabie A. Ramadan My website and publications
Week 6 - Wednesday.  What did we talk about last time?  Light  Material  Sensors.
ECE 4710: Lecture #6 1 Bandlimited Signals  Bandlimited waveforms have non-zero spectral components only within a finite frequency range  Waveform is.
COMPUTER GRAPHICS CSCI 375. What do I need to know?  Familiarity with  Trigonometry  Analytic geometry  Linear algebra  Data structures  OOP.
Lecture 7: Sampling Review of 2D Fourier Theory We view f(x,y) as a linear combination of complex exponentials that represent plane waves. F(u,v) describes.
October 29, 2013Computer Vision Lecture 13: Fourier Transform II 1 The Fourier Transform In the previous lecture, we discussed the Hough transform. There.
Image Processing Basics. What are images? An image is a 2-d rectilinear array of pixels.
Computer Graphics Chapter 6 Andreas Savva. 2 Interactive Graphics Graphics provides one of the most natural means of communicating with a computer. Interactive.
Digital Media Dr. Jim Rowan ITEC So far… We have compared bitmapped graphics and vector graphics We have discussed bitmapped images, some file formats.
Image Synthesis Rabie A. Ramadan, PhD 4. 2 Review Questions Q1: What are the two principal tasks required to create an image of a three-dimensional scene?
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
GG313 Lecture 24 11/17/05 Power Spectrum, Phase Spectrum, and Aliasing.
Lecture 6 Rasterisation, Antialiasing, Texture Mapping,
Digital Media Dr. Jim Rowan ITEC Vector Graphics Elegant way to construct digital images that –have a compact representation –are scalable –are.
What are shaders? In the field of computer graphics, a shader is a computer program that runs on the graphics processing unit(GPU) and is used to do shading.
Lecture 3: The Sampling Process and Aliasing 1. Introduction A digital or sampled-data control system operates on discrete- time rather than continuous-time.
Digital Media Lecture 5: Vector Graphics Georgia Gwinnett College School of Science and Technology Dr. Jim Rowan.
1 Programming with OpenGL Part 2: Complete Programs.
2D Fourier Transform.
OUTPUT PRIMITIVES A.Aruna/Faculty of Information technology/SNSCE13/19/2016.
Computer Graphics I, Fall Programming with OpenGL Part 2: Complete Programs.
Computer Graphics CC416 Lecture 04: Bresenham Line Algorithm & Mid-point circle algorithm Dr. Manal Helal – Fall 2014.
Advanced Computer Graphics
Advanced Computer Graphics
Dr. Nikos Desypris, Oct Lecture 3
Fundamentals Data.
Fourier Transform.
Fourier Transform Analytic geometry gives a coordinate system for describing geometric objects. Fourier transform gives a coordinate system for functions.
Fourier Transform Analytic geometry gives a coordinate system for describing geometric objects. Fourier transform gives a coordinate system for functions.
Digital Media Dr. Jim Rowan ITEC 2110.
CSCE 643 Computer Vision: Thinking in Frequency
UMBC Graphics for Games
OpenGL program.
Fourier Transform Analytic geometry gives a coordinate system for describing geometric objects. Fourier transform gives a coordinate system for functions.
Sweep Fill Details For row = min to row=max
CSC418 Computer Graphics Aliasing Texture mapping.
Presentation transcript:

Image Synthesis Rabie A. Ramadan, PhD 3

2 Our Problem

3 Going Through the Source Code

4 Handling Exit Handling users’ keys

5 Initial Rendering The call makes sure that an object shows up behind an object in front of it that has already been drawn, which we want to happen. Note that glEnable, like every OpenGL function, begins with "gl".

6 Resizing Window The handleResize function is called whenever the window is resized.

7 w and h are the new width and height of the window. When we pass 45.0 to gluPerspective, we're telling OpenGL the angle that the user's eye can see. The 1.0 indicates not to draw anything with a z coordinate of greater than -1. The tells OpenGL not to draw anything with a z coordinate less than -200.

8 Drawing the Seen The drawScene function is where the 3D drawing actually occurs. First, we call glClear to clear information from the last time we drew. In most every OpenGL program, you'll want to do this.

9 Drawing the Seen For now, we'll ignore this. It'll make sense after the next lesson, which covers transformations.

10 Drawing Trapezoid We call glBegin(GL_QUADS) to tell OpenGL that we want to start drawing quadrilaterals. We specify the four 3D coordinates of the vertices of the trapezoid, in order When we call glVertex3f, we are specifying three (that's where the "3" comes from) float (that's where the "f" comes from) coordinates

11 Drawing Pentagon To draw it, we split it up into three triangles,

12 Drawing the Final Triangle

13 Sending the Drawings to the Screen This line makes OpenGL actually move the scene to the window. We'll call it whenever we're done drawing a scene.

14 Calling the main() In the call to glutInitWindowSize, we set the window to be 400x400. When we call glutCreateWindow, we tell it what title we want for the window. Then, we call initRendering, the function that we wrote to initialize OpenGL rendering.

15 handling keypresses and drawing and resizing the window

16 Going in a loop to keep Scene visible

17 Transformations We'll make the shapes rotate in 3D.

18 Transformations imagine a bird flying around the scene. It starts out at the origin, facing the negative z direction. The bird can move, rotate, and even grow or shrink.

Lesson 2 Video 19 Transformations

20 Digital Images and Image Manipulation Digital image stored as a rectangular array of pixels in the color buffer. Each pixel value may be a single scalar component, or a vector containing a separate scalar value for each color component.

21 Digital Images and Image Manipulation Assume that each pixel accurately represents the average color value of the geometric primitives that cover it. The process of converting a continuous function into a series of discrete values is called sampling. A geometric primitive, projected into 2D, can be thought of as defining a continuous function of its spatial coordinates x and y.

22 Digital Images and Image Manipulation For example, a triangle can be represented by a function fcontinuous(x, y). It returns the color of the triangle when evaluated within the triangle’s extent, then drops to zero if evaluated outside of the triangle. Note that: An ideal function has an abrupt change of value at the triangle boundaries. This instantaneous drop-off is what leads to problems when representing geometry as a sampled image.

23 Digital Images and Image Manipulation The output of the function isn’t limited to a color; it can be any of the primitive attributes: intensity (color), depth, or texture coordinates; To avoid overcomplicating matters, we can limit the discussion to intensity values without losing any generality.

24 Digital Images and Image Manipulation A straightforward approach to sampling the geometric function is to Evaluate the function at the center of each pixel in window coordinates. The number of samples per unit length in each direction defines the sample rate.

25 Digital Images and Image Manipulation When the pixel values are used to display the image, a reproduction of the original function is reconstructed from the set of sample values. The reconstruction process produces a new continuous function. The reconstruction function may vary in complexity; for example, it may simply repeat the sample value across the sample period

26 Digital Images and Image Manipulation Example of image reconstruction Example of image reconstruction This reconstruction function is complex, involving not only properties of the video circuitry, but also the shape, pattern, and physics of the phosphor on the screen.

27 Digital Images and Image Manipulation The reliability of the reproduction is a critical aspect of using digital images. A fundamental concern of sampling Ensuring that there are enough samples to accurately reproduce the desired function. The problem is that a set of discrete sample points cannot capture arbitrarily complicated detail, even if we use the most sophisticated reconstruction function.

28 Digital Images and Image Manipulation considering an intensity function that has the similar values at two sample points P1 and P3, but between these points P2 the intensity varies significantly The result is that the reconstructed function doesn’t reproduce the original function very well (Under sampling )

29 Sampling Process To understand sampling, it helps to rely on some signal processing theory, in particular, Fourier analysis. In signal processing, the continuous intensity function is called a signal. This signal is traditionally represented in the spatial domain as a function of spatial coordinates

30 Sampling Process Fourier analysis : sine waves The signal can be equivalently represented as a weighted sum of sine waves of different frequencies and phase offsets. The corresponding frequency domain representation of a signal describes the magnitude and phase offset of each sine wave component. The frequency domain representation describes the spectral composition of the signal.

31 Sampling Process From sine wave decomposition, it becomes clear that the number of samples required to reproduce a sine wave must be twice its frequency, assuming ideal reconstruction. This requirement is called the Nyquist limit. Generalizing from this result, to accurately reconstruct a signal, the sample rate must be at least twice the rate of the maximum frequency in the original signal.

32 Sampling Process Reconstructing an undersampled sine wave results in a different sine wave of a lower frequency. This low-frequency version is called an alias. Aliased signals in digital images give rise to the familiar artifacts of jaggies, or staircasing at object boundaries.

33 Digital Filtering Next time ISA.