source: trunk/src/transform_field/im_filter.m @ 295

Last change on this file since 295 was 93, checked in by sommeria, 14 years ago

FFT: improved to deal with NaN data
merge_proj: corrected to reproduce dt if unique
uvmat.fig: tooltip corrected
plot_field: bug for isocontour corrected,
im_filter: cleaning
phys_polar: spatial derivative included (still to check)
set_obeject.fig: minor correction
struct2nc: comments improved
uvmat: button NB implemented
read_civxdata: error message improved

File size: 751 bytes
Line 
1function DataOut=im_filter(DataIn,Calib)
2np=20 %size ofthe filtering window
3%definition of the cos shape matrix filter
4ix=[1/2-np/2:-1/2+np/2];%
5del=np/3;
6%fct=exp(-(ix/del).^2);
7fct2=cos(ix/((np-1)/2)*pi/2);
8%Mfiltre=(ones(5,5)/5^2);
9Mfiltre=fct2'*fct2;
10Mfiltre=Mfiltre/(sum(sum(Mfiltre)));%normalize filter
11
12DataOut=DataIn; %default
13Atype=class(DataIn.A)% detect integer 8 or 16 bits
14if 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
17else
18    DataOut.A=filter2(Mfiltre,DataIn.A)
19    DataOut.A=feval(Atype,DataOut.A);%transform to the initial image format
20end
21 
Note: See TracBrowser for help on using the repository browser.