Last change
on this file since 728 was
728,
checked in by sommeria, 11 years ago

ima_ratio added to transform_field: calculate the ratio between two images

File size:
1.2 KB

Line  

1  %'ima_ratio': take the ratio of two input images with same size


2  %


3  % the two fields are subtstracted when of the same nature (scalar or


4  % vector), if the coordinates do not coincide, the second field is


5  % interpolated on the cooridintes of the first one


6  %


7  % when scalar and vectors are combined, the fields are just merged in a single matlab structure for common visualisation


8  %


9  % function SubData=sub_field(Field,XmlData,Field_1)


10  %


11  % OUPUT:


12  % SubData: structure representing the resulting field


13  %


14  % INPUT:


15  % Field: matlab structure representing the first field


16  % XmlData: input calibration parameter, not used


17  % Field_1:matlab structure representing the second field


18 


19  function DataOut=ima_ratio(DataIn,XmlData,DataIn_1)


20 


21  %% option to introduce input parameters when function is selected, skipped here


22  DataOut=DataIn;


23  if ~isstruct(DataOut)


24  % if ~isfield(DataIn,'A')


25  % msgbox_uvmat('ERROR','ima_ratio requires two images of the same size as input')


26  return


27  end


28 


29 


30  %% actual calculation


31  if exist('DataIn_1','var')


32  DataIn_1.A(DataIn_1.A==0)=1;


33  DataOut.A=double(DataIn.A)./double(DataIn_1.A);


34  end


Note: See
TracBrowser
for help on using the repository browser.