斯坦福机器视觉ppt课件.pptx
《斯坦福机器视觉ppt课件.pptx》由会员分享,可在线阅读,更多相关《斯坦福机器视觉ppt课件.pptx(77页珍藏版)》请在三一办公上搜索。
1、Linear Algebra Primer,Professor Fei-Fei LiStanford Vision Lab,11-Nov-22,1,Another, very in-depth linear algebra review from CS229 is available here:http:/cs229.stanford.edu/section/cs229-linalg.pdfAnd a video discussion of linear algebra from EE263 is here (lectures 3 and 4):http:/see.stanford.edu/s
2、ee/lecturelist.aspx?coll=17005383-19c6-49ed-9497-2ba8bfcfe5f6,Outline,Vectors and matricesBasic Matrix OperationsSpecial MatricesTransformation MatricesHomogeneous coordinatesTranslationMatrix inverseMatrix rankSingular Value Decomposition (SVD)Use for image compressionUse for Principal Component An
3、alysis (PCA)Computer algorithm,11-Nov-22,2,Outline,Vectors and matricesBasic Matrix OperationsSpecial MatricesTransformation MatricesHomogeneous coordinatesTranslationMatrix inverseMatrix rankSingular Value Decomposition (SVD)Use for image compressionUse for Principal Component Analysis (PCA)Compute
4、r algorithm,11-Nov-22,3,Vectors and matrices are just collections of ordered numbers that represent something: movements in space, scaling factors, pixel brightnesses, etc. Well define some common uses and standard operations on them.,Vector,A column vector whereA row vector where denotes the transp
5、ose operation,11-Nov-22,4,Vector,Well default to column vectors in this classYoull want to keep track of the orientation of your vectors when programming in MATLABYou can transpose a vector V in MATLAB by writing V. (But in class materials, we will always use VT to indicate transpose, and we will us
6、e V to mean “V prime”),11-Nov-22,5,Vectors have two main uses,Vectors can represent an offset in 2D or 3D spacePoints are just vectors from the origin,11-Nov-22,6,Data (pixels, gradients at an image keypoint, etc) can also be treated as a vectorSuch vectors dont have a geometric interpretation, but
7、calculations like “distance” can still have value,Matrix,A matrix is an array of numbers with size by , i.e. m rows and n columns.If , we say that is square.,11-Nov-22,7,Images,11-Nov-22,8,MATLAB represents an image as a matrix of pixel brightnessesNote that matrix coordinates are NOT Cartesian coor
8、dinates. The upper left corner is y,x = (1,1),=,Color Images,Grayscale images have one number per pixel, and are stored as an m n matrix.Color images have 3 numbers per pixel red, green, and blue brightnessesStored as an m n 3 matrix,11-Nov-22,9,=,Basic Matrix Operations,We will discuss:AdditionScal
9、ingDot productMultiplicationTransposeInverse / pseudoinverseDeterminant / trace,11-Nov-22,10,Matrix Operations,AdditionCan only add a matrix with matching dimensions, or a scalar. Scaling,11-Nov-22,11,Matrix Operations,Inner product (dot product) of vectorsMultiply corresponding entries of two vecto
10、rs and add up the resultxy is also |x|y|Cos( the angle between x and y ),11-Nov-22,12,Matrix Operations,Inner product (dot product) of vectorsIf B is a unit vector, then AB gives the length of A which lies in the direction of B,11-Nov-22,13,Matrix Operations,MultiplicationThe product AB is:Each entr
11、y in the result is (that row of A) dot product with (that column of B)Many uses, which will be covered later,11-Nov-22,14,Matrix Operations,Multiplication example:,11-Nov-22,15,Each entry of the matrix product is made by taking the dot product of the corresponding row in the left matrix, with the co
12、rresponding column in the right one.,Matrix Operations,PowersBy convention, we can refer to the matrix product AA as A2, and AAA as A3, etc.Obviously only square matrices can be multiplied that way,11-Nov-22,16,Matrix Operations,Transpose flip matrix, so row 1 becomes column 1A useful identity:,11-N
13、ov-22,17,Determinant returns a scalarRepresents area (or volume) of the parallelogram described by the vectors in the rows of the matrixFor , Properties:,11-Nov-22,18,Matrix Operations,TraceInvariant to a lot of transformations, so its used sometimes in proofs. (Rarely in this class though.)Properti
14、es:,11-Nov-22,19,Matrix Operations,Special Matrices,Identity matrix ISquare matrix, 1s along diagonal, 0s elsewhereI another matrix = that matrixDiagonal matrixSquare matrix with numbers along diagonal, 0s elsewhereA diagonal another matrix scales the rows of that matrix,11-Nov-22,20,Special Matrice
15、s,Symmetric matrixSkew-symmetric matrix,11-Nov-22,21,Outline,Vectors and matricesBasic Matrix OperationsSpecial MatricesTransformation MatricesHomogeneous coordinatesTranslationMatrix inverseMatrix rankSingular Value Decomposition (SVD)Use for image compressionUse for Principal Component Analysis (P
16、CA)Computer algorithm,11-Nov-22,22,Matrix multiplication can be used to transform vectors. A matrix used in this way is called a transformation matrix.,Transformation,Matrices can be used to transform vectors in useful ways, through multiplication: x= AxSimplest is scaling:(Verify to yourself that t
17、he matrix multiplication works out this way),11-Nov-22,23,Rotation,How can you convert a vector represented in frame “0” to a new, rotated coordinate frame “1”?Remember what a vector is: component in direction of the frames x axis, component in direction of y axis,11-Nov-22,24,Rotation,So to rotate
18、it we must produce this vector: component in direction of new x axis, component in direction of new y axisWe can do this easily with dot products!New x coordinate is original vector dot the new x axisNew y coordinate is original vector dot the new y axis,11-Nov-22,25,Rotation,Insight: this is what h
19、appens in a matrix*vector multiplicationResult x coordinate is original vector dot matrix row 1So matrix multiplication can rotate a vector p:,11-Nov-22,26,Rotation,Suppose we express a point in a coordinate system which is rotated leftIf we use the result in the same coordinate system, we have rota
20、ted the point right,11-Nov-22,27,Thus, rotation matrices can be used to rotate vectors. Well usually think of them in that sense- as operators to rotate vectors,2D Rotation Matrix Formula,Counter-clockwise rotation by an angle ,P,x,y,P,x,y,11-Nov-22,28,Transformation Matrices,Multiple transformation
21、 matrices can be used to transform a point: p=R2 R1 S pThe effect of this is to apply their transformations one after the other, from right to left.In the example above, the result is (R2 (R1 (S p)The result is exactly the same if we multiply the matrices first, to form a single transformation matri
22、x:p=(R2 R1 S) p,11-Nov-22,29,Homogeneous system,In general, a matrix multiplication lets us linearly combine components of a vectorThis is sufficient for scale, rotate, skew transformations.But notice, we cant add a constant! ,11-Nov-22,30,Homogeneous system,The (somewhat hacky) solution? Stick a “1
23、” at the end of every vector:Now we can rotate, scale, and skew like before, AND translate (note how the multiplication works out, above)This is called “homogeneous coordinates”,11-Nov-22,31,Homogeneous system,In homogeneous coordinates, the multiplication works out so the rightmost column of the ma
24、trix is a vector that gets added.Generally, a homogeneous transformation matrix will have a bottom row of 0 0 1, so that the result has a “1” at the bottom too.,11-Nov-22,32,Homogeneous system,One more thing we might want: to divide the result by somethingFor example, we may want to divide by a coor
25、dinate, to make things scale down as they get farther away in a camera imageMatrix multiplication cant actually divideSo, by convention, in homogeneous coordinates, well divide the result by its last coordinate after doing a matrix multiplication,11-Nov-22,33,2D Translation,t,P,P,11-Nov-22,34,11-Nov
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 斯坦福 机器 视觉 ppt 课件

链接地址:https://www.31ppt.com/p-1338930.html