Created
December 9, 2014 05:51
-
-
Save RDharmaTeja/b1ff47310b02fc7d69cc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%return field matrix | |
function [X,Y] = velocityField(img1,img2,boxWidth,boxHeight,overLap) | |
%img1,img2: intensitity matrices | |
%boxWidth,boxHeight: interrogaiton box size | |
%overlap values can go from 0 to 1, but not 1 | |
imgWidth=size(img1,1); | |
imgHeight=size(img1,2); | |
x=1; | |
y=1; | |
upperI=imgWidth-(overLap)*boxWidth; | |
upperJ=imgHeight-(overLap)*boxHeight; | |
for i=1:(1-overLap)*boxWidth:upperI | |
for j=1:(1-overLap)*boxHeight:upperJ | |
C=eadXCorr(img1(i:i+boxWidth-1,j:j+boxWidth-1),img2(i:i+boxWidth-1,j:j+boxWidth-1)); | |
[row,col]=maxOfMatrix(C); | |
Y(x,y)=(row-boxWidth); | |
X(x,y)=(col-boxHeight); | |
x=x+1; | |
% x increase corresponds to column increase | |
end | |
x=1; | |
y=y+1; | |
%row increase corresponds to column increase | |
end | |
end | |
X(x,y)=(col-boxHeight); x=x+1; | |
% x increase corresponds to column increase end x=1; y=y+1; | |
%row increase corresponds to column increase end end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment