521493S Computer Graphics Exercise 3 (Chapters 6-8)

Similar documents
521493S Computer Graphics. Exercise 3

Illumination Model. The governing principles for computing the. Apply the lighting model at a set of points across the entire surface.

Dr Pavan Chakraborty IIIT-Allahabad

Grouping of Patches in Progressive Radiosity

Shading Models. Simulate physical phenomena

Texture Mapping with Vector Graphics: A Nested Mipmapping Solution

11/2/2010. In the last lecture. Monte-Carlo Ray Tracing : Path Tracing. Today. Shadow ray towards the light at each vertex. Path Tracing : algorithm

Global Illumination with Photon Map Compensation

Clipping. Administrative. Assignment 1 Gallery. Questions about previous lectures? Overview of graphics pipeline? Assignment 2

Introduction to Visualization and Computer Graphics

A Novel Iris Segmentation Method for Hand-Held Capture Device

Space-efficient Region Filling in Raster Graphics

Convex Hulls. Helen Cameron. Helen Cameron Convex Hulls 1/101

Last time: Disparity. Lecture 11: Stereo II. Last time: Triangulation. Last time: Multi-view geometry. Last time: Epipolar geometry

EE678 Application Presentation Content Based Image Retrieval Using Wavelets

Computer Graphics. Computer Graphics. Lecture 3 Line & Circle Drawing

Chapter 3: Graphics Output Primitives. OpenGL Line Functions. OpenGL Point Functions. Line Drawing Algorithms

An Efficient Coding Method for Coding Region-of-Interest Locations in AVS2

CS 428: Fall Introduction to. Geometric Transformations. Andrew Nealen, Rutgers, /15/2010 1

Cross products. p 2 p. p p1 p2. p 1. Line segments The convex combination of two distinct points p1 ( x1, such that for some real number with 0 1,

Perception of Shape from Shading

Lecture 3: Geometric Algorithms(Convex sets, Divide & Conquer Algo.)

Image Segmentation Based on Active Contours without Edges

COT5405: GEOMETRIC ALGORITHMS

Leak Detection Modeling and Simulation for Oil Pipeline with Artificial Intelligence Method

CENTRAL AND PARALLEL PROJECTIONS OF REGULAR SURFACES: GEOMETRIC CONSTRUCTIONS USING 3D MODELING SOFTWARE

Trigonometric Functions

An accurate and fast point-to-plane registration technique

Lecture 2: Fixed-Radius Near Neighbors and Geometric Basics

Discrete shading of three-dimensional objects from medial axis transform

CS335 Fall 2007 Graphics and Multimedia. 2D Drawings: Lines

GEOMETRIC CONSTRAINT SOLVING IN < 2 AND < 3. Department of Computer Sciences, Purdue University. and PAMELA J. VERMEER

Theoretical Analysis of Graphcut Textures

Privacy Preserving Moving KNN Queries

arxiv: v1 [cs.mm] 18 Jan 2016

P Z. parametric surface Q Z. 2nd Image T Z

Lecture 17: Recursive Ray Tracing. Where is the way where light dwelleth? Job 38:19

Wavelet Based Statistical Adapted Local Binary Patterns for Recognizing Avatar Faces

Measuring and modeling per-element angular visibility in multiview displays

Efficient Algorithms for Computing Conservative Portal Visibility Information

AUTOMATIC 3D SURFACE RECONSTRUCTION BY COMBINING STEREOVISION WITH THE SLIT-SCANNER APPROACH

Figure 8.1: Home age taken from the examle health education site (htt:// Setember 14, 2001). 201

A Low Distortion Map Between Disk and Square

Stereo Disparity Estimation in Moment Space

CMSC 425: Lecture 16 Motion Planning: Basic Concepts

MULTI-CAMERA SURVEILLANCE WITH VISUAL TAGGING AND GENERIC CAMERA PLACEMENT. Jian Zhao and Sen-ching S. Cheung

Efficient Parallel Hierarchical Clustering

Truth Trees. Truth Tree Fundamentals

10. Parallel Methods for Data Sorting

Cross products Line segments The convex combination of two distinct points p

Building Polygonal Maps from Laser Range Data

Learning Motion Patterns in Crowded Scenes Using Motion Flow Field

Lecture 7: Objects (Chapter 15) CS 1110 Introduction to Computing Using Python

Real Time Compression of Triangle Mesh Connectivity

Physically Based Rendering ( ) Intersection Acceleration

Patterned Wafer Segmentation

Robust Motion Estimation for Video Sequences Based on Phase-Only Correlation

Source Coding and express these numbers in a binary system using M log

CS 548: COMPUTER GRAPHICS DRAWING LINES AND CIRCLES SPRING 2015 DR. MICHAEL J. REALE

Animating Water in Chinese Painting *

Chapter 7, Part B Sampling and Sampling Distributions

Chapter 8: Adaptive Networks

Homographies and Mosaics

Depth Estimation for 2D to 3D Football Video Conversion

We will then introduce the DT, discuss some of its fundamental properties and show how to compute a DT directly from a given set of points.

Rendering. Converting a 3D scene to a 2D image. Camera. Light. Rendering. View Plane

Extracting Optimal Paths from Roadmaps for Motion Planning

Graph Cut Matching In Computer Vision

AUTOMATIC EXTRACTION OF BUILDING OUTLINE FROM HIGH RESOLUTION AERIAL IMAGERY

Orthogonal Projection Matrices. Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 2015

Computing the Convex Hull of. W. Hochstattler, S. Kromberg, C. Moll

Graduate Algorithms CS F-19 Computational Geometry

A Fast Image Restoration Method Based on an Improved Criminisi Algorithm

3D RECONSTRUCTION OF ROADS AND TREES FOR CITY MODELLING

ConcaveCubes: Supporting Cluster-based Geographical Visualization in Large Data Scale

Face Recognition Using Legendre Moments

PREDICTING LINKS IN LARGE COAUTHORSHIP NETWORKS

Lecture 8: Orthogonal Range Searching

Image Segmentation Using Topological Persistence


Gabriel Taubin. Desktop 3D Photography

Thickness computation of trimmed B-Rep model using GPU ray tracing

SPARSE SIGNAL REPRESENTATION FOR COMPLEX-VALUED IMAGING Sadegh Samadi 1, M üjdat Çetin 2, Mohammad Ali Masnadi-Shirazi 1

Constrained Empty-Rectangle Delaunay Graphs

Fast Shape-based Road Sign Detection for a Driver Assistance System

Real-time Character Posing Using Millions of Natural Human Poses

This is the peer reviewed version of the following article: Susín, A. and Ramírez, J.E. (2015). Segmentation-based skinning. Computer animation and

Dense 3D Reconstruction from Specularity Consistency

A DEA-bases Approach for Multi-objective Design of Attribute Acceptance Sampling Plans

Deformable Free Space Tilings for Kinetic Collision Detection

Learning Robust Locality Preserving Projection via p-order Minimization

Shuigeng Zhou. May 18, 2016 School of Computer Science Fudan University

L ENSES. Lenses Spherical refracting surfaces. n 1 n 2

An Indexing Framework for Structured P2P Systems

Curve Modeling (Spline) Dr. S.M. Malaek. Assistant: M. Younesi

Swinburne Research Bank

Bayesian Oil Spill Segmentation of SAR Images via Graph Cuts 1

An integrated system for virtual scene rendering, stereo reconstruction, and accuracy estimation.

Efficient Processing of Top-k Dominating Queries on Multi-Dimensional Data

Lets assume each object has a defined colour. Hence our illumination model is looks unrealistic.

Transcription:

521493S Comuter Grahics Exercise 3 (Chaters 6-8) 1 Most grahics systems and APIs use the simle lighting and reflection models that we introduced for olygon rendering Describe the ways in which each of these models are incorrect For each defect, give an examle of a scene in which you would notice the roblem Point sources roduce a very harsh lighting Such images are characterized by abrut transitions between light and dark The ambient light in a real scene is deendent in both the lights on the scene and the reflectivity roerties of the objects in the scene, something that cannot be comuted correctly with OenGL The Phong reflection term is not hysically correct; the reflection term in the modified Phong model is even further from being hysically correct 2 Comare the shadow-generation algorithm that uses rojections to the generation of shadows to a global rendering method that solves the rendering equation What tyes of shadows can be generated by one method but not the other? Global rendered that solves rendering equation calculates all shadows almost erfectly In that renderer, as each oint is shaded, a calculation is done to see which light sources shine on it through any route hotons can take and how much The rojection aroach assumes that we can roject each olygon onto all other olygons If the shadow of a given olygon rojects onto multile olygons, we could not comute these shadow olygons very easily In addition, we have not accounted for the different shades we might see if there were intersecting shadows from multile light sources, reflection of light from other surfaces, refractions of light through transarent surfaces etc Plainly, shadow rojection is very crude aroximation of lighting Even ray tracing doesn t get close 3 How is an image roduced with an environment ma different from a ray traced image of the same scene? The major roblem is that the environment ma is comuted without the object in the scene Thus, all global lighting calculations of which it should be art are incorrect These errors can be most noticeable if there are other reflective objects will now not show the reflection of the removed object Other errors can be caused by the removed object no longer blocking light and by its shadows being missing Other visual errors can be due to distortions in the maing of the environment to a simle shae, such as a cube, and to errors in a two ste maing In addition, a new environment ma should be comuted for each viewoint 1

4 In what tyes of alications might you refer a front-to-back rendering instead of a back-to-front rendering? Generally back-to-front rendering is nice because faces in front always aint over surfaces behind them However, the final color is not determined until the front most object is rocessed Suose you have a lot of overlaing oaque objects Then most of the rendering will have been wasted since only the final faces will determine the image In alications such as ray tracers, a front-to-back rendering can be far more efficient as we can sto rocessing objects along a ray as soon as we encounter the first oaque object 5 In what circumstances can you see aliasing roblems with texture maed surfaces? What tools does OenGL rovide to counter these effects? When texture is drawn on a surface by samling each texture osition at frequency that is lower than the actual rate the texture changes, aliasing can occur For examle with a black and white stried texture, we might samle values that are all white while all black stries can be resent between those samling oints In general, this kind of samling can cause flickering of small details in the texture OenGL allows use of different detail levels for textures At highest level, the original texture is used At next level, texture scaled to 1/4 size of the original is used At this level, each texture ixel values get average values of 4 ixels each At next level image is scaled down again and ixel values get averages of the revious level This technique is called mimaing When texture is alied during the rendering, roer level or even interolation between two closest levels of the texture is selected to avoid aliasing deending on the selected texturing mode When texture should be scaled down only on one direction and not on other, mimaing generally roduces blurry results as it assumes isotroic filtering requirements and not anisotroic Anisotroic filtering may be available as OenGL extension with the name of GL_EXT_texture_filter_anisotroic 2

6 Consider two line segments reresented in arametric form: (α) = (1 α) 1 + α 2, q(β) = (1 β)q 1 + βq 2 Find a rocedure for determining whether the segments intersect, and, if they do, for finding the oint of intersection Assume three dimensional coordinates First, consider the roblem in two dimensions We are looking for α and β such that both arametric equations yield the same oint, that is x(α) = (1 α)x 1 + αx 2 = (1 β)x 3 + βx 4, y(α) = (1 α)y 1 + αy 2 = (1 β)y 3 + βy 4 These two equations in the two unknowns an α and β and, as long as the line segments are not arallel (a condition that will lead to a division by zero), we can solve for α and β If both these values are between 0 and 1, the segments intersect As the equations are in 3D, we can solve two of them for the α and β where x and y meet If when we use these values of the arameters in the two equations for z, the segments intersect if we get the same z from both equations ----------------------------------------- 7 Prove that cliing a convex object against another convex object result in at most one convex object If we cli a convex region against a convex region, we roduce the intersection of the two regions, which is the set of all oints in both regions, which is a convex set and describes a convex region To see this, consider any two oints in the intersection The line segment connecting them must be in both sets and therefore the intersection is convex 8 Draw a one ixel wide line using Bresenham s algorithm from (10, 3) to (6, 8) We are drawing a line from (10, 3) to (6, 8) For Bresenham s line drawing algorithm, we need to calculate the following variables: x = 6 10 = 4 y = 8 3 = 5 The formulas in lecture material assume that y and both of them are 0 For more generic aroach we can define the movement so that east (E) is always the longer axis and 3

north (N) is the shorter one and they are always ositive Actual movement delta deends on the sign of the and y Because in this case y we define the variables in the following way: Long direction E y 5 Short direction N 4 Movement directions are E 0 1 and 1 1 NE Initial decision variable d 2 N E 2 y 2 4 5 3 Forward udate incre 2 N 2 2 4 8 incrne 2 N E 2 y 2 4 5 Diagonal udate 2 1 Setu initial oint: 10 3 ; Draw ixel at d 3 0 NE 9 4 ; d d incrne 2 1 3 1 ; Draw ixel at d 1 0 NE 8 5 ; d d incrne ; Draw ixel at d 1 0 E 8 6 ; d d incre 4 7 d 7 0 NE 7 7 ; d d incrne 5 5 d 5 0 NE 6 8 ; d d incrne 6 3 7 End oint reached ; Draw ixel at ; Draw ixel at ; Draw ixel at The easiest way to verify correctness is to use DDA algorithm as they should match exactly 9 Check if oint (3, 4) is inside concave olygon defined by vertices (1, 1), (6, 3), (4, 6), (1, 5), (2, 3), (1, 1) 4

Vertices (1, 1), (6, 3), (4, 6), (1, 5), (2, 3), (1, 1) form a olygon from line segments (1, 1; 6, 3), (6, 3; 4, 6), (4, 6; 1, 5), (1, 5; 2,3), (2, 3; 1, 1) One way to check if a oint is inside a olygon (even a concave one) is by counting how many times a horizontal line starting from it crosses olygon borders As we are investigating oint (3, 4) using a horizontal line, we need to check only lines that cross line y=4 Lines that cross this line are (6, 3; 4, 6) and (1, 5; 2, 3) Next we need to solve what are the x values for those line segments when y = 4 For line (6, 3; 4, 6): x = ky + b = d x y + b = 4 6 y + b = 2 y + b d y 6 3 3 Solving b at oint (6, 3): 6 = 2 3 + b b = 8 3 When y=4: x = 2 16 4 + 8 x = 5,33 > 3 so crossing is on right side of oint to 3 3 check Similarly for line (1, 5; 2, 3): x = ky + b = d x y + b = 2 1 y + b = 1 y + b d y 3 5 2 Solving b at oint (1, 5): 1 = 1 2 5 + b b = 7 2 When y=4: x = 1 4 + 7 x = 3 = 15 < 3 so crossing is on left side of oint to check 2 2 2 Odd number of olygon border crossings on one side means that the oint is inside the given olygon as we don t have any secial cases here either Even number would have been outside We can verify the correctness by drawing a icture 10 Images roduced on dislays that suort only a few colors or gray levels tend to show contour effects because the viewer can detect the differences between adjacent shades One technique for avoiding this visual effect is to add a little noise (jitter) to the ixel values Why does this technique work? How much noise should you add? Does it make sense to conclude that the degraded image created by the addition of noise is of quality higher than the original image? 5

If there are very few levels, we cannot dislay a gradual change in brightness Instead the viewer will see stes of intensity A simle rule of thumb is that we need enough gray levels so that a change of one ste is not visible We can mitigate the roblem by adding one bit of random noise to the least significant bit of a ixel Thus if we have 3 bits (8 levels), the third bit will be noise The effect of the noise will be to break u regions of almost constant intensity so the user will not be able to see a ste because it will be masked by the noise In a statistical sense the jittered image is a noisy (degraded) version of the original but in a visual sense it aears better 6