Changeset 368 for trunk/src/civ_matlab.m
- Timestamp:
- Jan 12, 2012, 3:55:07 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/civ_matlab.m
r366 r368 490 490 corrmax=0; 491 491 sum_square=1;% default 492 mesh=1;% default 493 CheckDecimal=isfield(par_civ,'CheckDecimal')&& par_civ.CheckDecimal==1; 494 if CheckDecimal 495 mesh=0.2;%mesh in pixels for subpixel image interpolation 496 end 492 497 % vector=[0 0];%default 493 498 for ivec=1:nbvec … … 515 520 image1_crop=image1_crop-image1_mean;%substract the mean 516 521 image2_crop=image2_crop-image2_mean; 522 if isfield(par_civ,'CheckDecimal')&& par_civ.CheckDecimal==1 523 xi=(1:mesh:size(image1_crop,2)); 524 yi=(1:mesh:size(image1_crop,1))'; 525 image1_crop=interp2(image1_crop,xi,yi); 526 image2_crop=interp2(image2_crop,xi,yi); 527 end 517 528 sum_square=sum(sum(image1_crop.*image1_crop)); 518 529 %reference: Oliver Pust, PIV: Direct Cross-Correlation … … 529 540 [vector,F(ivec)] = SUBPIX2DGAUSS (result_conv,x,y); 530 541 end 531 utable(ivec)=vector(1) +shiftx(ivec);532 vtable(ivec)=vector(2) +shifty(ivec);542 utable(ivec)=vector(1)*mesh+shiftx(ivec); 543 vtable(ivec)=vector(2)*mesh+shifty(ivec); 533 544 xtable(ivec)=iref+utable(ivec)/2;% convec flow (velocity taken at the point middle from imgae1 and 2) 534 545 ytable(ivec)=jref+vtable(ivec)/2;
Note: See TracChangeset
for help on using the changeset viewer.