Presentation is loading. Please wait.

Presentation is loading. Please wait.

Measurements in Fluid Mechanics 058:180:001 (ME:5180:0001) Time & Location: 2:30P - 3:20P MWF 218 MLH Office Hours: 4:00P – 5:00P MWF 223B-5 HL Instructor:

Similar presentations


Presentation on theme: "Measurements in Fluid Mechanics 058:180:001 (ME:5180:0001) Time & Location: 2:30P - 3:20P MWF 218 MLH Office Hours: 4:00P – 5:00P MWF 223B-5 HL Instructor:"— Presentation transcript:

1 Measurements in Fluid Mechanics 058:180:001 (ME:5180:0001) Time & Location: 2:30P - 3:20P MWF 218 MLH Office Hours: 4:00P – 5:00P MWF 223B-5 HL Instructor: Lichuan Gui lichuan-gui@uiowa.edu http://lcgui.net

2 2 Lecture 27. Bias Error of Correlation Interrogation

3 3 Bias Error of Correlation Interrogation Performance of FFT-based correlation Reduced effective correlation region with increasing magnitude of (m, n) A : Effective correlation region B,C,D: Periodically Padded regions - The reliability & accuracy decrease with increasing particle image displacement (m*,n*) - The evaluated particle image displacement has smaller magnitude than that of the true value

4 4 Bias Error of Correlation Interrogation Bias & random errors for measuring variable X N times RMS fluctuation (random error) RMS error Individuale reading of X: Mean value 0

5 5 Probability density function (PDF) Bias Error of Correlation Interrogation Bias & random errors for measuring variable X N times PDF for measuring displacement 0.5 pixels   

6 6 Bias Error of Correlation Interrogation Correlation interrogation with Gaussian window mask f=32x32 Gui et al 2000, A digital mask technique for reducing the bias error of the correlation-based PIV interrogation algorithm. Exp. Fluids 29, 30-35

7 7 Bias Error of Correlation Interrogation Correlation interrogation with Gaussian window mask function [gm]=wmask(go) % INPUT: go - original evaluation sample % OUTPUT: gm - masked evaluation sample [M N]=size(go); for i=1:M for j=1:N gm(i,j)=exp(-4*((i-M/2)*(i-M/2)/(M*M/4)+(j-N/2)*(j-N/2)/(N*N/4)))*go(i,j); end Matlab function for Gaussian window mask File name: wmask.m Test image pair: - simulated single-exposed PIV recording pair of 1024  1024 pixels - given uniform particle image displacement:  x=3.5,  y=5.5 pixels http://lcgui.net/ui-lecture/lecture27/lecture27-image01.bmp http://lcgui.net/ui-lecture/lecture27/lecture27-image02.bmp

8 8 Class project: example of Matlab functions for PIV recording evaluation Test function “correlation.m” with simulated PIV recordings Test main program: clear; A1=imread('01.bmp'); % input image file A2=imread('02.bmp'); % input image file g1=img2xy(A1); % convert image to gray value distribution g2=img2xy(A2); % convert image to gray value distribution [C m n]=correlation(g1,g2); D=xy2img(C); % convert correlation function to image imshow(D); % display correlation function [cm vx vy]=peaksearch(C,m,n,12,0,0) % particle image displacement 01.bmp02.bmp Correlation function Vx=-3.4449 Vy=-5.3235

9 Class project: corrected Matlab functions File name: correlation.m function[c m n]=correlation(g1,g2) [M N]=size(g1); % determine size of evaluation sample % determine window size for FFT - begin for k=3:12 if 2^k>=M & 2^k>=N break; end M2=2^k; N2=2^k; % determine window size for FFT - end % average gray value padding - begin gm1=mean(mean(g1)); gm2=mean(mean(g2)); for i=1:M2 for j=1:N2 if i<=M & j<=N gg1(i,j)=g1(i,j); gg2(i,j)=g2(i,j); else gg1(i,j)=gm1; gg2(i,j)=gm2; end % average gray value padding - end % compute correlation function - begin gfft1=fft2(gg2); gfft2=conj(fft2(gg1)); C=real(ifft2(gfft1.*gfft2)); % compute correlation function - end % determine coordinates in correlation plane - begin for i=1:M2 for j=1:N2 m(i,j)=i-M2/2-1; n(i,j)=j-N2/2-1; end % determine coordinates in correlation plane - end % periodical reconstruction of correlation function - begin for i=1:M2/2 C1(i,1:N2)=C(i+M2/2,1:N2); end for i=M2/2+1:M2 C1(i,1:N2)=C(i-M2/2,1:N2); end for j=1:N2/2 c(1:M2,j)=C1(1:M2,j+N2/2); end for j=N2/2+1:N2 c(1:M2,j)=C1(1:M2,j-N2/2); end % periodical reconstruction of correlation function - end

10 10 File name: xy2img.m function [A]=xy2img(G) % A - image % G - gray value distribution [nx ny]=size(G); Gmax=max(max(G)); Gmin=min(min(G)); for x=1:nx for y=1:ny A(ny-y+1,x)=uint8(double(G(x,y)-Gmin)/double(Gmax-Gmin)*245+5); end Class project: corrected Matlab functions % Uint8 - convert to 8-bit unsigned integer % Int8 - convert to 8-bit signed integer

11 11 Bias Error of Correlation Interrogation Main program to test Gaussian window mask A1=imread('lecture27-image01.bmp'); % input image file A2=imread('lecture27-image02.bmp'); % input image file G1=img2xy(A1); % convert image to gray value distribution G2=img2xy(A2); % convert image to gray value distribution Mg=64; % interrogation grid width Ng=64; % interrogation grid height M=64; % interrogation window width N=64; % interrogation window height [nx ny]=size(G1); row=ny/Mg-1; % grid row number col=nx/Mg-1; % grid column number sr=10; % search radius for i=1:col for j=1:row x=i*Mg; y=j*Mg; g1=sample(G1,M,N,x,y); % evaluation samples g2=sample(G2,M,N,x,y); g1=wmask(g1); % apply Gaussian window mask [C m n]=correlation(g1,g2); [cm vx vy]=peaksearch(C,m,n,sr,0,0); % particle image displacement U(i,j)=vx; V(i,j)=vy; X(i,j)=x; Y(i,j)=y; end quiver(X,Y,U,V); % plot vector map mean(mean(U))-3.5 % bias of x-component mean(mean(V))-5.5 % bias of y-component Unmasked: Masked:

12


Download ppt "Measurements in Fluid Mechanics 058:180:001 (ME:5180:0001) Time & Location: 2:30P - 3:20P MWF 218 MLH Office Hours: 4:00P – 5:00P MWF 223B-5 HL Instructor:"

Similar presentations


Ads by Google