- Timestamp:
- Jan 10, 2012, 11:32:30 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/civ_matlab.m
r365 r366 205 205 ibx2=ceil(par_civ2.Bx/2); 206 206 iby2=ceil(par_civ2.By/2); 207 isx2=ibx2+ 3;208 isy2=iby2+ 3;207 isx2=ibx2+5;% search ara +-5 pixels around the guess 208 isy2=iby2+5; 209 209 % shift from par_civ2.filename_nc1 210 210 % shiftx=velocity interpolated at position … … 252 252 par_civ2.Shiftx=Shiftx(nbval>=1)./nbval(nbval>=1); 253 253 par_civ2.Shifty=Shifty(nbval>=1)./nbval(nbval>=1); 254 par_civ2.Grid=[GridX(nbval>=1) GridY(nbval>=1)];254 par_civ2.Grid=[GridX(nbval>=1)-par_civ2.Shiftx/2 GridY(nbval>=1)-par_civ2.Shifty/2];% grid taken at the extrapolated origin of the displacement vectors 255 255 if par_civ2.CheckDeformation 256 256 DUDX=DUDX./nbval; … … 261 261 % caluclate velocity data (y and v in indices, reverse to y component) 262 262 [xtable ytable utable vtable ctable F] = civ (par_civ2); 263 % diff_squared=(utable-par_civ2.Shiftx).*(utable-par_civ2.Shiftx)+(vtable+par_civ2.Shifty).*(vtable+par_civ2.Shifty); 264 % F(diff_squared>=4)=4; %flag vectors whose distance to the guess exceeds 2 pixels 263 265 list_param=(fieldnames(Param.Civ2))'; 264 266 list_remove={'pxcmx','pxcmy','npx','npy','gridflag','maskflag','term_a','term_b','T0'}; … … 492 494 iref=par_civ.Grid(ivec,1);% xindex on the image A for the middle of the correlation box 493 495 jref=par_civ.Grid(ivec,2);% yindex on the image B for the middle of the correlation box 494 % xtable(ivec)=iref;495 % ytable(ivec)=jref;%default496 496 if ~(checkmask && par_civ.Mask(jref,iref)<=20) %velocity not set to zero by the black mask 497 497 if jref-iby2<1 || jref+iby2>par_civ.ImageHeight|| iref-ibx2<1 || iref+ibx2>par_civ.ImageWidth||... … … 511 511 F(ivec)=3; 512 512 end 513 end 514 513 end 515 514 if F(ivec)~=3 516 515 image1_crop=image1_crop-image1_mean;%substract the mean … … 531 530 end 532 531 utable(ivec)=vector(1)+shiftx(ivec); 533 vtable(ivec)=vector(2)+shifty(ivec); 532 vtable(ivec)=vector(2)+shifty(ivec); 534 533 xtable(ivec)=iref+utable(ivec)/2;% convec flow (velocity taken at the point middle from imgae1 and 2) 535 534 ytable(ivec)=jref+vtable(ivec)/2;
Note: See TracChangeset
for help on using the changeset viewer.