Homework #1. Displays, Image Processing, Affine Transformations, Hierarchical Modeling

Similar documents
Homework #1. Displays, Image Processing, Affine Transformations, Hierarchical Modeling

Homework #1. Displays, Alpha Compositing, Image Processing, Affine Transformations, Hierarchical Modeling

Homework #1. Displays, Image Processing, Affine Transformations, Hierarchical modeling, Projections

Homework #2. Shading, Projections, Texture Mapping, Ray Tracing, and Bezier Curves

Image processing. Reading. What is an image? Brian Curless CSE 457 Spring 2017

Homework 3: Shading, Raytracing, and Image Processing

Basics of Computational Geometry

Computer Science 336 Fall 2017 Homework 2

1 Affine and Projective Coordinate Notation

Graphics and Interaction Transformation geometry and homogeneous coordinates

COMP30019 Graphics and Interaction Transformation geometry and homogeneous coordinates

CS 130 Final. Fall 2015

Image warping , , Computational Photography Fall 2017, Lecture 10

(Refer Slide Time: 00:04:20)

Transforms. COMP 575/770 Spring 2013

CSE528 Computer Graphics: Theory, Algorithms, and Applications

CSE328 Fundamentals of Computer Graphics

Representing 2D Transformations as Matrices

Computer Graphics 7: Viewing in 3-D

Lecture 4: Spatial Domain Transformations

Midterm Exam Fundamentals of Computer Graphics (COMP 557) Thurs. Feb. 19, 2015 Professor Michael Langer

CMSC427: Computer Graphics Lecture Notes Last update: November 21, 2014

Lecture 6 Sections 4.3, 4.6, 4.7. Wed, Sep 9, 2009

You will have the entire period (until 9:00pm) to complete the exam, although the exam is designed to take less time.

CS1114 Assignment 5, Part 1

Chapter 2: Transformations. Chapter 2 Transformations Page 1

Chapter 1. Linear Equations and Straight Lines. 2 of 71. Copyright 2014, 2010, 2007 Pearson Education, Inc.

Homework #2. Shading, Ray Tracing, and Texture Mapping

Unit 14: Transformations (Geometry) Date Topic Page

The points (2, 2, 1) and (0, 1, 2) are graphed below in 3-space:

Unit Circle. Project Response Sheet

Mathematics Background

Geometric transformations assign a point to a point, so it is a point valued function of points. Geometric transformation may destroy the equation

Geometry R. Unit 12 Coordinate Geometry. Day Classwork Day Homework Wednesday 3/7 Thursday 3/8 Friday 3/9

Computer Vision I - Basics of Image Processing Part 1

Chapter 5. Transforming Shapes

Computer Graphics: Geometric Transformations

Homework #2. Hidden Surfaces, Projections, Shading and Texture, Ray Tracing, and Parametric Curves

UNIT 2 2D TRANSFORMATIONS

Affine Transformation. Edith Law & Mike Terry

The Graphics Pipeline. Interactive Computer Graphics. The Graphics Pipeline. The Graphics Pipeline. The Graphics Pipeline: Clipping

Computer Graphics: Viewing in 3-D. Course Website:

Ray Tracer Due date: April 27, 2011

Unit 1, Lesson 1: Moving in the Plane

Final Exam Study Guide

Computer Vision CSCI-GA Assignment 1.

Lesson 20: Exploiting the Connection to Cartesian Coordinates

ME5286 Robotics Spring 2013 Quiz 1

EE795: Computer Vision and Intelligent Systems

Ray Tracer I: Ray Casting Due date: 12:00pm December 3, 2001

Introduction to Homogeneous coordinates

Final Review CMSC 733 Fall 2014

Noise Model. Important Noise Probability Density Functions (Cont.) Important Noise Probability Density Functions

Calculus III. Math 233 Spring In-term exam April 11th. Suggested solutions

Introduction to Transformations. In Geometry

Institutionen för systemteknik

Interactive Computer Graphics. Hearn & Baker, chapter D transforms Hearn & Baker, chapter 5. Aliasing and Anti-Aliasing

CS 4620 Midterm 1. Tuesday 22 October minutes

EE795: Computer Vision and Intelligent Systems

CSE 167: Introduction to Computer Graphics Lecture #3: Coordinate Systems

Vector Calculus: Understanding the Cross Product

Background for Surface Integration

COMP30019 Graphics and Interaction Three-dimensional transformation geometry and perspective

EXAM SOLUTIONS. Image Processing and Computer Vision Course 2D1421 Monday, 13 th of March 2006,

Why is computer vision difficult?

Handout 1: Viewing an Animation

Geometry Sixth Grade

Homogeneous Coordinates and Transformations of the Plane

Topics and things to know about them:

R(-14, 4) R'(-10, -2) S(-10, 7) S'(-6, 1) T(-5, 4) T'(-1, -2)

2D rendering takes a photo of the 2D scene with a virtual camera that selects an axis aligned rectangle from the scene. The photograph is placed into

Overview. By end of the week:

MATRIX REVIEW PROBLEMS: Our matrix test will be on Friday May 23rd. Here are some problems to help you review.

Figure 1. Lecture 1: Three Dimensional graphics: Projections and Transformations

CSE 167: Introduction to Computer Graphics Lecture #4: Coordinate Systems

Summer Review for Students Entering Pre-Calculus with Trigonometry. TI-84 Plus Graphing Calculator is required for this course.

2D/3D Geometric Transformations and Scene Graphs

Study Guide - Geometry

Computer Vision I Name : CSE 252A, Fall 2012 Student ID : David Kriegman Assignment #1. (Due date: 10/23/2012) x P. = z

2D and 3D Transformations AUI Course Denbigh Starkey

Summer Review for Students Entering Pre-Calculus with Trigonometry. TI-84 Plus Graphing Calculator is required for this course.

COMP Preliminaries Jan. 6, 2015

CS 184, Fall 1996 Midterm #1 Professor: unknown

CSE 167: Introduction to Computer Graphics Lecture #3: Projection. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2013

Transformations. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico

Student Outcomes. Lesson Notes. Classwork. Opening Exercise (3 minutes)

CS4442/9542b Artificial Intelligence II prof. Olga Veksler

2-1 Transformations and Rigid Motions. ENGAGE 1 ~ Introducing Transformations REFLECT

CSE152a Computer Vision Assignment 1 WI14 Instructor: Prof. David Kriegman. Revision 0

2D Image Transforms Computer Vision (Kris Kitani) Carnegie Mellon University

ECG782: Multidimensional Digital Signal Processing

CSE 167: Introduction to Computer Graphics Lecture #3: Projection. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2016

CS4442/9542b Artificial Intelligence II prof. Olga Veksler

CS 184, Fall 1996 Midterm #1 Professor: unknown

Visual Recognition: Image Formation

CCM6+/7+ - Unit 13 - Page 1 UNIT 13. Transformations CCM6+/7+ Name: Math Teacher: Projected Test Date:

Affine Transformations. Transforming shape models Combining affine transformations Scene graphs, interactor trees Hit tests on transformed shapes

Unit 1 NOTES Honors Math 2 1

CS475/675: Computer Graphics End-Semester Examination (Solutions), Fall 2016

Linear transformations Affine transformations Transformations in 3D. Graphics 2009/2010, period 1. Lecture 5: linear and affine transformations

Transcription:

Computer Graphics Instructor: Brian Curless CSE 457 Spring 217 Homework #1 Displays, Image Processing, Affine Transformations, Hierarchical Modeling Assigned: Friday, April 7 th Due: Thursday, April 2 th at the beginning of class Directions: Please provide short written answers to the following questions on your own paper. Feel free to discuss the problems with classmates, but please follow the Gilligan s Island rule*, answer the questions on your own, and show your work. Please write your name on your assignment! * The Gilligan's Island Rule: This rule says that you are free to meet with fellow student(s) and discuss assignments with them. Writing on a board or shared piece of paper is acceptable during the meeting; however, you should not take any written (electronic or otherwise) record away from the meeting. After the meeting, engage in a half hour of mind-numbing activity (like watching an episode of Gilligan's Island), before starting to work on the assignment. This will assure that you are able to reconstruct what you learned from the meeting, by yourself, using your own brain.

Clarifications posted to class Problem 2 Part (e): The sharpen parameter is beta. There was an alpha in the problem originally. The pdf was updated. Problem 4 The matrix M_xy was missing. (For some reason, MS Word had dropped it from the file. Grr.) Now fixed in the posted pdf. Problem 5 The pincer operates by translating primitives 7 and 8 toward or away from each other according to d. Assume that the center of part 1 is sitting at the origin in world coordinates. I updated the pdf to note this in part 5a, so that it applies to the rest of the problem. Part (a): You will need to apply scale factors to geometry. As stated in the problem, you can get these by measuring the figures with a ruler and assume that scale factors are either integers (1, 2, 3,...) or simple fractions (1/2, 1/3, 1/4,...). I update the intro above the figures to clarify this further, now in the homework pdf. Part (a): You should follow the structure that you see on slide 11 of the Hierarchical Modeling lecture. In that slide, the robot arm is rooted by the part "Base" and has an edge that connects it to its geometry "Cylinder" and another edge the connects to the rest of the model. "Base" is the same type as a "part number" in problem 5a (i.e., just a label), and "Cylinder" is the same as geometry (A or B) in this problem (i.e., the thing that actually gets drawn). 2

Problem 1: Short answer (1 points) a) (2 Points) Suppose you removed the LCD panel in front of the unpolarized backlight you removed the entire assembly with polarizers, crystals, color filters, everything and looked right at the even backlighting with your naked eye(s); you would see even, white light. Roughly how much dimmer would you expect that light to become after putting the LCD panel back, assuming the framebuffer is set to white at each pixel for both eyes? [Note that unpolarized light intensity is cut in half by a linear polarizer. Assume that the R,G,B sub-pixels each transmit 1/3 of the visible spectrum of the light.] Justify your answer. b) (2 points) What is the purpose of double-buffering and how does it work? c) (2 points) Why does bilateral filtering not work for removing outlier noise (like salt-and-pepper or impulse noise)? d) (4 Points) Consider two vectors u and v which are of non-zero length and not parallel to each other. Which of the following is true and which is false: 1. v u v = v u v 2. u v u v 3. v v u v u 4. v u u v v You do not need to justify your answer. 3

Problem 2: Image processing (25 points) In this problem, you will consider several convolution filtering operations and their behaviors. You do not need to worry about flipping filters before sliding them across images; i.e., assume filters are preflipped. In addition, assume that the y-axis points up, the x-axis points to the right, and the lower left corner of the image is at (,). For each sub-problem, justify your answer. a) (3 points) The image you re editing is too dark and noisy, and you decide you need to blur the image a little with a 3x3 filter to reduce noise, and amplify the overall brightness of the image by a factor of 3. Suggest a single convolution filter that perform this task when applied to the image. (Technically, pixel values could go out of range, i.e., brighter than 255 in one or more color channels at a pixel; assume that any needed clamping will be taken care of later, after filtering). b) (3 points) While taking a photograph with your digital camera, you fail to hold the camera steady, and it translates diagonally along the x = y direction while the shutter is open. You discover this later when you see that diagonal x = -y (or equivalently, y = -x) edges, in particular, have been blurred a bit (an effect called motion blur ). You decide to filter the image so that diagonal x = -y edges are sharpened, but diagonal x = y edges are unchanged. Suggest a single convolution filter that does this. c) (3 points) After thinking a little more about the previous picture, you decide that motion blur is cool, and you want to apply it to another image. In this case, though, you want to simulate the effect of a camera translating horizontally (in the x-direction) while the shutter is open. Suggest a convolution filter that would accomplish some horizontal blurring along that direction by averaging across m pixels. d) (3 points) Describe a non-constant image that, when convolved with your horizontal blur filter from (c), would be unchanged by the filter. (You may ignore the boundaries.) e) (7 points) We can think of sharpening as removing blur from an image. Suppose you take an image f and convolve it with a 3x3 mean filter. Now you multiply the resulting blurred image by and subtract the result from the original image. You can think of the parameter as controlling how much blur you remove. The resulting image will be a bit sharper, but also a bit darker, which can be corrected with suitable brightening. Solve for a single, normalized filter that performs all of these steps when convolved with the image, with left as a variable in your filter. Note that the normalization will actually take care of the needed brightening. Show your work. f) (2 points) What filter do you get from part (e) if you set = 1/2? Try applying it using your Impressionist project. Does it sharpen? g) (4 points) Suppose you follow the same sharpening process as in part (e), but this time you blur the original image with the following filter: 1/5 1/5 1/5 1/5 1/5 then multiply the result by 5/6, subtract it from the original image, and fix the brightness. Solve for the (normalized) filter that will accomplish these steps all at once when convolved with the original image. Show your work. The result should resemble a filter we have discussed before which one? 4

Problem 3: Triangle coordinates (24 points) Consider triangle ABC and a point Q depicted below: y C A Q B x A, B, C, and Q lie in the x-y plane, so, neglecting the homogeneous coordinate, we can write out their 3D coordinates as: Ax Bx Cx Qx A A y B B y C C y Q Q y The last coordinate is the z coordinate in this case, and we know that Az = Bz = Cz = Qz =. Note that Q is depicted as lying inside of ABC, but you should not assume that it does unless stated otherwise in a sub-problem. Assume that A B C, i.e., the triangle is not degenerate. Further assume that if you curl the fingers of your right hand from A to B to C, your thumb will point in the direction of the positive z-axis. (a) (3 points) Using cross and/or dot products, devise a test (with the help of equations) to ermine if point Q lies inside of ABC. You should assume that the edges and vertices of the triangle are part of the interior of the triangle. [You do not need to expand any cross or dot products in your answer, but you may do so if it helps you.] (b) (2 points) Using cross and/or dot products, compute the unit-length normal to ABC. Your solution should work for 3D points in general, i.e., not depend on the fact that these points lie in the x-y plane. We will use the right-hand rule for triangles, which means that as you curl the fingers of your right hand from A to B to C, your thumb will point in the direction of the normal. [You do not need to expand any cross or dot products in your answer, but you may do so if it helps you.] (c) (3 points) Using cross and/or dot products, compute the area of the triangle, Area(ABC). This time you do need to expand all cross and/or dot products based on the elements of A, B, and C. Multiply out all terms; e.g., an expression like (a+b)(c+d) should be expanded to ac+ad+bc+bd. For the remainder of the problem, we will safely ignore the z coordinate and work in 2D only, but now we will keep track of the affine coordinate (w=1 for all points). We can now represent the triangle vertices and the point Q as: Ax Bx Cx Qx A A y B B y C C y Q Q y 1 1 1 1 5

Again, to be clear, the last coordinate is now the affine w coordinate, which, for affine points, is always 1; i.e., Aw = Bw = Cw = Qw = 1. (d) (2 points) Suppose we create a 3x3 matrix [A B C], i.e., a matrix with columns filled by A, B, and C. Write out this matrix, explicitly filling in the elements of the matrix in terms of the elements of A, B, and C, and compute its erminant, [A B C]. Again, multiply out all terms. (e) (1 point) Based on your answers to (c) and (d), what is Area(ABC) in terms of [A B C]? (f) (1 point) In general, we can express Q as a weighted sum of A, B, and C; i.e., Q = A + B + C, where,, and are scalars. In order for this to be a proper affine combination (a weighted sum of affine points that yields an affine point), what constraint is placed on,, and? Explain. (g) (3 points) Now we will work on solving for,, and. Write out a matrix equation of the form M p = r: m m m p r 1 2 m1 m11 m p 1 r 1 m2 m21 m 22 p 2 r 2 where M is a 3x3 matrix, p is the column vector of unknowns, i.e., p = [] T and r is a column vector with three elements. I.e., explicitly write out the matrix equation, filling in the elements of M, p, and r, in terms of,, and the elements of A, B, C, and Q. (Do not apply the matrix, just set up the equation.) Hint: you can expand Q = A + B + C explicitly in terms of the elements of A, B, C, and Q and the result should be equivalent to your matrix equation. (h) (2 points) We can solve for p using Cramer s rule. In particular, for a matrix equation M p = r as above, we can solve for p as ratios of erminants: r m1 m2 m r m2 m m1 r r1 m11 m m1 r1 m m1 m11 r 1 r2 m21 m22 m2 r2 m22 m2 m21 r2 p p 1 p2 m m1 m2 m m1 m2 m m1 m2 m1 m11 m m1 m11 m m1 m11 m m2 m21 m 22 m2 m21 m 22 m2 m21 m 22 Note how the denominator is always the erminant of M, and the numerator is the erminant of a matrix that consists of M with one of the columns replaced with the elements of r. Based on your answer to (g), re-write these same Cramer s rule equations using,, and the elements of A, B, C, and Q. (i) (3 points) Assume Q is inside of ABC. In this case, all of the erminants in (h) are positive. Based on your answer to (e), re-write your answer to (h) in terms of areas of triangles. (j) (2 points) Suppose Q = B. What should,, and be? Justify your answer in terms of areas of triangles. (k) (2 points) Suppose Q is halfway between A and C. What should,, and be? Justify your answer in terms of areas of triangles. 6

Problem 4. 3D affine transformations (15 points) The equation describes the plane pictured below which has unit length normal ˆn pointing away from the origin and is a distance d from the origin (in the direction of the normal vector). Any point on the plane must satisfy the plane equation. M xy 1 1 1 1 Now consider a plane with normal lying in the y-z plane. The normal will have the form (, sinθ, cosθ) for some θ. The equation for the plane is then y sin z cos d. Write out the product of 4x4 matrices that would perform a reflection across this plane. One of these matrices will be a reflection matrix; you must use the matrix Mxy above, which performs a reflection across the x-y plane. You must write out the elements of the matrices and the product order in which they would be applied, but you do not need to multiply them out. Justify your answer with words and/or drawings. 7

Problem 5. Hierarchical modeling (26 points) Suppose you want to model a pincer with accordion joint illustrated below. The model is comprised of 8 parts, using primitives A and B. The model is controlled by parameters and d. The pincer operates by translating primitives 7 and 8 toward or away from each other according to d. The illustration on the right also shows a point P that the model is reaching toward, as described in sub-problem c). Assume that can take values in the range [, 9 o ]. As part of your solution to this problem, you will need to define the instance transformations that should be applied to a given primitive on the left so that it is the same shape as a desired primitive on the right; all scale factors will be integers (1, 2, 3, ) or simple fractions (1/2, 1/3, 1/4, ); use a ruler to ermine scale factors. Transformations available to you: R() rotate by degrees (counter clockwise) a T(a, b) translate by b S(sx, sy) scale the x-component by sx and scale the y-component by sy a) (2 points) Construct a tree to describe this hierarchical model using part 1 as the root. Each node will contain either a part number (1 8) or a reference to the canonical geometry that will be drawn (A or B). Along each of the edges of the tree, write an expression for the transformations that are applied along that edge to connect parent to child. Write all transformations using the notation above; you do not need to write out the matrices, just the symbolic references to them, and their arguments. Remember that the order of transformations is important! Show your work wherever the transformations are not obvious. Assume that the center of part 1 sits on the origin in world coordinates. The tree must have one or more branches in it. If two parts are connected physically, then they should be connected in the tree, as long as you don t end up with any node with two parents. b) (2 points) Write out the full transformation expression for drawing the geometric primitive for part 7. Again use the symbolic matrix notation above that appears in your tree. c) (4 points) What values of and d would have the model extend out and close the pincer just enough to precisely grasp the point P = [ 6] T. Show your work. 8