mpiv.m is the main routine of mpiv. mpiv.m is an external function (.m file) in MATLAB with its format as following:
function [xi,yi,iu,iv]=mpiv( im1, im2, nx_window, ny_window, ...
overlap_x, overlap_y, ...
iu_max, iv_max, dt, ...
piv_type, i_recur, i_plot).
The input augments of mpiv.m are:
im1 and im2 : input images (double precision)
{nx,ny}_window : processing window sizes in x and y,
-> 16, 32, or 64 are recommended (unit: pixel)
64 is good to start with in recursive PIV.
overlap_{x,y} : fraction of overlapping windows in x and y
-> range [0.0 to 0.9] (no overlap to 90% overlap)
0.0 or 0.5 is typically used.
{iu,iv}_max : maximum allowed velocities in x and y (in pixel)
If entering 0, they become 1/3 of the window size
-> these two parameter also provide the search area
if `mqd' is chosen
(A large value will increased CPU time dramatically).
dt : time separation between im1 and im2 (unit: second)
use `1' to give output in pixel
piv_type : = `cor': cross-correlation algorithm
= `mqd': MQD algorithm
i_recur : number of recurrence to enhance vector resolution/accuracy
= 0 -> no recurrence
= 1 -> one recurrence with the same window size
= 2 -> reduce window size by one half
each increment (after 1) reduces the window size by one half
i_plot : = 1 -> plot the calculated results
otherwise -> no plot
The output from mpiv.m is as follows:
xi, yi : location of vectors in x and y (in pixel) iu, iv : output velocity vectors in x and y (in pixel if dt = 1.0)Please mind the arrangement/orientation of the output arrays and matrices in the programs. It normally requires matrix transpose for plotting.