function centroiddata=centroidcompare(A,B,M,N) %compares the Mth image in 3D image matrix A to Nth in B H=A(:,:,M); I=B(:,:,N); cd /opt/EDTpdv/hartmann/src/ cent0=centroid_image(H); centroiddata=centroid_image(I,cent0); cd /opt/EDTpdv/JKmatlab v=centroiddata.reference_centroids; dv=centroiddata.displacement_of_centroids; x=v(:,1); y=v(:,2); dx=dv(:,1); dy=dv(:,2); figure quiver(x,y,dx,dy,0) set(gca,'DataAspectRatio',[1 1 1],'XLim',[1 1024],'YLim',[1 1024]) title('Displacement Vectors of Centroids between Images') xlabel('X Coordinate') ylabel('Y Coordinate') figure quiver(x,y,dx,dy) set(gca,'DataAspectRatio',[1 1 1],'XLim',[1 1024],'YLim',[1 1024]) title('Displacement Direction of Centroids between Images') xlabel('X Coordinate') ylabel('Y Coordinate')