1 | % 'lumin_cali': check the luminosity of the camera lens versus distance to image center |
---|
2 | %---------------------------------------------------------------------- |
---|
3 | |
---|
4 | function input_list=lumin_calib (num_i1,num_i2,num_j1,num_j2,Series) |
---|
5 | |
---|
6 | %display request of input parameters in the series interface (activated directly by the selection in the menu ACTION) |
---|
7 | input_list={'NbSlice';...%nbre of slices |
---|
8 | 'RootPath';... %path to the input root file |
---|
9 | 'RootFile';... %root input file name |
---|
10 | 'FileExt';... %input file extension |
---|
11 | 'NomType';...%type of file indexing |
---|
12 | 'SubDir';...% subdirectory of derived files (PIV fields) |
---|
13 | }; |
---|
14 | |
---|
15 | if ~exist('num_i1','var') |
---|
16 | return % used to display the right input data from input_list when the function is selected |
---|
17 | end |
---|
18 | for ilist=1:length(input_list) |
---|
19 | eval([input_list{ilist} '= Series.' input_list{ilist} ';']) |
---|
20 | end |
---|
21 | |
---|
22 | %----------------------------------------------------------------- |
---|
23 | |
---|
24 | hRUN=findobj(Series.hseries,'Tag','RUN'); |
---|
25 | hwaitbar=findobj(Series.hseries,'Tag','waitbar'); |
---|
26 | waitbarpos(1)=Series.WaitbarPos(1);%x position of the waitbar |
---|
27 | waitbarpos(3)=Series.WaitbarPos(3);% width of the waitbar |
---|
28 | siz=size(num_i1); |
---|
29 | |
---|
30 | |
---|
31 | xpos(1:10)=[297 297 297 314 316 310 310 310 312 325]; |
---|
32 | ypos(1:10)=[818 818 818 817 822 820 820 820 813 799]; |
---|
33 | xpos(11:30)=[364 403 448 479 522 586 613 630 626 581 514 470 380 328 292 292 292 292 292 299]; |
---|
34 | ypos(11:30)=[733 673 604 558 504 405 357 339 337 409 509 570 701 789 845 845 845 845 845 836]; |
---|
35 | xpos(31:49)=[353 273 269 269 269 269 269 270 270 270 270 270 270 270 270 268 268 264 216 ]; |
---|
36 | ypos(31:49)=[748 875 883 883 883 883 883 888 888 888 888 888 888 888 888 888 888 885 959]; |
---|
37 | radius=50; |
---|
38 | Abackground=58.6; |
---|
39 | |
---|
40 | filebase=fullfile(Series.RootPath{1},Series.RootFile{1}); |
---|
41 | dir_images=Series.RootPath{1}; |
---|
42 | nom_type=Series.NomType{1}; |
---|
43 | % filebad=zeros(size(num_i1)); |
---|
44 | indbad=[21 22 30];%bad image |
---|
45 | file_index= 1:length(num_i1); |
---|
46 | ifile=0; |
---|
47 | for ifile= 1:length(num_i1) |
---|
48 | [filename,idetect]=... |
---|
49 | name_generator(filebase,num_i1(ifile),num_j1(ifile),Series.FileExt{1},Series.NomType{1}); |
---|
50 | |
---|
51 | A=imread(filename); |
---|
52 | A=flipdim(A,1); |
---|
53 | ind_x=[xpos(ifile)-radius:xpos(ifile)+radius]; |
---|
54 | ind_y=[ypos(ifile)-radius:ypos(ifile)+radius]; |
---|
55 | A=double(A(ind_y,ind_x))-Abackground; |
---|
56 | [Xi,Yi]=meshgrid([-radius:+radius],[-radius:+radius]); |
---|
57 | % distX=(Xi+radius+1); |
---|
58 | % distY=(Yi+radius+1); |
---|
59 | testin=(Xi.*Xi+Yi.*Yi)<=radius*radius; |
---|
60 | testin=double(testin); |
---|
61 | A=(A>0).*A.*double(testin); |
---|
62 | Amean(ifile)=sum(sum(A))/sum(sum(testin)); |
---|
63 | |
---|
64 | end |
---|
65 | dist=((xpos-512).*(xpos-512))+((ypos-512).*(ypos-512)); |
---|
66 | dist=dist/(512*512); |
---|
67 | file_index(indbad)=[]; |
---|
68 | Amean(indbad)=[]; |
---|
69 | dist(indbad)=[]; |
---|
70 | figure(1) |
---|
71 | plot(file_index,Amean,'+') |
---|
72 | figure(2) |
---|
73 | haxes=axes; |
---|
74 | h=plot(dist,Amean,'+') |
---|
75 | xlabel('distance to image center (pixels)') |
---|
76 | ylabel('luminosity of reference input dye solution') |
---|
77 | set(haxes,'YLim',[0 2850]) |
---|