Home > . > pxcm_tsai.m

# pxcm_tsai

## PURPOSE

'pxcm_tsai': find differentials of the Tsai calibration

## SYNOPSIS

function [A11,A12,A13,A21,A22,A23]=pxcm_tsai(a,var_phys)

## DESCRIPTION

'pxcm_tsai': find differentials of the Tsai calibration

## CROSS-REFERENCE INFORMATION

This function calls:
This function is called by:
• RUN_STLIN 'RUN_STLIN': combine velocity fields for stereo PIV

## SOURCE CODE

0001 %'pxcm_tsai': find differentials of the Tsai calibration
0002 %
0003 function [A11,A12,A13,A21,A22,A23]=pxcm_tsai(a,var_phys)
0005
0006 R=(a.R)';
0007
0008 x=var_phys(:,1);
0009 y=var_phys(:,2);
0010
0011 if isfield(a,'PlanePos')
0012     prompt={'Plane 1 Index','Plane 2 Index'};
0013     Rep=inputdlg(prompt,'Target displacement test');
0014     Z1=str2double(Rep(1));
0015     Z2=str2double(Rep(2));
0016     z=(a.PlanePos(Z2,3)+a.PlanePos(Z1,3))/2
0017 else
0018     z=0;
0019 end
0020
0021 %transform coeff for differentiels
0022 a.C11=R(1)*R(8)-R(2)*R(7);
0023 a.C12=R(2)*R(7)-R(1)*R(8);
0024 a.C21=R(4)*R(8)-R(5)*R(7);
0025 a.C22=R(5)*R(7)-R(4)*R(8);
0026 a.C1x=R(3)*R(7)-R(9)*R(1);
0027 a.C1y=R(3)*R(8)-R(9)*R(2);
0028 a.C2x=R(6)*R(7)-R(9)*R(4);
0029 a.C2y=R(6)*R(8)-R(9)*R(5);
0030
0031
0032 %dependence in x,y
0033 denom=(R(7)*x+R(8)*y+R(9)*z+a.Tz).*(R(7)*x+R(8)*y+R(9)*z+a.Tz);
0034 A11=(a.f*a.sx*(a.C11*y-a.C1x*z+R(1)*a.Tz-R(7)*a.Tx)./denom)/a.dpx;
0035 A12=(a.f*a.sx*(a.C12*x-a.C1y*z+R(2)*a.Tz-R(8)*a.Tx)./denom)/a.dpx;
0036 A21=(a.f*a.sx*(a.C21*y-a.C2x*z+R(4)*a.Tz-R(7)*a.Ty)./denom)/a.dpy;
0037 A22=(a.f*(a.C22*x-a.C2y*z+R(5)*a.Tz-R(8)*a.Ty)./denom)/a.dpy;
0038 A13=(a.f*(a.C1x*x+a.C1y*y+R(3)*a.Tz-R(9)*a.Tx)./denom)/a.dpx;
0039 A23=(a.f*(a.C2x*x+a.C2y*y+R(6)*a.Tz-R(9)*a.Ty)./denom)/a.dpy;
0040
0041 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0042 %Old Version for z=0
0043 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0044 % %'camera' coordinates
0045 % xc=R(1)*x+R(2)*y+a.Tx;
0046 % yc=R(4)*x+R(5)*y+a.Ty;
0047 % zc=R(7)*x+R(8)*y+a.Tz;
0048 % %undistorted image coordinates
0049 % Xu=a.f*xc./zc;
0050 % Yu=a.f*yc./zc;
0051 % %distorted image coordinates
0052 % distortion=(a.kappa1)*(Xu.*Xu+Yu.*Yu)+1; %!! intégrer derivation kappa
0053 % % distortion=1;
0054 % Xd=Xu./distortion;
0055 % Yd=Yu./distortion;
0056 % %pixel coordinates
0057 % X=Xd*a.sx/a.dpx+a.Cx;
0058 % Y=Yd/a.dpy+a.Cy;
0059 %
0060 % %transform coeff for differentiels
0061 % a.C11=R(1)*R(8)-R(2)*R(7);
0062 % a.C12=R(2)*R(7)-R(1)*R(8);
0063 % a.C21=R(4)*R(8)-R(5)*R(7);
0064 % a.C22=R(5)*R(7)-R(4)*R(8);
0065 % a.C1x=R(3)*R(7)-R(9)*R(1);
0066 % a.C1y=R(3)*R(8)-R(9)*R(2);
0067 % a.C2x=R(6)*R(7)-R(9)*R(4);
0068 % a.C2y=R(6)*R(8)-R(9)*R(5);
0069 %
0070 %
0071 % %dependence in x,y
0072 % denom=(R(7)*x+R(8)*y+a.Tz).*(R(7)*x+R(8)*y+a.Tz);
0073 % A11=(a.f*a.sx*(a.C11*y+R(1)*a.Tz-R(7)*a.Tx)./denom)/a.dpx;
0074 % A12=(a.f*a.sx*(a.C12*x+R(2)*a.Tz-R(8)*a.Tx)./denom)/a.dpx;
0075 % A21=(a.f*a.sx*(a.C21*y+R(4)*a.Tz-R(7)*a.Ty)./denom)/a.dpy;
0076 % A22=(a.f*(a.C22*x+R(5)*a.Tz-R(8)*a.Ty)./denom)/a.dpy;
0077 % A13=(a.f*(a.C1x*x+a.C1y*y+R(3)*a.Tz-R(9)*a.Tx)./denom)/a.dpx;
0078 % A23=(a.f*(a.C2x*x+a.C2y*y+R(6)*a.Tz-R(9)*a.Ty)./denom)/a.dpy;
0079 %

Generated on Fri 13-Nov-2009 11:17:03 by m2html © 2003