Changeset 851 for trunk/src/series/stereo_civ.m
- Timestamp:
- Jan 19, 2015, 9:29:28 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/series/stereo_civ.m
r846 r851 595 595 Data.Civ2_FF(ind_good)=FFres; 596 596 Data.CivStage=Data.CivStage+1; 597 598 599 % % 600 % % % get z from u and v (displacements) 601 % % 602 % Data.Xphys=Rangx(1)+(Rangx(2)-Rangx(1))*(Data.Civ2_X-0.5)/(Npx-1); 603 % Data.Yphys=Rangy(1)+(Rangy(2)-Rangy(1))*(Data.Civ2_Y-0.5)/(Npy-1); 604 % U=Data.Civ2_U_smooth*(Rangx(2)-Rangx(1))/(Npx-1); 605 % V=Data.Civ2_V_smooth*(Rangy(2)-Rangy(1))/(Npy-1); 606 % [Data.Zphys,Data.Civ1_E]=shift2z(Data.Xphys,Data.Yphys,U,V,XmlData); 607 % % if ~isempty(errormsg) 608 % % disp_uvmat('ERROR',errormsg,checkrun) 609 % % return 610 % % end 611 597 612 end 598 613 … … 821 836 utable(ivec)=vector(1)*mesh+shiftx(ivec); 822 837 vtable(ivec)=vector(2)*mesh+shifty(ivec); 823 xtable(ivec)=iref+utable(ivec)/2-0.5;% convec flow (velocity taken at the point middle from imgae 1 and 2)824 ytable(ivec)=jref+vtable(ivec)/2-0.5;% and position of pixel 1=0.5 (convention for image coordinates=0 at the edge)838 % xtable(ivec)=iref+utable(ivec)/2-0.5;% convec flow (velocity taken at the point middle from imgae 1 and 2) 839 % ytable(ivec)=jref+vtable(ivec)/2-0.5;% and position of pixel 1=0.5 (convention for image coordinates=0 at the edge) 825 840 iref=round(xtable(ivec));% image index for the middle of the vector 826 841 jref=round(ytable(ivec)); … … 1034 1049 error=0; 1035 1050 1051 1036 1052 %% first image 1037 1053 Calib_A=XmlData{1}.GeometryCalib; 1038 1054 R=(Calib_A.R)'; 1039 x_a=xmid- u/2; 1040 y_a=ymid- v/2; 1041 z_a=R(7)*x_a+R(8)*y_a+R(9)*Calib_A.SliceCoord(1,3); 1042 X=(R(1)*x_a+R(2)*y_a+R(3)*Calib_A.SliceCoord(1,3))./z_a; 1043 Y=(R(4)*x_a+R(5)*y_a+R(6)*Calib_A.SliceCoord(1,3))./z_a; 1044 A_1_1=R(1)-R(7)*x_a; 1045 A_1_2=R(2)-R(8)*x_a; 1046 A_1_3=R(3)-R(9)*x_a; 1047 A_2_1=R(4)-R(7)*y_a; 1048 A_2_2=R(5)-R(8)*y_a; 1049 A_2_3=R(6)-R(9)*y_a; 1055 x_a=xmid-u/2; 1056 y_a=ymid-v/2; 1057 z_a=R(7)*x_a+R(8)*y_a+Calib_A.Tx_Ty_Tz(1,3); 1058 Xa=(R(1)*x_a+R(2)*y_a+Calib_A.Tx_Ty_Tz(1,1))./z_a; 1059 Ya=(R(4)*x_a+R(5)*y_a+Calib_A.Tx_Ty_Tz(1,2))./z_a; 1060 1061 A_1_1=R(1)-R(7)*Xa; 1062 A_1_2=R(2)-R(8)*Xa; 1063 A_1_3=R(3)-R(9)*Xa; 1064 A_2_1=R(4)-R(7)*Ya; 1065 A_2_2=R(5)-R(8)*Ya; 1066 A_2_3=R(6)-R(9)*Ya; 1050 1067 Det=A_1_1.*A_2_2-A_1_2.*A_2_1; 1051 1068 Dxa=(A_1_2.*A_2_3-A_2_2.*A_1_3)./Det; … … 1053 1070 1054 1071 %% second image 1055 Calib_ A=XmlData{1}.GeometryCalib;1056 R=(Calib_ A.R)';1057 x_ a=xmid+ u/2;1058 y_ a=ymid+ v/2;1059 z_ a=R(7)*x_a+R(8)*y_a+R(9)*Calib_A.SliceCoord(1,3);1060 X =(R(1)*x_a+R(2)*y_a+R(3)*Calib_A.SliceCoord(1,3))./z_a;1061 Y =(R(4)*x_a+R(5)*y_a+R(6)*Calib_A.SliceCoord(1,3))./z_a;1062 A_1_1=R(1)-R(7)*x_a;1063 A_1_2=R(2)-R(8)*x_a;1064 A_1_3=R(3)-R(9)*x_a;1065 A_2_1=R(4)-R(7)*y_a;1066 A_2_2=R(5)-R(8)*y_a;1067 A_2_3=R(6)-R(9)*y_a;1068 Det= A_1_1.*A_2_2-A_1_2.*A_2_1;1069 Dxb=( A_1_2.*A_2_3-A_2_2.*A_1_3)./Det;1070 Dyb=( A_2_1.*A_1_3-A_1_1.*A_2_3)./Det;1072 Calib_B=XmlData{2}.GeometryCalib; 1073 R=(Calib_B.R)'; 1074 x_b=xmid+ u/2; 1075 y_b=ymid+ v/2; 1076 z_b=R(7)*x_b+R(8)*y_b+Calib_B.Tx_Ty_Tz(1,3); 1077 Xb=(R(1)*x_b+R(2)*y_b+Calib_B.Tx_Ty_Tz(1,1))./z_b; 1078 Yb=(R(4)*x_b+R(5)*y_b+Calib_B.Tx_Ty_Tz(1,2))./z_b; 1079 B_1_1=R(1)-R(7)*Xb; 1080 B_1_2=R(2)-R(8)*Xb; 1081 B_1_3=R(3)-R(9)*Xb; 1082 B_2_1=R(4)-R(7)*Yb; 1083 B_2_2=R(5)-R(8)*Yb; 1084 B_2_3=R(6)-R(9)*Yb; 1085 Det=B_1_1.*B_2_2-B_1_2.*B_2_1; 1086 Dxb=(B_1_2.*B_2_3-B_2_2.*B_1_3)./Det; 1087 Dyb=(B_2_1.*B_1_3-B_1_1.*B_2_3)./Det; 1071 1088 1072 1089 %% result … … 1074 1091 error=((Dyb-Dya).*u-(Dxb-Dxa).*v)./Den; 1075 1092 z=((Dxb-Dxa).*u-(Dyb-Dya).*v)./Den; 1093
Note: See TracChangeset
for help on using the changeset viewer.