Skip to content

Instantly share code, notes, and snippets.

function drawPlot(boxWidth,boxHeight,overLap)
[X,Y]=main(boxWidth,boxHeight,overLap);
p=1;
q=1;
for i=1:(1-overLap)*boxWidth:512-(overLap)*boxWidth
for j=1:(1-overLap)*boxWidth:512-(overLap)*boxHeight
x=i+(boxWidth*0);
y=j+(boxWidth*0);
u=X(p,q);
v=Y(p,q);
%return row and col of max value
function [row,col] = maxOfMatrix(X)
[row,col] = find(X == max(X(:)));
end
%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;
function [X,Y] = main(boxWidth,boxHeight,overLap)
global img1;
global img2;
img1=imread('image1.tif');
img2=imread('image2.tif');
[X,Y]=velocityField(img1,img2,boxWidth,boxHeight,overLap);
end
import mechanize
import itertools
br = mechanize.Browser()
br.set_handle_equiv(True)
br.set_handle_redirect(True)
br.set_handle_referer(True)
br.set_handle_robots(False)