vec = 1:214;
ARP = 0.9;
dim = size(orig);
borderSize = ceil((1-ARP)/2*dim([1 2]));
inRows = borderSize(1):dim(1)-borderSize(1);
inCols = borderSize(2):dim(2)-borderSize(2);

corrPlotOr = corrToFirst(orig(inRows,inCols,vec));
corrPlotUn = corrToFirst(unwarped(inRows,inCols,vec));
plot(vec,corrPlotOr, vec, corrPlotUn)
xlabel('frame #')
ylabel('correlation coefficient')
legend('Original', 'Stabilized','Location','SouthEast')