Announcements - PowerPoint PPT Presentation

1 / 21
About This Presentation
Title:

Announcements

Description:

Late Homework should be turned into my office with date and time written on it. Mail problem sets in one zipped file to farrell (at) cs.umd.edu. ... – PowerPoint PPT presentation

Number of Views:22
Avg rating:3.0/5.0
Slides: 22
Provided by: DavidJ1
Learn more at: http://www.cs.umd.edu
Category:

less

Transcript and Presenter's Notes

Title: Announcements


1
Announcements
  • Problem Set 2, handed out today, due next
    Tuesday.
  • Late Homework should be turned into my office
    with date and time written on it.
  • Mail problem sets in one zipped file to farrell
    (at) cs.umd.edu. When emailing matlab code to
    Ryan, use subject CMSC 426 Matlab code.

2
Matlab tutorial and Linear Algebra Review
  • Todays goals
  • Learn enough matlab to get started.
  • Review some basics of Linear Algebra
  • Essential for geometry of points and lines.
  • But also, all math is linear algebra.
  • (ok slight exaggeration).
  • Many slides today adapted from Octavia Camps,
    Penn State.

3
Starting Matlab
  • For PCs, Matlab should be a program.
  • For Suns

Numerical
Analysis and Visualization
Matlab 6.1
4
Help
  • help
  • help command
  • Eg., help plus
  • Help on toolbar
  • demo
  • Tutorial http//amath.colorado.edu/scico/tutorial
    s/matlab/

5
Matlab interpreter
  • Many common functions see help ops

6
Vectors
  • Ordered set of numbers (1,2,3,4)
  • Example (x,y,z) coordinates of pt in space.

7
Indexing into vectors
8
Vector Addition
Vw
v
w
9
Scalar Product
av
v
10
Operations on vectors
  • sum
  • max, min, mean, sort,
  • Pointwise .

11
Inner (dot) Product
The inner product is a SCALAR!
12
How do we prove these properties of the inner
product? Lets start with the fact that
orthogonal vectors have 0 inner product. Suppose
one vector is (x,y), and WLOG x,ygt0. Then, if we
rotate that by 90 degrees counterclockwise, well
get (y, -x). Rotating the vector is just like
rotating the coordinate system in the opposite
direction. And (x,y)(y,-x) xy yx 0. Next,
note that vw (vw)/(vw) vw
This means that if we can show that when v and w
are unit vectors vw cos alpha, then it will
follow that in general vw v w cos
alpha. So suppose v and w are unit
vectors. Next, note that if w1 w2 w, then vw
v(w1w2) vw1 vw2. For any w, we can
write it as the sum of w1w2, where w1 is
perpendicular to v, and w2 is in the same
direction as v. So vw1 0. vw2 w2,
since vw2/w2 1. Then, if we just draw a
picture, we can see that cos alpha w2
vw2 vw.
13
Matrices
Sum
A and B must have the same dimensions
14
Matrices
Product
A and B must have compatible dimensions
Identity Matrix
15
Matrices
Transpose
If
A is symmetric
16
Matrices
Determinant
A must be square
17
Matrices
Inverse
A must be square
18
Indexing into matrices
19
Euclidean transformations
20
2D Translation
P
t
P
21
2D Translation Equation
22
2D Translation using Matrices
P
23
Scaling
P
P
24
Scaling Equation
P
s.y
P
y
x
s.x
25
Rotation
P
P
26
Rotation Equations
Counter-clockwise rotation by an angle ?
27
Why is this true? (cos theta, - sin theta) is
what we get if we rotate (1,0) clockwise by
theta. So it is just the x axis, rotated by
theta. Similarly, (sin theta, cos theta) is the
y axis rotated clockwise by theta. Then, x is
the inner product of the rotated x axis with
(x,y). So it is just the x coordinate of the
point according to the new x axis. And
similarly, y is the coordinate of (x,y) relative
to the new y axis.
28
Degrees of Freedom
R is 2x2
4 elements
BUT! There is only 1 degree of freedom ?
The 4 elements must satisfy the following
constraints
29
Stretching Equation
P
Sy.y
P
y
x
Sx.x
30
Stretching tilting and projecting(with weak
perspective)
31
Linear Transformation
SVD
32
Affine Transformation
33
Files
Matlab
34
Functions
  • Format function o test(x,y)
  • Name function and file the same.
  • Only first function in file is visible outside
    the file.
  • Look at sample function

35
Images
  • Black and white image is a 2D matrix.
  • Intensities represented as pixels.
  • Color images are 3D matrix, RBG.
  • Matlab

36
Debugging
  • Add print statements to function by leaving off
  • keyboard
  • debug and breakpoint

37
Conclusions
  • Quick tour of matlab, you should teach yourself
    the rest. Well give hints in problem sets.
  • The inner product will be very important.
Write a Comment
User Comments (0)
About PowerShow.com