Changeset 93 for trunk/src/transform_field
- Timestamp:
- May 27, 2010, 7:25:58 PM (15 years ago)
- Location:
- trunk/src/transform_field
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/transform_field/im_filter.m
r40 r93 11 11 12 12 DataOut=DataIn; %default 13 14 13 Atype=class(DataIn.A)% detect integer 8 or 16 bits 15 DataOut.A=filter2(Mfiltre,DataIn.A); 16 DataOut.A=feval(Atype,DataOut.A); 14 if numel(size(DataIn.A))==3 15 DataOut.A=filter2(Mfiltre,sum(DataIn.A,3));%filter the input image, after summation on the color component (for color images) 16 DataOut.A=uint16(DataOut.A); %transform to 16 bit images 17 else 18 DataOut.A=filter2(Mfiltre,DataIn.A) 19 DataOut.A=feval(Atype,DataOut.A);%transform to the initial image format 20 end 17 21 -
trunk/src/transform_field/phys_polar.m
r40 r93 28 28 end 29 29 test_1=0; 30 if nargin==4 30 if nargin==4% case of two input fields 31 31 test_1=1; 32 32 Data_1=varargin{3}; … … 65 65 66 66 iscalar=0; 67 %transform first field to cartesian phys coordiantes 67 68 if ~isempty(Calib{1}) 68 69 DataOut=phys_1(Data,Calib{1},origin_xy,radius_offset,angle_offset,angle_scale); … … 80 81 end 81 82 end 82 83 %transform second field (if exists) to cartesian phys coordiantes 83 84 if test_1 84 85 DataOut_1=phys_1(Data_1,Calib{2},origin_xy,radius_offset,angle_offset,angle_scale); … … 153 154 DataOut.V=(-UX.*sin(theta)+VY.*cos(theta));%./(DataOut.X)%+radius_ref);%angular velocity calculated 154 155 %shift and renormalize the angular velocity 156 end 157 end 158 %transform of spatial derivatives 159 if isfield(Data,'X') && ~isempty(Data.X) && isfield(Data,'DjUi') && ~isempty(Data.DjUi)... 160 && isfield(Data,'dt') 161 if ~isempty(Data.dt) 162 % estimate the Jacobian matrix DXpx/DXphys 163 for ip=1:length(Data.X) 164 [Xp1,Yp1]=phys_XYZ(Calib,Data.X(ip)+0.5,Data.Y(ip),Z); 165 [Xm1,Ym1]=phys_XYZ(Calib,Data.X(ip)-0.5,Data.Y(ip),Z); 166 [Xp2,Yp2]=phys_XYZ(Calib,Data.X(ip),Data.Y(ip)+0.5,Z); 167 [Xm2,Ym2]=phys_XYZ(Calib,Data.X(ip),Data.Y(ip)-0.5,Z); 168 %Jacobian matrix DXpphys/DXpx 169 DjXi(1,1)=(Xp1-Xm1); 170 DjXi(2,1)=(Yp1-Ym1); 171 DjXi(1,2)=(Xp2-Xm2); 172 DjXi(2,2)=(Yp2-Ym2); 173 DjUi(:,:)=Data.DjUi(ip,:,:); 174 DjUi=(DjXi*DjUi')/DjXi;% =J-1*M*J , curvature effects (derivatives of J) neglected 175 DataOut.DjUi(ip,:,:)=DjUi'; 176 end 177 DataOut.DjUi = DataOut.DjUi/Data.dt; % min(Data.DjUi(:,1,1))=DUDX 155 178 end 156 179 end
Note: See TracChangeset
for help on using the changeset viewer.