cs-519 Midterm

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

Given an sRGB color csRGB = (0.07366468, 0.58398728, 0.68151069) specified as a NumPy array, compute cXYZ. You should set up the conversion matrix M^{-1}sRGB by simply hardcoding the numerical values for the entries as seen in class. (Not rounded)

(0.36220289, 0.4825132, 0.71883009)

Consider the following RGB color x = (0.2, 0.3, 0.3): Suppose the color will be shown on a display with a gamma of γ = 2.8. If xcorrected is gamma corrected version of x, enter the components of xcorrected. Note: this is not an sRGB color...so just use the standard formula, not the one specific to the the sRGB standard. (Round to 2 dec)

(0.56, 0.65, 0.65)

Suppose we have a rectilinear with: 𝑛𝑥 = 655 columns of vertices 𝑛𝑦 = 719 rows of vertices 𝑛z = 850 sheets of vertices Assume that a number takes 4 bytes to store. How many bytes of storage are required to specify the grid? Hint: You should include the 3 values used to store 𝑛𝑥, 𝑛𝑦, and 𝑛𝑧.

8908

Isosurface

A 3D surface representation of points with equal values in a 3D data distribution. Is the 3D equivalent of a contour line.

Suppose you have a data set consisting of 11 data points with two fields each: x and y. The mean of x is 9, the variance of x is 11, the mean of y is 7.50, and the variance of y is 4.125. Which of the above scatterplots depicts a data set with these characteristics?

All plots depict a distribution with these characteristics.

Volume Rendering

Any rendering process which maps from volume data to an image without introducing binary distinctions/intermediate geometry.

Designing Colormap by Color Table

• Map each scalar value x ∈ R at a point to a color via a table lookup • Assume that we know x ∈ [xmin, xmax] Color Tables • precompute colors and save results into a table of colors {c1,..., cN} • index table by mapping ranges into integers Suppose we have N colors in a table and we index [0, N - 1] Typically a color mapping function might generate an index i

Marching Tetrahedra motivation

• Marching Cubes was patented • Marching Cubes applies to structured grids...not unstructured tetrahedral meshes • Handling ambiguities in Marching Cubes is not easy

CIE RGB problems

• Negative values • It would be useful to separate perceived luminance from chromaticity

Steps to get Isosurface Normal Vector

• get gx, gy, gz • g = sqrt(gx * gx + gy * gy + gz * gz) • Nx = gx/g • Ny = gy/g • Nz = gz/g

What do ka la represent in Phong Reflection?

• ka - reflection • la - intensity of ambient light

Unstructured Grids

• most flexible grid type for modeling complex geometry • both vertex coordinates and cell themselves are freely (explicitly) specifiable • topology: unstructured • geometry: unstructured

Dual Contouring Methods

• places isosurface vertices inside mesh elements • Isosurface vertices in adjacent elements are with edges • allow more than one vertex per cube (squares) • better at producing sharp features

DEM Generation via TIN streaming

• read points from disk • Streaming Computation from Dalaunay Triangulation • Immediate Rasterization of Streaming TIN; store elevation rasters to temporary files (grouped by rows) • output final DEM to disk

The diagram shows contour lines on an elevation map. Toward what direction is elevation increasing the fastest?

In this class, we focus on the rendering algorithm known as rasterization. Which of the following is true of rasterization? • Shadows are generated automatically during shading. • In general, for each object in a scene, rasterization will determine which pixels in the frame will be covered by the projected image of the object. • Rasterization can generate colors for fragments in parallel, but the vertices in a vertex buffer must be transformed sequentially. • Surface inter-reflections are generated automatically during shading.

In general, for each object in a scene, rasterization will determine which pixels in the frame will be covered by the projected image of the object.

Imagine you stop using the Phong lighting model and switch to the Blinn-Phong lighting model. You see the image result. Assume that the Blinn-Phong model uses a shininess coefficient α in the range [1, infinity]. If you wish for the specular highlights in the Blinn-Phong image to match the specular highlights in the Phong image, which of the following should you do?

Increase the shininess coefficient α in the Blinn-Phong model.

Which of the following facts is TRUE about human perception of color? • Human color perception is most sensitive to light in the blue portion off the spectrum (i.e. light with a short wavelength). • The HSV color space, because it uses a wheel of hues, can represent all the color humans can perceive. • It is possible that two lights that have completely different power spectral distributions will be perceived as the same color. • There are three kinds of cone cells in the human eye that can each respond to a different single frequency of light.

It is possible that two lights that have completely different power spectral distributions will be perceived as the same color.

Which of the following is true of Gouraud shading?

It shades by interpolating normal vectors across the face of each triangle.

Suppose we are shading using the Phong lighting model. An attenuation factor can be introduced to model the reduction of light intensity with distance. This factor is applied to which parts of the Phong lighting model?

The specular and diffuse terms

Suppose we have to images 𝐹 and 𝐵, where 𝐹 appears in the foreground and 𝐵 appears in the background. Given a pixel where: 𝑐𝐹 = [0.60, 0.20, 1.00] cB = [1.00, 0.10, 0.90] and 𝛼𝐹 = 0.4 and 𝛼𝐵 = 0.4 are the alpha values of the pixels in 𝐹 and 𝐵 respectively. Compute the output color 𝑐 and resulting alpha channel value 𝛼 from compositing 𝐹 and 𝐵 using the over operator. Do NOT assume that the color values are pre-multiplied by their alpha values. (Round to 3 decimals)

[[0.48, 0.104 , 0.616 ], 0.64]

For this problem consider interpolation of a function in a one-dimensional domain. We have three points x1 = (0.5), x2 = (0.4), x3 = (0.5). for which the value of some function f(x) is known: f(x1) = (1.25), f(x2) = (1.16), f(x3) = (1.25). Suppose also we want to construct an interpolant using Radial Basis Function Interpolation. The first step is to compute a matrix 𝐴(𝑖,𝑗) = 𝜙(𝑥𝑖, 𝑥𝑗) for some kernel function 𝜙. Using the inverse distance function as the kernel (i.e., 1/(1 + 𝑟**2)), compute the values for the matrix 𝐴. (Round to 2 dec)

[[1. , 0.99, 1. ], [0.99, 1. , 0.99], [1. , 0.99, 1. ]]

Suppose we have a rectilinear grid R with: nx = 92 columns of vertices ny = 82 rows of vertices nz = 89 sheets of vertices If C is curvilinear with the same dimensions, how much more storage in bytes is required for C? Assume that a number takes 4 bytes to store.

8055940

Suppose we have a triangulated surface mesh modeling a sphere in an OBJ file. The mesh has: v = 99088 vertices f = 198172 faces Recall that OBJ file format is an indexed face set data structure. If we want to write code to find all the vertices neighboring a given vertex with index 18, how many comparison operations will that code need to perform? For this question, consider only comparisons against numbers stored in the file (i.e. you can ignore comparisons involving loop control variable such as i in for i on range(n)...).

594516

The marching Tetrahedra contouring algorithm can be applied to regular grids if the grid cubes are decomposed into tetrahedra. If we have a regular grid with 12167 cube cells, what is the maximum number of tetrahedra that will be generated by tetrahdralizing the cubes?

73002

In the Marching Tetrahedra contouring algorithm, how many of the cell configurations are ambiguous?

0

The CMY color space (Cyan, Magenta and Yellow) is a subtractive color space designed for reflective displays such as printed material. CMY is a complementary color space to RGB space. You can convert from an RGB representation of a color to a CMY representation using the matrix shown. In this case, the colors are assumed to include an alpha channel as a fourth component. How many colors have the same numeric representation both RGB and CMY? In other words, for how many colors is it true that the color (c1, c2, c3)RGB and the color (c1, c2, c3)CMY are the same color?

1

Marching Cubes Algorithm

1. Classify vertices of a cube and generate bitcode 2. Read isosurface lookup table using bitcode 3. Retrieve triangles 4. Compute vertex coordinates using linear interpolation 5. Store triangles

Phong Reflection components

1. Diffuse 2. Specular 3. Ambient

Phong Reflection vectors

1. To light 2. To viewer 3. Normal 4. Perfect reflector

In the Marching Tetrahedra contouring algorithm, ignoring rotational equivalence, how many different labelings of the vertices exist (ie. how many cell configurations are there)?

16

Suppose we have unsigned 8-bit integers to represent the value of each color channel in an RGB value, so the range is between 0 and 255. How many unique colors can be represented?

16777216

Suppose we have four points located at (3, 7), (3, 8), (4, 7), and (4, 8). The value of the function 𝑓(3, 7) = 15, 𝑓(3, 8) = 2, 𝑓(4, 7) = 26, 𝑓(4, 8) = 83. Compute the value of 𝑓 at (3.4, 7.2) using bilinear interpolation. (Round to two decimals)

22.4

Marching squares

2D contouring on quad-cell grids 1. Encode inside/outside state of each vertex in a 4-bit id 2. Process all dataset cells • for each cell, use ids as pointers into a table with 16 cases • for each case has associated code to: - compute the edge-contour intersection positions - connect to already-computed contour vertices from previous cells

Pictured here is a cell configuration and the resulting isosurface polygons generated by the Marching Cubes algorithm. In the Dual Marching Cubes algorithm, how many isosurface vertices would be created in this cell?

4

In the Marching Tetrahedra contouring algorithm, if you use rotation to group cell configurations into equivalence classes, how many classes are there?

5

O(1)

Describes how the upper bound on the value of a function behaves.

In this class, we focus on the rendering algorithm known as rasterization. What algorithm expresses the process of rasterization when applied to a scene consisting of triangles?

For each triangle → Project the triangle to the view plane → → Color the pixels covered by the triangle.

Suppose we are using a halfedge data structure to store a mesh. We have references to a halfedge associated with the edge shown in bold. In the worst case, how many operations will be needed to find the coordinates Vl, Vr, Vt, and Vs? Assume the mesh has M triangles and N vertices.

O(1)

Delaunay Triangulation

• an algorithm for connecting points to form triangles such that all points are connected to their nearest neighbors and triangles are as compact as possible • standard algorithm for TIN construction • every triangle has an empty circumscribing circle (ie. the circle does not contain a point in its interior)

Suppose we are shading the vertex N using the Phong lighting model. The normal at the vertex is shown as an arrow. Which of the following positions of the eye point and point of light will produce the strongest diffuse reflection?

Put the eye at point A and the light at point B.

Suppose we are shading the vertex N using the Phong lighting model. The normal at the vertex is shown as an arrow. How should we position the eye and a point light to produce the strongest specular reflection?

Put the eye at point A and the light point at C

Glossy specular reflection

Scattering clustered around mirror reflection direction

Marching Cubes Face Ambiguity

Several cases can be facetized in multiple ways • Cases 3, 6, 7, 10, 12, 13

Gouraud Shading

Shading at vertex position, using vertex normals: • Find average normal at each vertex • Compute shade at each vertex • Interpolate vertex shades across each polygon

The human eye can distinguish approximated 10 million different colors. Consider the relationship between RGB space and the CIE XYZ space. What is the relationship between the colors in RGB space and the set of colors perceivable by humans?

The RGB color space can represent a greater number of colors than humans can perceive, but not all colors people can perceive.

Alpha Compositing formula

• c = af * cf + (1 - af) * cb * ab • a = af + (1 - af) * ab

Which of the following are Delaunay triangulations?

Triangulation A

Suppose we have four points located at (8, 3), (8, 4), (9, 3), (8, 3), (8, 4), and (9,4). The values of the function 𝑓 at these four points are 𝑓(8, 3) = 14, 𝑓(8, 4) = 43, 𝑓(9, 3)= 64, 𝑓(9, 4) = 100. If we are given an isovalue of 79, where would dual marching squares place an isosurface vertex inside the square?

[8.81578947, 3.70833333]

Designing a Colormap by Transfer Functions

• defines colors at certain scalar values • these points are sometimes called knots • interpolation is then used to define colors for values between the knots

Suppose we have the shown 5x5 grid. A ray intersects the grid, starting from the origin (0, 0) towards (5, 5). Which cells will the grid cross?

[(0, 0), (0, 1), (1, 1), (1, 2), (2, 2), (2, 3), (3, 3), (3, 4), (4, 4)]

Suppose there's an isosurface defined for a volumetric scalar field 𝑓(𝑥, 𝑦, 𝑧). Compute the normal vector 𝑁 = (𝑁𝑥, 𝑁𝑦, 𝑁𝑧) for the isosurface at a grid point (10, 7, 7) with central differencing using ℎ = 1. For your computation: 𝑓(11, 7, 7) = 0.8 𝑓(9, 7, 7) = 1 𝑓(10, 8, 7) = 0.4 𝑓(10, 6, 7) = 0 𝑓(10, 7, 8) = 0.6 𝑓(10, 7, 6) = 0.8 Round all results (including intermediate results) to two decimal places.

[-0.42, 0.83, -0.42]

Consider a triangle in 2D that is formed by three points: 𝑝1 = (0, −3), 𝑝2 = (0, 3), 𝑝3 = (6, 0). Suppose we have RGB colors at each of these points are (4, 9, 20), (24, 0, 18), and ((12, 3, 15), respectively. Now consider the point 𝑝𝑎 = (2, 2) What are the barycentric coordinates of point 𝑝𝑎? Hint: does the point lie on an edge? Convert any fraction into decimal and round up to 3 decimal places.

[0, 0.667, 0.333]

The illuminant D65 has XYZ coordinates of (0.9505, 1.0000, 1.0891). Convert these to xyY and report the xy coordinates. (Round to 2 dec)

[0.31, 0.33]

Sampled Data 10 9 5 6 7 Suppose the five data values above are sampled on a ray during volume rendering. What value would be used as input to a transfer function when employing Maximum Intensity Projection (MIP)? (Round to two decimals) What data value would be used as input to a transfer function when employing Average Intensity Projection (AIP)? (Round to two decimals)

[10, 7.4]

Consider a triangle in 2D that is formed by three points: 𝑝1 = (0, −3), 𝑝2 = (0, 3), 𝑝3 = (6, 0). Suppose we have RGB colors at each of these points are (4, 9, 20), (24, 0, 18), and ((12, 3, 15), respectively. Now consider the point 𝑝𝑎 = (2, 2) Use the interpolation method based on barycentric coordinates to find the RGB values that would be at point pa. Enter integers only.

[20, 1, 17]

Unstructured grid need

• domain D: a square with hole in the middle • cannot cover such a domain with a single structured grid; it's not of genus 0, so cannot be covered with a matrix-like distribution of cells

Rasterization versus Ray Tracing

• In rasterization, geometric primitives are projected onto an image plane and the rasterizer figures out which pixels get filled. • In ray-tracing, the physical transport of light is modeled by shooting a sampling ray through each pixel in an image plane and seeing what the ray hits in the scene.

DEM to TIN conversion

• In the DEM, if a pixel records elevation, you have X, Y, Z coordinates of the terrain at each pixel • From there pretty straightforward to generate a mesh from the DEM data

CIE RGB color space

• Includes all possible colors (for most people) • No space defined by 3 primary colors can include all colors • Has 3 primaries; functions of the color-matching curves

Marching Cubes internal ambiguity

• Internal ambiguity does not cause any topological inconsistency but it can yield an incorrect isosurface • Internal ambiguity can arise in cases 4, 6, 7, 10, 12, and 13

Perfect specular reflection

• Light is reflected in the single direction r • ...the mirror reflection direction • closer to matching viewer/reflector direction (ie. 0 cos) nearing perfect reflection • further from viewer/reflects (ie. twd 90) more specular effect; though after 90 no reflection

perfectly diffuse reflection

• Light scattered equally in all directions • Amount of light reflected is affected by the angle of incidence • reflected light proportional to cosine of angle between l and n • closer to matching viewer/reflector direction (ie. 0 cos) nearing perfect reflection • further from viewer/reflects (ie. twd 90) more specular effect; though after 90 no reflection

Linear interpolation

• f(p0) = v0 and f(p1) = v1 • f(t) = (1 - t)v0 + tv1 If given a point pi on the line and don't know t? • t = dist(pi, p0) / dist(p1, p0)

O(N)

each operation takes the same number of steps as the items in your list

raster

grid of addressable image elements called pixels

Mono-spectral lights

lights emitting a single frequency

Ambient reflection

mimics the effect of indirect light on a scene

pixel

smallest controllable element of a digital image

Isovalue

threshold

grid types

uniform, rectilinear, curvilinear, unstructured

Marching Tetrahedra Cell Configurations

• 16 cell configurations • only 5 equivalence classes of configurations if allow rotation

Surface normal

• A normal is a vector that is perpendicular to the object • Each triangle in a surface mesh has outward facing normal • The normal is just the vector perpendicular to the triangle

Barycentric Coordinates for Triangles

• Describes location of a point in relation to the vertices of a given triangle • Express point p in barycentric coordinates p = (λ1, λ2, λ3)

DEM

• Digital Elevation Model • raster data set • a regular grid of elevations arranged by column and row

Phong Shading

• Find average normal at each vertex • Interpolate vertex normals across edges • Interpolate edge normals across polygon • Compute shade at each fragment

HSV Color Space

• For artists...or anyone...color picking in RGB is difficult • Hue, Saturation, and Value (HSV) is an alternative color space • Equivalent to RGB in the colors it can represent • Easier to design color picking interfaces

Shininess Coefficient

• High coefficient means smoother look • Maybe 100 for metal • Maybe 10 for plastic

Half Edge data structure

• In addition to usual verticies, edges, and faces that make up a polygon mesh, there is also an entity called a halfedge that acts like a "glue" connecting different elements. • It allows to easily navigate the mesh.

Rectilinear Grids

• all cells have the same type • cells can have different sizes but share them along axes • topology: structured • geometry: semi-structured

Which of the following are properties of the Dual Marching Cubes algorithm for generating isosurfaces? • The final resulting isosurface will contain polygons that could not be triangulated. • On a grid with N cells the running time of Dual Marching Cubes will be O(N). • The isosurface does not intersect any negative or strictly positive grid edges. • The vertices of the isosurface will always lie on the edges of grid cells. • The isosurface intersects at exactly one point every interior bipolar grid edge whose positive endpoint is strictly positive. • The isosurface is piecewise linear.

• On a grid with N cells the running time of Dual Marching Cubes will be O(N). • The isosurface does not intersect any negative or strictly positive grid edges. • The isosurface intersects at exactly one point every interior bipolar grid edge whose positive endpoint is strictly positive. • The isosurface is piecewise linear.

Dual Marching Cubes

• Operates on structured grids...like Marching Cubes • Generates quadrilaterals...dual to the vertices generated by Marching Cubes

A triangulated irregular network can be classified as which of the following?

• Polygonal mesh • Surface mesh • Unstructured mesh

Marching Tetrahedra Algorithm

• Read isosurface lookup table for tetrahedra • For each mesh tetrahedron, retrieve isosurface triangles • Compute isosurface vertex coordinates using linear interpolation

Ambient Light

• Result of multiple interactions between light sources and surfaces • Amount and color depend on the color of the light(s) and the material properties • ka * la (reflection, intensity of ambient light) added to diffuse and specular terms for Phong Reflection

Marching Cubes

• Seeks to construct a polygonal approximation to Sv • Function is sampled at vertices of a regular cuboid grid • Generate isosurface cell-by-cell • Polygons generated across the cells

CIE XYZ Color Space

• Solves two CIE RGB problems • Primaries only take on positive values • ȳ(λ) corresponds closely to the values of the luminosity function; so Y corresponds to perceived brightness

specular vs. diffuse reflections

• Specular reflection occurs with smooth surfaces like mirrors; it causes light rays to reflect at the same angle as they hit the surface. • Diffuse reflection occurs with rougher surfaces; it scatters light rays in different directions.

standard sRGB color space

• Standard Red Blue Green • defined by 3 points labeled R, G, B • All the colors possible in that space lie in the RGB triangle

A digital elevation model can be classified as which of the following?

• Surface mesh • Uniform mesh • Raster data

Properties of the Isosurface

• The isosurface is a piecewise linear, orientable 2-manifold with boundary. • The boundary of the isosurface lies on the boundary of the grid. • The isosurface does not contain any zero-area triangles or duplicate triangles.

Which of the following are properties of the Marching Cubes algorithm for generating isosurfaces? • The isosurface will be closed orientable manifold. • The isosurface is piecewise linear. • The isosurface does not intersect any negative or strictly positive grid edges. • The isosurface intersects each bipolar grid edge at exactly one point. • On a grid with N cells the running time of Marching Cubes will be O(N). • The vertices of the isosurface are in the interior of grid cells.

• The isosurface is piecewise linear. • The isosurface does not intersect any negative or strictly positive grid edges. • The isosurface intersects each bipolar grid edge at exactly one point. • On a grid with N cells the running time of Marching Cubes will be O(N).

Distance Terms (light)

• The light from a point source that reaches a source that reaches a surface is attenuated; intensity falls off with the square of the distance • We can apply a factor to the diffuse and specular terms • d is the distance from the light to surface • a, b, c are the constants you choose to get different effects

Suppose we are visualizing a scalar field on a triangle mesh using a colormap. Our visualization application does the following for each tringle: 1. Evaluate the scalar function at each vertex of the triangle 2. Maps the result to a color 3. Linearly interpolate the vertex colors across each pixel in the triangle interior Which of the colormaps below could display a color not in the colormap in the interior of a triangle?

• The red-blue colormap with the given colors linearly interpolated between the control points. • The rainbow colormap generated by the transfer functions shown.

Which of the following statements about the chromaticity diagram are true? • The non-spectral purples along the bottom of the horsehoe can only be generated by mixing together more than 3 primary colors. • The set of colors that can be made by mixing together of three different frequencies of light would form a triangle in the diagram. • At least some of the colors shown inside horsehoe shape incorrectly represent the color at those xyY coordinates, since they are generated from an image using the sRGB color space. • Monospectral lights (i.e. lights emitting a single frequency) would correspond to colors around the boundary of the horseshoe shape.

• The set of colors that can be made by mixing together of three different frequencies of light would form a triangle in the diagram. • At least some of the colors shown inside horseshoe shape incorrectly represent the color at those xyY coordinates, since they are generated from an image using the sRGB color space. • Monospectral lights (i.e lights emitting a single frequency) would correspond to colors around the boundary of the horseshoe shape.

Triangulated Irregular Network

• Triangulated surface mesh of a terrain • Irregular = unstructured, allows adaptive sampling of area with rapidly changing elevations

Barycentric Interpolation

• Used on any simplex • Barycentric coordinates provide a way to interpolate over simplices

Gradient

• a rate of inclination; a slope • Points in the direction of most rapid ascent in function values • Gradient of a function is normal to a contour of a function • Can use gradient as a normal...imagine point on the ray has been sampled from an isosurface

Curvilinear Grids

• all cells have same type • cell vertex coordinates are freely (explicitly) specifiable... • topology: structured • geometry: unstructured


Ensembles d'études connexes

Macroeconomics Chapter 9 Unemployment/Inflation

View Set

Chapter 3: The Legal Environment: Equal Opportunity & Safety

View Set

Software & Hardware Interaction lesson 6

View Set

Alteration in Arterial/Vascular Function

View Set