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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? tsai.m

?? 本代碼是Tsai兩步法標定程序
?? 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 
%                              //2006-03-04 如有疑問:simonwan1980@gmail.com (因為已從哈工大畢業,此地址已作廢simonwan1980@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
    
    
    
    
    
    

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
喷水一区二区三区| 国产精品久久久久精k8| 色婷婷精品久久二区二区蜜臀av| 黑人巨大精品欧美黑白配亚洲| 午夜欧美电影在线观看| 一区二区在线观看不卡| 一区二区三区毛片| 亚洲激情图片qvod| 亚洲综合色成人| 亚洲福利视频一区| 亚洲成a人片在线观看中文| 一区二区三国产精华液| 亚洲va欧美va国产va天堂影院| 亚洲一区中文日韩| 婷婷久久综合九色综合伊人色| 一区二区三区中文字幕| 亚洲国产精品欧美一二99| 亚洲成人一二三| 裸体一区二区三区| 国产精品888| 色婷婷精品大在线视频| 欧美日韩一区二区三区四区五区 | 日欧美一区二区| 婷婷综合在线观看| 国产一区不卡在线| av一区二区久久| 欧美人xxxx| 国产亚洲人成网站| 亚洲精品菠萝久久久久久久| 五月激情综合网| 国产福利一区二区三区在线视频| 成人v精品蜜桃久久一区| 欧美亚洲精品一区| 精品国产乱码久久久久久浪潮 | 日韩影院精彩在线| 国产高清精品网站| 91精品办公室少妇高潮对白| 日韩精品一区二区在线| 国产精品福利影院| 久久精品久久综合| 91同城在线观看| 欧美一级精品在线| 亚洲日本va午夜在线电影| 久久不见久久见中文字幕免费| 成人理论电影网| 日韩一级大片在线| 亚洲欧美欧美一区二区三区| 久久国产麻豆精品| 欧美艳星brazzers| 中文字幕不卡一区| 久久成人羞羞网站| 欧美中文字幕久久| 免费欧美日韩国产三级电影| 一区二区免费视频| 国产精品久久久久久久久免费樱桃| 五月婷婷激情综合网| 成人激情电影免费在线观看| 日韩欧美另类在线| 亚洲第一福利一区| 91免费看视频| 国产精品黄色在线观看| 蜜桃精品视频在线| 欧美一区二区视频免费观看| 亚洲乱码中文字幕| 波多野洁衣一区| 久久久精品国产免大香伊| 免费人成黄页网站在线一区二区| 欧美中文字幕不卡| 亚洲精品日产精品乱码不卡| proumb性欧美在线观看| 亚洲国产精品99久久久久久久久| 麻豆精品视频在线观看免费| 欧美一区二区精美| 日韩黄色片在线观看| 欧美日韩三级视频| 日韩中文欧美在线| 69久久99精品久久久久婷婷| 亚洲aⅴ怡春院| 欧美日韩精品欧美日韩精品一| 日韩美女主播在线视频一区二区三区| 在线观看网站黄不卡| 国产精品一区二区久激情瑜伽| 91精品国产日韩91久久久久久| 亚洲国产精品久久人人爱蜜臀 | 国产人妖乱国产精品人妖| 精品亚洲国产成人av制服丝袜| 91精品国产综合久久婷婷香蕉| 青草av.久久免费一区| 宅男在线国产精品| 精品一区二区三区不卡| 久久婷婷久久一区二区三区| 成人午夜在线播放| 亚洲精品乱码久久久久久久久| 欧美亚洲国产一区在线观看网站| 香蕉影视欧美成人| 精品国产百合女同互慰| 国产精品一区二区黑丝| 亚洲国产精品精华液ab| 在线免费观看日本一区| 偷窥少妇高潮呻吟av久久免费| 日韩限制级电影在线观看| 国模少妇一区二区三区| 国产精品乱人伦一区二区| 色综合天天综合给合国产| 午夜精品久久久久久久99水蜜桃| 日韩三级.com| 成人高清av在线| 日日骚欧美日韩| 国产日韩欧美a| 欧美亚洲尤物久久| 2021国产精品久久精品| 日韩中文字幕一区二区三区| 亚洲一区二区三区视频在线播放| 欧美精三区欧美精三区| 国产成人高清视频| 亚洲午夜精品久久久久久久久| 精品久久国产老人久久综合| 99re这里只有精品首页| 久久国产精品99久久人人澡| 日韩美女视频一区| 日韩欧美色综合| 在线国产亚洲欧美| 国产成人免费在线视频| 亚洲一区二区三区不卡国产欧美| 久久亚区不卡日本| 欧美区在线观看| 91免费视频网| 国产成人在线视频网址| 日产国产欧美视频一区精品 | 欧美精品一区二区久久婷婷| 在线亚洲精品福利网址导航| 国产一区二区精品久久| 亚洲电影激情视频网站| 日韩伦理av电影| 欧美韩国一区二区| 日韩亚洲国产中文字幕欧美| 欧美影院一区二区| 波多野结衣欧美| 国产成人av福利| 国产综合久久久久久鬼色| 视频一区欧美日韩| 亚洲高清视频的网址| 亚洲女同一区二区| 国产精品久久久一本精品| 久久综合色一综合色88| 精品国产乱子伦一区| 日韩欧美一区二区久久婷婷| 欧美日韩精品欧美日韩精品一综合| 一本久久精品一区二区| 成人av第一页| av不卡在线观看| 色综合婷婷久久| 91在线视频观看| 91丨porny丨蝌蚪视频| av亚洲精华国产精华| av在线不卡电影| va亚洲va日韩不卡在线观看| 成人黄色片在线观看| 不卡av电影在线播放| 不卡免费追剧大全电视剧网站| 成人av免费在线观看| 不卡视频一二三四| 色噜噜夜夜夜综合网| 在线看不卡av| 91精品国产91久久综合桃花| 欧美成人vr18sexvr| 国产色综合久久| 亚洲日本在线天堂| 亚洲午夜精品一区二区三区他趣| 天天综合网天天综合色| 奇米精品一区二区三区在线观看 | 国产99久久久国产精品免费看| 成人免费不卡视频| 北条麻妃国产九九精品视频| 色一情一乱一乱一91av| 欧美三级欧美一级| 日韩美女主播在线视频一区二区三区 | 6080yy午夜一二三区久久| 日韩久久久精品| 欧美国产一区视频在线观看| 一区二区三区蜜桃| 蜜桃精品视频在线| 成人免费高清在线观看| 欧美日韩一区二区欧美激情| www亚洲一区| 成人欧美一区二区三区白人| 天堂精品中文字幕在线| 国产精品综合一区二区三区| 成人91在线观看| 91精品一区二区三区久久久久久| 久久久久九九视频| 亚洲国产日韩av| 国产福利一区二区三区视频 | 国产福利视频一区二区三区| 色综合久久久久久久久| 欧美电影免费观看高清完整版| 中文字幕欧美一| 国产美女娇喘av呻吟久久| 欧美无乱码久久久免费午夜一区 | 亚洲欧美乱综合|