Last change
on this file since 412 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 | |
---|
1 | function DataOut=im_filter(DataIn,Calib)
|
---|
2 | np=20 %size ofthe filtering window
|
---|
3 | %definition of the cos shape matrix filter
|
---|
4 | ix=[1/2-np/2:-1/2+np/2];%
|
---|
5 | del=np/3;
|
---|
6 | %fct=exp(-(ix/del).^2);
|
---|
7 | fct2=cos(ix/((np-1)/2)*pi/2);
|
---|
8 | %Mfiltre=(ones(5,5)/5^2);
|
---|
9 | Mfiltre=fct2'*fct2;
|
---|
10 | Mfiltre=Mfiltre/(sum(sum(Mfiltre)));%normalize filter
|
---|
11 |
|
---|
12 | DataOut=DataIn; %default
|
---|
13 | Atype=class(DataIn.A)% detect integer 8 or 16 bits
|
---|
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
|
---|
21 | |
---|
Note: See
TracBrowser
for help on using the repository browser.