Changeset 873 for trunk/src/series/civ_series.m
- Timestamp:
- Feb 17, 2015, 1:46:13 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/series/civ_series.m
r862 r873 705 705 par_civ2.SearchBoxShift=(Civ2_Dt/Civ1_Dt)*[Shiftx(nbval>=1)./nbval(nbval>=1) Shifty(nbval>=1)./nbval(nbval>=1)]; 706 706 % shift the grid points by half the expected shift to provide the correlation box position in image A 707 par_civ2.Grid=[par_civ2.Grid(nbval>=1,1)-par_civ2.SearchBoxShift( nbval>=1,1)/2 par_civ2.Grid(nbval>=1,2)-par_civ2.SearchBoxShift(nbval>=1,2)/2];707 par_civ2.Grid=[par_civ2.Grid(nbval>=1,1)-par_civ2.SearchBoxShift(:,1)/2 par_civ2.Grid(nbval>=1,2)-par_civ2.SearchBoxShift(:,2)/2]; 708 708 if par_civ2.CheckDeformation 709 709 par_civ2.DUDX=DUDX./nbval; … … 732 732 end 733 733 end 734 % Data.Civ2_Time=1;735 % Data.Civ2_Dt=1;736 734 for ilist=1:length(list_param) 737 735 Data.(Civ2_param{4+ilist})=Param.ActionInput.Civ2.(list_param{ilist}); … … 961 959 checkmask=0; 962 960 MinA=min(min(par_civ.ImageA)); 963 MinB=min(min(par_civ.ImageB)); 961 %MinB=min(min(par_civ.ImageB)); 962 check_undefined=false(size(par_civ.ImageA)); 964 963 if isfield(par_civ,'Mask') && ~isempty(par_civ.Mask) 965 964 checkmask=1; … … 968 967 return 969 968 end 970 % check_noflux=(par_civ.Mask<100) ;%TODO: to implement971 969 check_undefined=(par_civ.Mask<200 & par_civ.Mask>=20 ); 972 par_civ.ImageA(check_undefined)= MinA;% put image A to zero (i.e. the min image value) in the undefined area973 par_civ.ImageB(check_undefined)= MinB;% put image B to zero (i.e. the min image value) in the undefined area970 par_civ.ImageA(check_undefined)=0;% put image A to zero (i.e. the min image value) in the undefined area 971 par_civ.ImageB(check_undefined)=0;% put image B to zero (i.e. the min image value) in the undefined area 974 972 end 975 973 … … 994 992 image1_crop=MinA*ones(numel(subrange1_y),numel(subrange1_x));% default value=min of image A 995 993 image2_crop=MinA*ones(numel(subrange2_y),numel(subrange2_x));% default value=min of image A 994 mask1_crop=ones(numel(subrange1_y),numel(subrange1_x));% default value=1 for mask 995 mask2_crop=ones(numel(subrange2_y),numel(subrange2_x));% default value=min for mask 996 996 check1_x=subrange1_x>=1 & subrange1_x<=par_civ.ImageWidth;% check which points in the subimage 1 are contained in the initial image 1 997 997 check1_y=subrange1_y>=1 & subrange1_y<=par_civ.ImageHeight; … … 1000 1000 image1_crop(check1_y,check1_x)=par_civ.ImageA(subrange1_y(check1_y),subrange1_x(check1_x));%extract a subimage (correlation box) from image A 1001 1001 image2_crop(check2_y,check2_x)=par_civ.ImageB(subrange2_y(check2_y),subrange2_x(check2_x));%extract a larger subimage (search box) from image B 1002 image1_mean=mean(mean(image1_crop)); 1003 image2_mean=mean(mean(image2_crop)); 1004 %threshold on image minimum 1005 if check_MinIma && (image1_mean < par_civ.MinIma || image2_mean < par_civ.MinIma) 1006 F(ivec)=3; 1007 end 1008 %threshold on image maximum 1009 if check_MaxIma && (image1_mean > par_civ.MaxIma || image2_mean > par_civ.MaxIma) 1010 F(ivec)=3; 1011 end 1012 1002 mask1_crop(check1_y,check1_x)=check_undefined(subrange1_y(check1_y),subrange1_x(check1_x));%extract a mask subimage (correlation box) from image A 1003 mask2_crop(check2_y,check2_x)=check_undefined(subrange2_y(check2_y),subrange2_x(check2_x));%extract a mask subimage (search box) from image B 1004 sizemask=sum(sum(mask1_crop))/(numel(subrange1_y)*numel(subrange1_x));%size of the masked part relative to the correlation sub-image 1005 if sizemask > 1/2% eliminate point if more than half of the correlation box is masked 1006 F(ivec)=3; % 1007 else 1008 image1_mean=mean(mean(image1_crop))/(1-sizemask); 1009 image2_mean=mean(mean(image2_crop))/(1-sizemask); 1010 %threshold on image minimum 1011 if check_MinIma && (image1_mean < par_civ.MinIma || image2_mean < par_civ.MinIma) 1012 F(ivec)=3; 1013 end 1014 %threshold on image maximum 1015 if check_MaxIma && (image1_mean > par_civ.MaxIma || image2_mean > par_civ.MaxIma) 1016 F(ivec)=3; 1017 end 1018 end 1013 1019 if F(ivec)~=3 1014 image1_crop= image1_crop-image1_mean;%substract the mean1015 image2_crop= image2_crop-image2_mean;1020 image1_crop=(image1_crop-image1_mean).*~mask1_crop;%substract the mean, put to zero the masked parts 1021 image2_crop=(image2_crop-image2_mean).*~mask2_crop; 1016 1022 if CheckDeformation 1017 1023 xi=(1:mesh:size(image1_crop,2));
Note: See TracChangeset
for help on using the changeset viewer.