亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? tsai.m

?? 攝像機標定程序:用matlab語言編寫
?? M
字號:
% [R, T, f, k1] = Tsai (Xf, Yf, xw, yw, zw, Ncx, Nfx, dx, dy, Cx, Cy, sx)
%
% **********************************************************************************************
% *******         Calibrating a Camera Using a Monoview Coplanar Set of Points           *******
% **********************************************************************************************
%                              6/2004   Simon Wan 
%                              simonwan@hit.edu.cn
%
% Note:        Xf, Yf, xw, yw, zw are all column vectors
%
% (xw, yw, zw) is the 3D coordinate of the object point P in the 3D world coordinate system 
% (x, y, z)    is ths 3D coordinate of the object point P in the 3D camera coordinate system
% (X, Y)       is the image coordinate system centered at Oi where is the intersection of the optical center axis z and the front plane
% (Xu, Yu)     is the image coordinate of (x, y, z) if a perfect pinhole camera model is used
%              Xu = f * x / z                                      (4a)
%              Yu = f * y / z                                      (4b)
% (Xd, Yd)     is the actual image coordinate which differs from (Xu, Yu) due to lens distortion
% (Xf, Yf)     is the coordinate used in the computer, is the number of pixels for the discrete image in the frame memory
% R            is the 3*3 rotation matrix 
%              = [r1, r2, r3; r4, r5, r6; r7, r8, r9];             (2)
%              [x, y, z]' = R * [xw, yw, zw]' + T                  (1)
% T            is the translation vector
%              = [Tx, Ty, Tz]'                                     (3)
% f            is the effective focal length 
% Dx           = Xd*( k1*r^2 + k2*r^4 + ... )                      P327
%              Xd+Dx=Xu                                            (5a)
% Dy           = Yd*( k1*r^2 + k2*r^4 + ... )                      P327
%              Yd+Dy=Yu                                            (5b)
% r            = (Xd^2 + Yd^2)^(0.5)                               P327
% k1           is the distortion coeffient
%              Xf  = sx * dxp^(-1) * Xd + Cx                      (6a)
%              Yf  = dy^(-1) * Yd + Cy                            (6b)
%              dxp = dx * Ncx / Nfx                               (6d)
% dx           is the center to center distance between adjacent sensor elements in X (scan line) diretion
% dy           is the center to center distance between adjacent CCD sensor in the Y direction
% Ncx          is the number of sensor elements in the X direction
% Nfx          is the number of pixels in a line as sampled by the computer
% sx           is the uncertainty image scale factor 
% X            = (Xd * Nfx) / (dx * Ncx)                          P328
% X            = Xf - Cx                                          P328
% Y            = Yf - Cy                                          P328
%              sx^(-1)*dxp*X + sz^(-1)*dxp*X*k1*r^2 = f*x/z       (7a)
%              dxp*Y + dy*Y*k1*r^2 = f*y/z                        (7b)
%              r = ( ( sx^(-1)*dxp*X )^2 + (dx*Y)^2 )^(0.5)        
%              sx^(-1)*dxp*X + sx^(-1)*dxp*X*k1*r^2 = f*(r1*xw + r2*yw + r3*zw +
%              Tx) / (r7*xw + r8*yw + r9*zw +Tz)                  (8a)
%              dy*Y + dy*Y*k1*r^2 = f*(r1*xw + r2*yw + r3*zw + 
%              Tx) / (r7*xw + r8*yw + r9*zw +Tz)                  (8b)
% Since the calibration points are on a common plane, the (xw, yw, zw) coordinate system can be chosen such that zw=0 and the 
% corigin is not lose to the center of the view or y axis of the camera coordinate system. Since the (xw, yw, zw) is user-defined 
% and the origin is arbitrary, it is no problem setting the origin of (xw, yw, zw) to be out of the field of view and not close 
% to the y axis. the purpose for the latter is to make sure that Ty is not exactly zero.
%
% REF:	"A versatile camera calibration technique for high-accuracy 3D machine
%	     vision metrology using off-the-shelf TV cameras and lens"
%	     R.Y. Tsai, IEEE Trans R&A RA-3, No.4, Aug 1987, pp 323-344.
%
function [R, T, f, k1] = Tsai(Xf, Yf, xw, yw, zw, Ncx, Nfx, dx, dy, Cx, Cy, sx)
% Stage 1 --- Compute 3D Orientation, Position (x and y):
% a) Compute the distored image coordinates (Xd, Yd) Procedure:
    dxp = dx * Ncx / Nfx;

    X = Xf - Cx;
	Y = Yf - Cy;
    
    Xd=sx^(-1)*dxp*(Xf-Cx);
    Yd=dy*(Yf-Cy);
% b) Compute the five unknowns Ty^(-1)*r1, Ty^(-1)*r2, Ty^(-1)*Tx, Ty^(-1)*r4, Ty^(-1)*r5
% r1p=Ty^(-1)*r1;
% r2p=Ty^(-1)*r2;
% Txp=Ty^(-1)*Tx;
% r4p=Ty^(-1)*r4;
% r5p=Ty^(-1)*r5;
    A=[Yd.*xw Yd.*yw Yd -Xd.*xw -Xd.*yw];
    B=Xd;
    C=A\B;
    r1p=C(1);
    r2p=C(2);
    Txp=C(3);
    r4p=C(4);
    r5p=C(5);
    clear A B C;
% c) Compute (r1,...,r9,Tx,Ty) from (Ty^(-1)*r1, Ty^(-1)*r2, Ty^(-1)*Tx, Ty^(-1)*r4, Ty^(-1)*r5):
% 1) Compute |Ty| from (Ty^(-1)*r1, Ty^(-1)*r2, Ty^(-1)*Tx, Ty^(-1)*r4, Ty^(-1)*r5):
    C=[r1p, r2p; r4p, r5p];
    Sr=r1p^2 + r2p^2 + r4p^2 + r5p^2;
    if rank(C)==2
        Ty2=( Sr - (Sr^2-4*(r1p*r5p-r4p*r2p)^2)^(0.5) )/(2*(r1p*r5p-r4p*r2p)^2);
    else
        z = C(abs(C) > 0);
	    Ty2 = 1.0 / (z(1)^2 + z(2)^2);
    end
    Ty = sqrt(Ty2);
    clear C Sr Ty2 z
% 2) Determine the sign of Ty:
    [ymax i] = max(Xd.^2 + Yd.^2);
	r1 = r1p*Ty;
	r2 = r2p*Ty;
	r4 = r4p*Ty;
	r5 = r5p*Ty;
	Tx = Txp*Ty;
	x = r1*xw(i) + r2*yw(i) + Tx;
	y = r4*xw(i) + r5*yw(i) + Ty;
	if (sign(x) == sign(Xf(i))) & (sign(y) == sign(Yf(i))),
		Ty = Ty;
	else
		Ty = -Ty;
	end
    clear ymax i x y 
% 3) Compute the 3D rotation matrix R, or r1, r2,...,r9
    r1 = r1p*Ty;
	r2 = r2p*Ty;
	r4 = r4p*Ty;
	r5 = r5p*Ty;
	Tx = Txp*Ty;
    s = -sign(r1*r4 + r2*r5);
    R=[r1, r2, (1-r1^2-r2^2)^(0.5); r4, r5, s*(1-r4^2-r5^2)^(0.5)];
    R = [R(1:2,:); cross(R(1,:), R(2,:))];
    
    r7 = R(3,1);
	r8 = R(3,2);
	r9 = R(3,3);
    
    y = r4*xw+r5*yw+Ty;
	w = r7*xw+r8*yw;
	z = [y -dy*Y] \ [dy*(w.*Y)];
	f = z(1);
    
    if f < 0,
		R(1,3) = -R(1,3);
		R(2,3) = -R(2,3);
		R(3,1) = -R(3,1);
		R(3,2) = -R(3,2);
	end
    
    r3 = R(1,3);
	r6 = R(2,3);
    r7 = R(3,1);
    r8 = R(3,2);
    clear s y w z 
% 2) Stage 2 --- Compute Effective Focal Length, Distortion Coefficients, and z Position:
% d) Compute an approximation of f and Tz by ignoring lens distortion:
    y = r4*xw+r5*yw+Ty;
	w = r7*xw+r8*yw;
	z = [y -dy*Y] \ [dy*(w.*Y)];
	f = z(1);
    Tz = z(2);
% Compute the exactly solution for f, Tz, k1:
    params_const = [r4 r5 r6 r7 r8 r9 dx dy sx Ty];
	params = [f, Tz, 0];		% add initial guess for k1
    [x,fval,exitflag,output] = fminsearch( @Tsai_8b, params, [], params_const, xw, yw, zw, X, Y);
    f = x(1);
	Tz = x(2);
	k1 = x(3);
    
    T=[Tx, Ty, Tz]';
    
    % fval the value of the objective function fun at the solution x.
    fval
    % exitflag that describes the exit condition of fminsearch
    % >0 Indicates that the function converged to a solution x.
    % 0  Indicates that the maximum number of function evaluations was exceeded.
    % <0 Indicates that the function did not converge to a solution.
    exitflag
    % output that contains information about the optimization
    % output.algorithmThe algorithm used
    % output.funcCountThe number of function evaluations
    % output.iterationsThe number of iterations taken
    output
    
    
    
    
    
    

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩福利视频导航| 欧美三级视频在线| 欧美亚日韩国产aⅴ精品中极品| 5858s免费视频成人| 最新中文字幕一区二区三区| 老司机精品视频在线| 日本电影欧美片| 国产欧美一区二区三区在线看蜜臀 | 2020国产精品自拍| 亚洲自拍欧美精品| 91丝袜呻吟高潮美腿白嫩在线观看| 日韩欧美一区在线| 亚洲一区二区在线视频| 成人免费看的视频| 欧美经典三级视频一区二区三区| caoporn国产一区二区| 日韩亚洲国产中文字幕欧美| 一区二区激情视频| eeuss国产一区二区三区| 久久久精品影视| 麻豆91在线观看| 日韩亚洲欧美一区二区三区| 亚洲444eee在线观看| 色哟哟在线观看一区二区三区| 欧美国产精品一区二区| 国产高清不卡一区二区| 国产亚洲一区二区三区| 国模冰冰炮一区二区| 精品国产第一区二区三区观看体验 | 欧美日韩精品二区第二页| 亚洲人精品午夜| 99久久国产综合精品女不卡 | 日韩一级黄色片| 日韩成人av影视| 337p亚洲精品色噜噜狠狠| 午夜电影久久久| 欧美一区二区视频观看视频| 日韩中文字幕不卡| 精品精品欲导航| 国产盗摄一区二区三区| 欧美精品一区二区三区久久久| 久草中文综合在线| 久久精品水蜜桃av综合天堂| 东方欧美亚洲色图在线| 亚洲色图都市小说| 欧美视频在线不卡| 麻豆国产欧美一区二区三区| 久久这里只有精品视频网| 国产精品亚洲综合一区在线观看| 久久精品亚洲乱码伦伦中文| 99精品久久只有精品| 亚洲一区免费在线观看| 欧美一级精品大片| 国产一区 二区 三区一级| 中文字幕日韩av资源站| 欧美高清一级片在线| 麻豆精品国产91久久久久久| 中文字幕精品一区 | 91亚洲精品乱码久久久久久蜜桃| 亚洲色图在线视频| 日韩午夜av一区| 成人爱爱电影网址| 婷婷开心激情综合| 中文字幕va一区二区三区| 欧美日韩国产另类一区| 国产精品小仙女| 亚洲午夜久久久久中文字幕久| 日韩欧美一卡二卡| 日本道免费精品一区二区三区| 日韩电影免费一区| 亚洲欧洲一区二区在线播放| 欧美三区在线观看| 成年人午夜久久久| 久久99蜜桃精品| 亚洲专区一二三| 国产精品全国免费观看高清| 欧美日韩免费观看一区三区| 风间由美一区二区三区在线观看| 亚洲成年人影院| 国产精品久久久久久久久快鸭| 4438x亚洲最大成人网| aaa亚洲精品| 国产精品一二一区| 欧美aaaaa成人免费观看视频| 成人欧美一区二区三区黑人麻豆| 日韩久久免费av| 日本乱人伦aⅴ精品| 国产精华液一区二区三区| 天堂精品中文字幕在线| 亚洲女同一区二区| 中文字幕第一区第二区| 精品三级在线观看| 欧美理论片在线| 欧美在线观看视频一区二区 | 欧美一区欧美二区| 色老汉一区二区三区| 成人午夜视频免费看| 国产在线国偷精品产拍免费yy| 亚洲综合激情小说| 一区二区三区国产精品| 最新久久zyz资源站| 久久免费视频色| 日韩一卡二卡三卡四卡| 91精品国产欧美一区二区成人| 欧美性一区二区| 欧美丝袜自拍制服另类| 欧美影视一区在线| 欧美色视频一区| 欧美视频一区在线观看| 欧美性大战久久久久久久| 91女人视频在线观看| 99免费精品视频| 丁香激情综合国产| 成人精品在线视频观看| 国产91清纯白嫩初高中在线观看| 国产美女精品人人做人人爽| 国产一本一道久久香蕉| 国产福利一区二区三区视频| 国产宾馆实践打屁股91| 成人av片在线观看| 色婷婷av一区| 欧美日韩电影在线| 欧美大度的电影原声| 久久久综合视频| 国产精品不卡在线| 一区二区三区欧美久久| 亚洲国产欧美日韩另类综合| 婷婷夜色潮精品综合在线| 久久国产生活片100| 国产成人免费在线观看不卡| 波多野结衣在线一区| 在线观看一区二区视频| 欧美精品在线观看一区二区| 91麻豆精品国产| 久久精品一区二区| 亚洲综合免费观看高清在线观看| 亚洲bt欧美bt精品777| 久久99国产乱子伦精品免费| 国产iv一区二区三区| 91九色02白丝porn| 精品国产伦一区二区三区免费| 国产欧美日韩卡一| 亚洲综合在线五月| 激情文学综合网| 99久久精品免费| 日韩三级视频在线观看| 日韩美女视频一区| 日本欧美肥老太交大片| 国产精品18久久久久久久久| 日本韩国欧美国产| 欧美成人a在线| 亚洲欧美电影院| 国产另类ts人妖一区二区| 在线免费不卡视频| 中文字幕精品一区| 麻豆成人av在线| 精品视频色一区| 日韩一区在线播放| 激情成人综合网| 欧美图区在线视频| 国产午夜精品一区二区三区嫩草| 亚洲二区在线视频| 国产jizzjizz一区二区| 91精品国产一区二区三区| 中文字幕在线免费不卡| 麻豆精品一区二区| 欧美日韩aaaaa| 亚洲卡通动漫在线| 丁香一区二区三区| 欧美zozozo| 免费人成在线不卡| 在线观看亚洲精品视频| 欧美国产丝袜视频| 国产美女在线精品| 欧美一区二区三区在线| 亚洲综合男人的天堂| 99re热这里只有精品视频| 久久久青草青青国产亚洲免观| 亚洲一区二区三区四区在线| www.欧美精品一二区| 久久久亚洲精华液精华液精华液| 五月综合激情婷婷六月色窝| 色婷婷亚洲一区二区三区| 国产精品免费人成网站| 国产精品456| 久久久久久久久久久久久夜| 精品影视av免费| 精品日韩一区二区三区| 日本怡春院一区二区| 欧美日韩在线电影| 亚洲免费在线看| 99视频精品免费视频| 国产精品久久久久久久久免费相片 | 不卡一区二区在线| 中文字幕av一区 二区| 国产一区999| 国产精品视频你懂的| 成人福利在线看| 国产精品久久久久三级| eeuss国产一区二区三区|