亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
国产日韩欧美电影| 久久久久久久久久久99999| 国产精品系列在线观看| 蜜桃传媒麻豆第一区在线观看| 伊人婷婷欧美激情| 一区二区三区免费| 一级女性全黄久久生活片免费| 中文字幕亚洲一区二区va在线| 最新热久久免费视频| 亚洲欧美激情小说另类| 亚洲一二三专区| 日韩va欧美va亚洲va久久| 人人超碰91尤物精品国产| 精品在线播放免费| 东方欧美亚洲色图在线| 91啪亚洲精品| 日韩欧美久久久| 国产日韩视频一区二区三区| 国产精品久久看| 亚洲成人动漫在线观看| 美女免费视频一区| 国产成人综合网| 91久久精品国产91性色tv| 777久久久精品| 久久综合九色综合欧美就去吻 | 99久久精品免费看国产| av在线不卡免费看| 欧美亚洲一区三区| 久久亚洲精华国产精华液| 国产精品久99| 奇米影视一区二区三区| 成人综合婷婷国产精品久久| 欧美羞羞免费网站| 精品动漫一区二区三区在线观看| 亚洲日本在线a| 理论电影国产精品| 日本精品视频一区二区| 久久先锋影音av鲁色资源网| 亚洲一区二区三区四区五区中文| 九色综合狠狠综合久久| 欧洲av一区二区嗯嗯嗯啊| 精品国产青草久久久久福利| 亚洲六月丁香色婷婷综合久久| 美国毛片一区二区三区| 色综合久久久久| 精品粉嫩超白一线天av| 婷婷开心激情综合| 99久久亚洲一区二区三区青草| 911国产精品| 亚洲黄色性网站| 成人午夜视频在线| 亚洲精品一区二区三区蜜桃下载 | 久久久国际精品| 无码av免费一区二区三区试看 | 国产在线一区二区| 色av综合在线| 国产三级欧美三级日产三级99 | 欧美日韩1区2区| 欧美怡红院视频| 久久国产精品99久久人人澡| 国产精品网曝门| 欧美三级欧美一级| 国内不卡的二区三区中文字幕 | 精品少妇一区二区三区在线视频| 国产又黄又大久久| 亚洲免费观看高清完整| 欧美一区二区三区免费| 不卡的av在线播放| 亚洲1区2区3区4区| 国产精品污网站| 欧美精品v国产精品v日韩精品| 国产成人免费av在线| 亚洲线精品一区二区三区| 久久这里都是精品| 欧美视频中文字幕| 成人激情校园春色| 免费看黄色91| 一区二区三区av电影| 久久夜色精品国产欧美乱极品| 91国内精品野花午夜精品| 国内精品视频一区二区三区八戒| 一区二区在线观看免费视频播放| 精品久久久久久无| 在线观看视频欧美| 成人免费视频caoporn| 麻豆精品国产91久久久久久 | 中文av一区二区| 日韩午夜中文字幕| 欧美三级视频在线观看| 波多野洁衣一区| 国产最新精品精品你懂的| 午夜久久久久久久久| 1000精品久久久久久久久| 久久久蜜桃精品| 日韩一区二区在线免费观看| 在线观看不卡一区| 99久久精品国产麻豆演员表| 国产成人免费9x9x人网站视频| 美女免费视频一区二区| 日韩国产精品久久久久久亚洲| 亚洲在线视频一区| 亚洲人亚洲人成电影网站色| 日韩国产欧美视频| 亚洲成人av福利| 亚洲自拍偷拍网站| 亚洲一区二区三区四区的| 亚洲视频在线观看一区| 日韩一区中文字幕| 国产精品久久久久四虎| 中文字幕不卡在线| 国产精品视频线看| 国产精品灌醉下药二区| 中文字幕不卡在线| 国产精品久久久久久户外露出 | 国产风韵犹存在线视精品| 久久成人18免费观看| 九九久久精品视频| 国产精品888| 国产成人日日夜夜| 成人精品鲁一区一区二区| 国产盗摄一区二区三区| 成人免费福利片| 91原创在线视频| 色婷婷久久久亚洲一区二区三区| 91麻豆swag| 欧美日韩国产色站一区二区三区| 精品视频1区2区| 日韩一级片在线播放| 2023国产一二三区日本精品2022| 国产欧美精品国产国产专区| 国产精品久久久爽爽爽麻豆色哟哟| 国产精品国产三级国产有无不卡| 136国产福利精品导航| 亚洲一区二区三区四区中文字幕| 亚洲第一主播视频| 久久不见久久见免费视频1| 国产激情精品久久久第一区二区| va亚洲va日韩不卡在线观看| 欧美在线视频全部完| 欧美成人伊人久久综合网| 亚洲国产精品黑人久久久| 亚洲黄一区二区三区| 免费不卡在线视频| 福利电影一区二区| 欧美日韩一区二区三区四区| 精品国产免费久久| 亚洲日本在线a| 激情小说亚洲一区| 日本久久一区二区三区| 亚洲精品在线网站| 亚洲老司机在线| 色婷婷综合五月| 91精品国产色综合久久不卡蜜臀| 久久久久久久久久电影| 亚洲一二三专区| 国产精品中文欧美| 精品视频一区二区三区免费| 久久久久久久综合狠狠综合| 亚洲午夜一区二区| 大胆亚洲人体视频| 欧美一区二区视频观看视频| 自拍偷自拍亚洲精品播放| 麻豆国产精品官网| 欧洲精品一区二区| 欧美激情一区二区三区四区| 日本欧美一区二区三区乱码| 不卡一区二区在线| 欧美成人精精品一区二区频| 亚洲一区二区三区四区不卡| 国产suv精品一区二区6| 91精品国产品国语在线不卡| 亚洲精品欧美激情| 高清不卡一区二区| 精品区一区二区| 婷婷开心激情综合| 欧洲视频一区二区| 中文字幕一区三区| 国产精品资源在线观看| 日韩视频一区二区在线观看| 亚洲一区二区三区精品在线| 成人精品gif动图一区| 久久久久88色偷偷免费| 美女看a上一区| 欧美一级免费大片| 性欧美大战久久久久久久久| 91精品福利视频| 亚洲欧洲韩国日本视频| 高清国产一区二区三区| 久久综合色婷婷| 国产乱子伦视频一区二区三区 | 日韩精品国产欧美| 欧美丝袜丝nylons| 玉米视频成人免费看| 99国产精品国产精品久久| 国产精品视频一二| 91天堂素人约啪| 亚洲免费观看高清完整版在线观看| 99久久精品情趣| 亚洲美女电影在线| 欧美亚洲综合另类|