Ignore:
Timestamp:
Dec 10, 2014, 11:11:09 PM (9 years ago)
Author:
sommeria
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/series/civ2vel_3C.m

    r839 r840  
    127127[filecell,i1_series,i2_series,j1_series,j2_series]=get_file_series(Param);
    128128
     129%% grid of physical positions
     130[x,y]=meshgrid(ObjectData.RangeX(1):ObjectData.DX:ObjectData.RangeX(2),ObjectData.RangeY(1):ObjectData.DY:ObjectData.RangeY(2));
     131%camera coordinates:initialisation 2 cameras
     132NbCamera=2;
     133X=zeros(NbCamera,size(x,1),size(y,1));
     134Y=zeros(NbCamera,size(x,1),size(y,1));
     135for icamera=1:NbCamera
     136%camera coordinates
     137Calib=XmlData{1}.GeometryCalib;
     138    xc=R(1)*Xphys+R(2)*Yphys+R(3)*Zphys+Calib.Tx_Ty_Tz(1);
     139    yc=R(4)*Xphys+R(5)*Yphys+R(6)*Zphys+Calib.Tx_Ty_Tz(2);
     140    zc=R(7)*Xphys+R(8)*Yphys+R(9)*Zphys+Calib.Tx_Ty_Tz(3);
     141   
     142    %undistorted image coordinates
     143    X(icamera,:,:)=xc./zc;
     144    Y(icamera,:,:)=yc./zc;
     145end
     146
     147%% case of fixed planes (for moving interface, coeff need to be calculated for each field
     148if isequal(size(InputTable),2)
     149[S,D]=get_coeff(XmlData,X,Y);
     150end
     151
    129152 %% MAIN LOOP ON FIELDS
    130153for index=1:NbField
     
    154177       
    155178        %% transform the input field (e.g; phys) if requested (no transform involving two input fields)
     179            %camera coordinates
     180        xc=R(1)*Xphys+R(2)*Yphys+R(3)*Zphys+Calib.Tx_Ty_Tz(1);
     181        yc=R(4)*Xphys+R(5)*Yphys+R(6)*Zphys+Calib.Tx_Ty_Tz(2);
     182        zc=R(7)*Xphys+R(8)*Yphys+R(9)*Zphys+Calib.Tx_Ty_Tz(3);
     183
     184        %undistorted image coordinates
     185        Xu=xc./zc;
     186        Yu=yc./zc;
    156187        Data{iview}=phys(Data{iview},XmlData{iview});
    157188       
     
    346377display([file_st ' written'])
    347378
    348 
     379function [S,D]=get_coeff(XmlData,X,Y);
     380Calib_a=XmlData{1}.GeometryCalib;
     381R=(Calib_a.R)';%rotation matrix
     382A(1,1)=R(1)-R(7)*X;
     383A(1,2)=R(2)-R(8)*X;
     384A(1,3)=R(3)-R(9)*X;
     385A(2,1)=R(4)-R(7)*Y;
     386A(2,2)=R(5)-R(8)*Y;
     387A(2,3)=R(6)-R(9)*Y;
    349388
    350389%'pxcm_tsai': find differentials of the Tsai calibration
Note: See TracChangeset for help on using the changeset viewer.