##?GNU Octave, version 4.4.1 ##Copyright (C) 2018 John W. Eaton and others. ##This is free software; see the source code for copying conditions. ##There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or ##FITNESS FOR A PARTICULAR PURPOSE. For details, type 'warranty'. ## ##Octave was configured for "x86_64-w64-mingw32". ## ##Additional information about Octave is available at https://www.octave.org. ## ##Please contribute if you find this software useful. ##For more information, visit https://www.octave.org/get-involved.html ## ##Read https://www.octave.org/bugs.html to learn how to submit bug reports. ##For information about changes from previous versions, type 'news'. %Detect peak - Autocorrelation - Initial image A=max(max(abs('Reconstructed image - abs(Recon_POF)),abs(Recon_MF)),abs(Recon_NLR)'))); [x,y]=find(abs('Reconstructed image - abs(Recon_POF)),abs(Recon_MF)),abs(Recon_NLR)')==A);% Finds the x and y pixel values of the peaks %Detect peak - Cross-correlation - Initial image and final image A1=max(max(abs(' Reconstructed image - abs(Recon_POF)),abs(Recon_MF)),abs(Recon_NLR)'))); [x1,y1]=find(abs('Reconstructed image - abs(Recon_POF)),abs(Recon_MF)),abs(Recon_NLR)')==A1);% Finds the x and y pixel values of the peaks %Calculate Angle L=70000; %Distance between mirror and image sensor in micrometers pixel=4.65; %Pixelsize of image sensor in micrometers Theta_x=atan(((x1-x)*pixel)/L); %Calculate thetax Beta_x=Theta_x/2; Theta_y=atan(((y1-y)*pixel)/L); %Calculate thetax Beta_y=Theta_y/2; Beta_x Beta_y