机器人视觉 课件3-matlab programming

上传人:wt****50 文档编号:41649571 上传时间:2018-05-30 格式:PDF 页数:7 大小:2.38MB
返回 下载 相关 举报
机器人视觉 课件3-matlab programming_第1页
第1页 / 共7页
机器人视觉 课件3-matlab programming_第2页
第2页 / 共7页
机器人视觉 课件3-matlab programming_第3页
第3页 / 共7页
机器人视觉 课件3-matlab programming_第4页
第4页 / 共7页
机器人视觉 课件3-matlab programming_第5页
第5页 / 共7页
点击查看更多>>
资源描述

《机器人视觉 课件3-matlab programming》由会员分享,可在线阅读,更多相关《机器人视觉 课件3-matlab programming(7页珍藏版)》请在金锄头文库上搜索。

1、ROBOT VISIONHuang-Nan Huang2012 Autumn2012/9/61Eigenvalues and Eigenvectors2012/9/62在變換 ? 的作用下,? 向量僅僅在尺度上 變為原來的 ? 倍。 ?稱是 ? 的一個特徵向 量,? 是對應的特徵值。? 的特徵向量 ?,按照定義,是在變換 ? 的作 用下會得到自身 ? 的 ? 倍的非零向量,也就是 ? = ? 在等式兩邊的左側乘以單位矩陣 I,得到 ? = ? ? ? = (?)? 因此 (? ?)? = 0 根據線性方程組理論,為了使這個方程有非零 解,矩陣的行列式必須是零: det(? ?) = 0? ?,

2、 ?= ?, ? = 1,2,? ? ?= ? ?= ? ?= ? ? ? ? = ? ? = ?Singular Value Decomposition (SVD)2012/9/63?假設 ? 是一個 ? ? 階矩陣,其中的元素全部屬於域 ?,也就是實數域 或複數域 。如此則存在一個分解使得 ? = ?其中 ? 是 ? ? 階酉矩陣; 是半正定 ? ? 階對角矩陣;而 ?,即 ? 的共軛轉置, 是 ? ? 階酉矩陣。這樣的分解就稱作?的奇異值分解。 對角線上的元素 ?即為 ? 的奇異值。?设一個非負實數 ? 是 ? 的一個奇異值僅當存在 ? 的單位向量 ? 和 ?的單位向量 ? 如下 : ?

3、 = ?,? = ? 其中向量 ? 和 ? 分別為 ? 的左奇異向量和右奇異向量。?對於任意的奇異值分解,矩陣 的對角線上的元素等於 ? 的奇異值. ?和?的列分別是 奇異值中的左、右奇異向量。因此,?一個 ? ? 的矩陣至少有一個最多有 ? = min (?,?) 個不同的非零奇異值。?總是可以找到在 ?的一個正交基 ?, 組成 ? 的左奇異向量。?總是可以找到和 ?的一個正交基 ?, 組成 ? 的右奇異向量。?如果一個奇異值中可以找到兩個左(或右)奇異向量是線性相關的,則稱為退化。2012/9/64 已知 ? = ?,? = ? = ? (?)? = (?)? = ? (?)? = ? ?

4、为 ?与 ? 的特徵值而 ? 与 ? 分 别为对应的特徵向量Matlab command: eig eigenvalues and eigenvectors svd singular value decomposition2012/9/6MATLAB PROGRAMMING2012/9/63Today Goals2012/9/66?Learn enough Matlab programming technique for reading and writing Matlab code.?Learn to debug Matlab code.?Learn the efficiency using

5、 Matlab vector command other than usual loop commandOutline?System Input/Output?Functions?Basic Programming Technique?For Loop Command?While Loop Command?If/elseif/else?Switch/case/otherwise?Tent Function?Debuging?Examples?Multi-dimensional Arrays?Common Function Library2012/9/67System Output2012/9/

6、68?Command disp display the result (string or number) to command windows?disp(A) display the content of a matrix A?disp(string) display a string which is?enclosed by 单引号, for example disp(this will display this text)?combination of string with number, i.e., x = 2.678; disp( Value of iterate is , num

7、2str(x), at this stage ) Value of iterate is 2.678 at this stage where num2str(x) is the function which transfer the number into x corresponding stringSystem Input/Output2012/9/69?fprintf( filename, format string, list);?where filename is an optional and if it is omitted, then the result is sent to

8、the screen。?list is the list of variables whose values will be printed out and they are separated by comma when there are more than one variable.?format string described as following:?%P.Qeexponential form, with e?%P.Qffixed point display?%P.Qg display the one from %P.Qe or %P.Qf which is shorted?n

9、line feed?%s string to be printed P is the width of field counting decimal point and Q is the number of digital after decimal point Example2012/9/610?x=1007.46; y=2.1278; k=17; fprintf(nx= %8.2f y= %8.6f k= %2.0fn, x, y, k);x= 1007.46 y= 2.127800 k= 17? fprintf(x= %3.1f, x); x= 1007.5System input201

10、2/9/611Matlab can obtain numerical data or string from keyboard using the command: var_name = input(string ); where var_name is the variable name string describing the information about input data?a = input(Please input the value of a: ) numerical value is key in from keyboard.?a = input(Please inpu

11、t the value of a: , s) string is key in from keyboard.Functions2012/9/612?Types of functions?Inline function?Anonymous function?function with format: function o = test(x,y) Name function and file the same. Only first function in file is visible outside the file.?nargin - Number of function input arg

12、uments?nargout - Number of function output arguments?varargin - Variable length input argument list: function o=test (x,y,varargin) test(x,y,here,0.5,7,end)Inline function2012/9/613?Create an inline function to describe and plot its graph.32( )cos2.42.42.4xxxf x=+command: f=inline(x/2.4)3-x/1.2+cos(

13、pi*x/2.4),x)f =Inline function: f(x) = (x/2.4)3-x/1.2+cos(pi*x/2.4) ezplot(f) ezplot(function,xmin,xmax)Anonymous function2012/9/614?function_handle () Handle used in calling functions indirectly?Syntax handle = functionname handle = (arglist)anonymous_function?Description handle = functionname retu

14、rns a handle to the specified MATLAB function.?handle = (arglist)anonymous_function constructs an anonymous functionAnonymous function2012/9/615?sqr = (x) x.2;?To execute the sqr function defined above, type a = sqr(5) a = 25?Because sqr is a function handle, you can pass it in an argument list to o

15、ther functions. The code shown here passes the sqr anonymous function to the MATLAB quad function to compute its integral from zero to one: quad(sqr, 0, 1) ans = 0.3333For Loop Command2012/9/616?Execute statements specified number of times?Syntax for index = values program statements : end?Description: values has one of the following forms:initval:endvalincrements the index variable from initval to endval by 1,until index is greater than endval.initval:step:endvalincrements index by the value step on each iteration, or decrements

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 行业资料 > 文化创意

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号