PIV image correlation function
Hi all,
I trying to correlate PIV images ( about 100 image). I used the below code that can correlate only the first 2 pair of images and I want to modify the loop so it can correlate the rest images. can somebody help me in modifying the loop?
for i= 1: 100;
for j= 1: 100;
max_correlation=0;
test_xmin=xgrid(i);
test_xmax=xgrid(j)+ 20 %w_width/2;
test_ymin=ygrid(i);
test_ymax=ygrid(j)+ 20 %w_width/2;
x_disp=0;
y_disp=0;
test_ima= Imagea(test_xmin:test_xmax, test_ymin:test_ymax);
test_imb= Imageb(test_xmin-x_disp_max:test_xmax+x_disp_max, test_ymin-y_disp_max:test_ymax+ y_disp_max);
correlation= normxcorr2(test_ima, test_imb);
[xpeak, ypeak]= find (correlation==max(correlation(:) ));
end
end
thanks in advanceHi all,
I trying to correlate PIV images ( about 100 image). I used the below code that can correlate only the first 2 pair of images and I want to modify the loop so it can correlate the rest images. can somebody help me in modifying the loop?
for i= 1: 100;
for j= 1: 100;
max_correlation=0;
test_xmin=xgrid(i);
test_xmax=xgrid(j)+ 20 %w_width/2;
test_ymin=ygrid(i);
test_ymax=ygrid(j)+ 20 %w_width/2;
x_disp=0;
y_disp=0;
test_ima= Imagea(test_xmin:test_xmax, test_ymin:test_ymax);
test_imb= Imageb(test_xmin-x_disp_max:test_xmax+x_disp_max, test_ymin-y_disp_max:test_ymax+ y_disp_max);
correlation= normxcorr2(test_ima, test_imb);
[xpeak, ypeak]= find (correlation==max(correlation(:) ));
end
end
thanks in advance Hi all,
I trying to correlate PIV images ( about 100 image). I used the below code that can correlate only the first 2 pair of images and I want to modify the loop so it can correlate the rest images. can somebody help me in modifying the loop?
for i= 1: 100;
for j= 1: 100;
max_correlation=0;
test_xmin=xgrid(i);
test_xmax=xgrid(j)+ 20 %w_width/2;
test_ymin=ygrid(i);
test_ymax=ygrid(j)+ 20 %w_width/2;
x_disp=0;
y_disp=0;
test_ima= Imagea(test_xmin:test_xmax, test_ymin:test_ymax);
test_imb= Imageb(test_xmin-x_disp_max:test_xmax+x_disp_max, test_ymin-y_disp_max:test_ymax+ y_disp_max);
correlation= normxcorr2(test_ima, test_imb);
[xpeak, ypeak]= find (correlation==max(correlation(:) ));
end
end
thanks in advance piv image correlation MATLAB Answers — New Questions