1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
---|
2 | "http://www.w3.org/TR/REC-html40/loose.dtd"> |
---|
3 | <html> |
---|
4 | <head> |
---|
5 | <title>Description of pxcm_tsai</title> |
---|
6 | <meta name="keywords" content="pxcm_tsai"> |
---|
7 | <meta name="description" content="'pxcm_tsai': find differentials of the Tsai calibration"> |
---|
8 | <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> |
---|
9 | <meta name="generator" content="m2html © 2003 Guillaume Flandin"> |
---|
10 | <meta name="robots" content="index, follow"> |
---|
11 | <link type="text/css" rel="stylesheet" href="../m2html.css"> |
---|
12 | </head> |
---|
13 | <body> |
---|
14 | <a name="_top"></a> |
---|
15 | <div><a href="../index.html">Home</a> > <a href="index.html">.</a> > pxcm_tsai.m</div> |
---|
16 | |
---|
17 | <!--<table width="100%"><tr><td align="left"><a href="../index.html"><img alt="<" border="0" src="../left.png"> Master index</a></td> |
---|
18 | <td align="right"><a href="index.html">Index for . <img alt=">" border="0" src="../right.png"></a></td></tr></table>--> |
---|
19 | |
---|
20 | <h1>pxcm_tsai |
---|
21 | </h1> |
---|
22 | |
---|
23 | <h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2> |
---|
24 | <div class="box"><strong>'pxcm_tsai': find differentials of the Tsai calibration</strong></div> |
---|
25 | |
---|
26 | <h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2> |
---|
27 | <div class="box"><strong>function [A11,A12,A13,A21,A22,A23]=pxcm_tsai(a,var_phys) </strong></div> |
---|
28 | |
---|
29 | <h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2> |
---|
30 | <div class="fragment"><pre class="comment">'pxcm_tsai': find differentials of the Tsai calibration</pre></div> |
---|
31 | |
---|
32 | <!-- crossreference --> |
---|
33 | <h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2> |
---|
34 | This function calls: |
---|
35 | <ul style="list-style-image:url(../matlabicon.gif)"> |
---|
36 | </ul> |
---|
37 | This function is called by: |
---|
38 | <ul style="list-style-image:url(../matlabicon.gif)"> |
---|
39 | <li><a href="RUN_STLIN.html" class="code" title="function RUN_STLIN(file_A,file_B,vel_type,file_st,nx_patch,ny_patch,thresh_patch,fileAxml,fileBxml)">RUN_STLIN</a> 'RUN_STLIN': combine velocity fields for stereo PIV</li></ul> |
---|
40 | <!-- crossreference --> |
---|
41 | |
---|
42 | |
---|
43 | <h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2> |
---|
44 | <div class="fragment"><pre>0001 <span class="comment">%'pxcm_tsai': find differentials of the Tsai calibration</span> |
---|
45 | 0002 <span class="comment">%</span> |
---|
46 | 0003 <a name="_sub0" href="#_subfunctions" class="code">function [A11,A12,A13,A21,A22,A23]=pxcm_tsai(a,var_phys)</a> |
---|
47 | 0004 a_read=a; |
---|
48 | 0005 |
---|
49 | 0006 R=(a.R)'; |
---|
50 | 0007 |
---|
51 | 0008 x=var_phys(:,1); |
---|
52 | 0009 y=var_phys(:,2); |
---|
53 | 0010 |
---|
54 | 0011 <span class="keyword">if</span> isfield(a,<span class="string">'PlanePos'</span>) |
---|
55 | 0012 prompt={<span class="string">'Plane 1 Index'</span>,<span class="string">'Plane 2 Index'</span>}; |
---|
56 | 0013 Rep=inputdlg(prompt,<span class="string">'Target displacement test'</span>); |
---|
57 | 0014 Z1=str2double(Rep(1)); |
---|
58 | 0015 Z2=str2double(Rep(2)); |
---|
59 | 0016 z=(a.PlanePos(Z2,3)+a.PlanePos(Z1,3))/2 |
---|
60 | 0017 <span class="keyword">else</span> |
---|
61 | 0018 z=0; |
---|
62 | 0019 <span class="keyword">end</span> |
---|
63 | 0020 |
---|
64 | 0021 <span class="comment">%transform coeff for differentiels</span> |
---|
65 | 0022 a.C11=R(1)*R(8)-R(2)*R(7); |
---|
66 | 0023 a.C12=R(2)*R(7)-R(1)*R(8); |
---|
67 | 0024 a.C21=R(4)*R(8)-R(5)*R(7); |
---|
68 | 0025 a.C22=R(5)*R(7)-R(4)*R(8); |
---|
69 | 0026 a.C1x=R(3)*R(7)-R(9)*R(1); |
---|
70 | 0027 a.C1y=R(3)*R(8)-R(9)*R(2); |
---|
71 | 0028 a.C2x=R(6)*R(7)-R(9)*R(4); |
---|
72 | 0029 a.C2y=R(6)*R(8)-R(9)*R(5); |
---|
73 | 0030 |
---|
74 | 0031 |
---|
75 | 0032 <span class="comment">%dependence in x,y</span> |
---|
76 | 0033 denom=(R(7)*x+R(8)*y+R(9)*z+a.Tz).*(R(7)*x+R(8)*y+R(9)*z+a.Tz); |
---|
77 | 0034 A11=(a.f*a.sx*(a.C11*y-a.C1x*z+R(1)*a.Tz-R(7)*a.Tx)./denom)/a.dpx; |
---|
78 | 0035 A12=(a.f*a.sx*(a.C12*x-a.C1y*z+R(2)*a.Tz-R(8)*a.Tx)./denom)/a.dpx; |
---|
79 | 0036 A21=(a.f*a.sx*(a.C21*y-a.C2x*z+R(4)*a.Tz-R(7)*a.Ty)./denom)/a.dpy; |
---|
80 | 0037 A22=(a.f*(a.C22*x-a.C2y*z+R(5)*a.Tz-R(8)*a.Ty)./denom)/a.dpy; |
---|
81 | 0038 A13=(a.f*(a.C1x*x+a.C1y*y+R(3)*a.Tz-R(9)*a.Tx)./denom)/a.dpx; |
---|
82 | 0039 A23=(a.f*(a.C2x*x+a.C2y*y+R(6)*a.Tz-R(9)*a.Ty)./denom)/a.dpy; |
---|
83 | 0040 |
---|
84 | 0041 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</span> |
---|
85 | 0042 <span class="comment">%Old Version for z=0</span> |
---|
86 | 0043 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</span> |
---|
87 | 0044 <span class="comment">% %'camera' coordinates</span> |
---|
88 | 0045 <span class="comment">% xc=R(1)*x+R(2)*y+a.Tx;</span> |
---|
89 | 0046 <span class="comment">% yc=R(4)*x+R(5)*y+a.Ty;</span> |
---|
90 | 0047 <span class="comment">% zc=R(7)*x+R(8)*y+a.Tz;</span> |
---|
91 | 0048 <span class="comment">% %undistorted image coordinates</span> |
---|
92 | 0049 <span class="comment">% Xu=a.f*xc./zc;</span> |
---|
93 | 0050 <span class="comment">% Yu=a.f*yc./zc;</span> |
---|
94 | 0051 <span class="comment">% %distorted image coordinates</span> |
---|
95 | 0052 <span class="comment">% distortion=(a.kappa1)*(Xu.*Xu+Yu.*Yu)+1; %!! intégrer derivation kappa</span> |
---|
96 | 0053 <span class="comment">% % distortion=1;</span> |
---|
97 | 0054 <span class="comment">% Xd=Xu./distortion;</span> |
---|
98 | 0055 <span class="comment">% Yd=Yu./distortion;</span> |
---|
99 | 0056 <span class="comment">% %pixel coordinates</span> |
---|
100 | 0057 <span class="comment">% X=Xd*a.sx/a.dpx+a.Cx;</span> |
---|
101 | 0058 <span class="comment">% Y=Yd/a.dpy+a.Cy;</span> |
---|
102 | 0059 <span class="comment">%</span> |
---|
103 | 0060 <span class="comment">% %transform coeff for differentiels</span> |
---|
104 | 0061 <span class="comment">% a.C11=R(1)*R(8)-R(2)*R(7);</span> |
---|
105 | 0062 <span class="comment">% a.C12=R(2)*R(7)-R(1)*R(8);</span> |
---|
106 | 0063 <span class="comment">% a.C21=R(4)*R(8)-R(5)*R(7);</span> |
---|
107 | 0064 <span class="comment">% a.C22=R(5)*R(7)-R(4)*R(8);</span> |
---|
108 | 0065 <span class="comment">% a.C1x=R(3)*R(7)-R(9)*R(1);</span> |
---|
109 | 0066 <span class="comment">% a.C1y=R(3)*R(8)-R(9)*R(2);</span> |
---|
110 | 0067 <span class="comment">% a.C2x=R(6)*R(7)-R(9)*R(4);</span> |
---|
111 | 0068 <span class="comment">% a.C2y=R(6)*R(8)-R(9)*R(5);</span> |
---|
112 | 0069 <span class="comment">%</span> |
---|
113 | 0070 <span class="comment">%</span> |
---|
114 | 0071 <span class="comment">% %dependence in x,y</span> |
---|
115 | 0072 <span class="comment">% denom=(R(7)*x+R(8)*y+a.Tz).*(R(7)*x+R(8)*y+a.Tz);</span> |
---|
116 | 0073 <span class="comment">% A11=(a.f*a.sx*(a.C11*y+R(1)*a.Tz-R(7)*a.Tx)./denom)/a.dpx;</span> |
---|
117 | 0074 <span class="comment">% A12=(a.f*a.sx*(a.C12*x+R(2)*a.Tz-R(8)*a.Tx)./denom)/a.dpx;</span> |
---|
118 | 0075 <span class="comment">% A21=(a.f*a.sx*(a.C21*y+R(4)*a.Tz-R(7)*a.Ty)./denom)/a.dpy;</span> |
---|
119 | 0076 <span class="comment">% A22=(a.f*(a.C22*x+R(5)*a.Tz-R(8)*a.Ty)./denom)/a.dpy;</span> |
---|
120 | 0077 <span class="comment">% A13=(a.f*(a.C1x*x+a.C1y*y+R(3)*a.Tz-R(9)*a.Tx)./denom)/a.dpx;</span> |
---|
121 | 0078 <span class="comment">% A23=(a.f*(a.C2x*x+a.C2y*y+R(6)*a.Tz-R(9)*a.Ty)./denom)/a.dpy;</span> |
---|
122 | 0079 <span class="comment">%</span></pre></div> |
---|
123 | <hr><address>Generated on Fri 13-Nov-2009 11:17:03 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/">m2html</a></strong> © 2003</address> |
---|
124 | </body> |
---|
125 | </html> |
---|