function ShowPdistandMovieFrames(imagearray,pixellocation_ijt,window_sigma,P_dist,Vx,Vy) % circles show the 1 and 2 sigma window widths clf; subplot(1,2,1); circlex = window_sigma*cos(0:2*pi/64:2*pi)+pixellocation_ijt(1); circley = window_sigma*sin(0:2*pi/64:2*pi)+pixellocation_ijt(2); imagesc(imagearray(:,:,pixellocation_ijt(3))); colormap(gray(256)); hold on; plot(circlex,circley,'r-'); circlex = 2*window_sigma*cos(0:2*pi/64:2*pi)+pixellocation_ijt(1); circley = 2*window_sigma*sin(0:2*pi/64:2*pi)+pixellocation_ijt(2); plot(circlex,circley,'r:'); hold off; subplot(1,2,2); image(Vx(1,:),Vy(:,1),P_dist/max(P_dist(:))*256); colormap(gray(256)); bestj = find(P_dist==max(P_dist(:))); bestvx = Vx(bestj); bestvy = Vy(bestj); hold on; plot([min(Vx(:)) max(Vx(:))],[0 0],'y:'); plot([0 0],[min(Vy(:)) max(Vy(:))],'y:'); plot([0 bestvx],[0 bestvy],'r-','LineWidth',2); plot([bestvx],[bestvy],'rx','LineWidth',2); hold off; xlabel('Vx'); ylabel('Vy');