final version committed
117
3DFrImager.prj
Normal file
@@ -0,0 +1,117 @@
|
||||
<deployment-project plugin="plugin.apptool" plugin-version="1.0">
|
||||
<configuration build-checksum="3976538666" file="C:\Users\Biki\Desktop\New folder (5)\3DFrImager.prj" location="C:\Users\Biki\Desktop\New folder (5)" name="3DFrImager" target="target.mlapps" target-name="Package App">
|
||||
<param.appname>3DFrImager</param.appname>
|
||||
<param.authnamewatermark>Biswajit Medhi</param.authnamewatermark>
|
||||
<param.email>biswajit.jun@gmail.com</param.email>
|
||||
<param.company>ShanMukha Innovations Pvt. Ltd.</param.company>
|
||||
<param.icon>${PROJECT_ROOT}\3DFrImager_resources\icon_24.png</param.icon>
|
||||
<param.icons>
|
||||
<file>${PROJECT_ROOT}\3DFrImager_resources\icon_48.png</file>
|
||||
<file>${PROJECT_ROOT}\3DFrImager_resources\icon_24.png</file>
|
||||
<file>${PROJECT_ROOT}\3DFrImager_resources\icon_16.png</file>
|
||||
</param.icons>
|
||||
<param.summary>It performs 3D scanning of an object through Fringe projection technique</param.summary>
|
||||
<param.description>It performs 3D scanning of an object through Fringe projection technique</param.description>
|
||||
<param.screenshot>${PROJECT_ROOT}\src\images\height11.png</param.screenshot>
|
||||
<param.version>2.0</param.version>
|
||||
<param.products.name />
|
||||
<param.products.id />
|
||||
<param.products.version />
|
||||
<param.platforms />
|
||||
<param.output>C:\Users\Biki\Desktop</param.output>
|
||||
<param.guid>732be1db-793e-4845-afa1-364e59ffd2fb</param.guid>
|
||||
<unset>
|
||||
<param.products.name />
|
||||
<param.products.id />
|
||||
<param.products.version />
|
||||
<param.platforms />
|
||||
</unset>
|
||||
<fileset.main>
|
||||
<file>${PROJECT_ROOT}\src\dfp\Scanner_3D_v2.m</file>
|
||||
</fileset.main>
|
||||
<fileset.depfun>
|
||||
<file>C:\Users\Biki\Documents\MATLAB\Add-Ons\Apps\x3DFrImager\code\Desktop\New folder (5)\Doc\Help_3DFrImager.pdf</file>
|
||||
<file>C:\Users\Biki\Documents\MATLAB\Add-Ons\Apps\x3DFrImager\code\Desktop\New folder (5)\src\dfp\dis_peak.m</file>
|
||||
<file>C:\Users\Biki\Documents\MATLAB\Add-Ons\Apps\x3DFrImager\code\Desktop\New folder (5)\src\dfp\GetComPort.m</file>
|
||||
<file>C:\Users\Biki\Documents\MATLAB\Add-Ons\Apps\x3DFrImager\code\Desktop\New folder (5)\src\dfp\gui_ask_cal_KNOWN_Point.m</file>
|
||||
<file>C:\Users\Biki\Documents\MATLAB\Add-Ons\Apps\x3DFrImager\code\Desktop\New folder (5)\src\dfp\gui_calibration_1.m</file>
|
||||
<file>C:\Users\Biki\Documents\MATLAB\Add-Ons\Apps\x3DFrImager\code\Desktop\New folder (5)\src\dfp\gui_CompleteCalib_Msg.m</file>
|
||||
<file>C:\Users\Biki\Documents\MATLAB\Add-Ons\Apps\x3DFrImager\code\Desktop\New folder (5)\src\dfp\gui_confirm_EXIT.m</file>
|
||||
<file>C:\Users\Biki\Documents\MATLAB\Add-Ons\Apps\x3DFrImager\code\Desktop\New folder (5)\src\dfp\gui_set_destination.m</file>
|
||||
<file>C:\Users\Biki\Documents\MATLAB\Add-Ons\Apps\x3DFrImager\code\Desktop\New folder (5)\src\dfp\gui_StartProfiling.m</file>
|
||||
<file>C:\Users\Biki\Documents\MATLAB\Add-Ons\Apps\x3DFrImager\code\Desktop\New folder (5)\src\dfp\gui_WantCalibration.m</file>
|
||||
<file>C:\Users\Biki\Documents\MATLAB\Add-Ons\Apps\x3DFrImager\code\Desktop\New folder (5)\src\dfp\phase_unwrap.m</file>
|
||||
<file>C:\Users\Biki\Documents\MATLAB\Add-Ons\Apps\x3DFrImager\code\Desktop\New folder (5)\src\dfp\processImage1.m</file>
|
||||
<file>C:\Users\Biki\Documents\MATLAB\Add-Ons\Apps\x3DFrImager\code\Desktop\New folder (5)\src\dfp\processImage2.m</file>
|
||||
<file>C:\Users\Biki\Documents\MATLAB\Add-Ons\Apps\x3DFrImager\code\Desktop\New folder (5)\src\dfp\WFT2.m</file>
|
||||
<file>C:\Users\Biki\Documents\MATLAB\Add-Ons\Apps\x3DFrImager\code\Desktop\New folder (5)\src\images\iisc_logo.png</file>
|
||||
<file>C:\Users\Biki\Documents\MATLAB\Add-Ons\Apps\x3DFrImager\code\Desktop\New folder (5)\src\images\im0.tif</file>
|
||||
<file>C:\Users\Biki\Documents\MATLAB\Add-Ons\Apps\x3DFrImager\code\Desktop\New folder (5)\src\images\im00.tif</file>
|
||||
<file>C:\Users\Biki\Documents\MATLAB\Add-Ons\Apps\x3DFrImager\code\Desktop\New folder (5)\src\images\p1.png</file>
|
||||
<file>C:\Users\Biki\Documents\MATLAB\Add-Ons\Apps\x3DFrImager\code\Desktop\New folder (5)\src\images\Shan_Logo4.png</file>
|
||||
<file>C:\Users\Biki\Documents\MATLAB\Add-Ons\Apps\x3DFrImager\code\Desktop\New folder (5)\src\txt\calibration.txt</file>
|
||||
<file>C:\Users\Biki\Documents\MATLAB\Add-Ons\Apps\x3DFrImager\code\Desktop\New folder (5)\src\txt\camset.txt</file>
|
||||
<file>C:\Users\Biki\Documents\MATLAB\Add-Ons\Apps\x3DFrImager\code\Desktop\New folder (5)\src\txt\CropCordinate.txt</file>
|
||||
<file>C:\Users\Biki\Documents\MATLAB\Add-Ons\Apps\x3DFrImager\code\Desktop\New folder (5)\src\txt\selectCamera.txt</file>
|
||||
<file>C:\Users\Biki\Documents\MATLAB\Add-Ons\Apps\x3DFrImager\code\Desktop\New folder (5)\src\txt\SessionConst.txt</file>
|
||||
</fileset.depfun>
|
||||
<fileset.resources>
|
||||
<file>${PROJECT_ROOT}\3DFrImager_resources</file>
|
||||
<file>${PROJECT_ROOT}\Doc</file>
|
||||
<file>${PROJECT_ROOT}\src</file>
|
||||
<file>${PROJECT_ROOT}\src\dfp</file>
|
||||
<file>${PROJECT_ROOT}\src\images</file>
|
||||
<file>${PROJECT_ROOT}\src\txt</file>
|
||||
<file>${PROJECT_ROOT}\src\ui</file>
|
||||
</fileset.resources>
|
||||
<fileset.package />
|
||||
<build-deliverables>
|
||||
<file location="C:\Users\Biki" name="Desktop" optional="false">C:\Users\Biki\Desktop</file>
|
||||
</build-deliverables>
|
||||
<workflow />
|
||||
<matlab>
|
||||
<root>C:\Program Files\MATLAB\R2016b</root>
|
||||
<toolboxes>
|
||||
<toolbox name="fixedpoint" />
|
||||
<toolbox name="matlabcoder" />
|
||||
<toolbox name="matlabhdlcoder" />
|
||||
<toolbox name="embeddedcoder" />
|
||||
</toolboxes>
|
||||
<toolbox>
|
||||
<fixedpoint>
|
||||
<enabled>true</enabled>
|
||||
</fixedpoint>
|
||||
</toolbox>
|
||||
<toolbox>
|
||||
<matlabcoder>
|
||||
<enabled>true</enabled>
|
||||
</matlabcoder>
|
||||
</toolbox>
|
||||
<toolbox>
|
||||
<matlabhdlcoder>
|
||||
<enabled>true</enabled>
|
||||
</matlabhdlcoder>
|
||||
</toolbox>
|
||||
<toolbox>
|
||||
<embeddedcoder>
|
||||
<enabled>true</enabled>
|
||||
</embeddedcoder>
|
||||
</toolbox>
|
||||
</matlab>
|
||||
<platform>
|
||||
<unix>false</unix>
|
||||
<mac>false</mac>
|
||||
<windows>true</windows>
|
||||
<win2k>false</win2k>
|
||||
<winxp>false</winxp>
|
||||
<vista>false</vista>
|
||||
<linux>false</linux>
|
||||
<solaris>false</solaris>
|
||||
<osver>6.1</osver>
|
||||
<os32>false</os32>
|
||||
<os64>true</os64>
|
||||
<arch>win64</arch>
|
||||
<matlab>true</matlab>
|
||||
</platform>
|
||||
</configuration>
|
||||
</deployment-project>
|
||||
119
Cal_3dFrImager.prj
Normal file
@@ -0,0 +1,119 @@
|
||||
<deployment-project plugin="plugin.apptool" plugin-version="1.0">
|
||||
<configuration build-checksum="2014592435" file="C:\Users\Biki\Desktop\New folder (5)\Cal_3dFrImager.prj" location="C:\Users\Biki\Desktop\New folder (5)" name="Cal_3dFrImager" target="target.mlapps" target-name="Package App">
|
||||
<param.appname>Cal_3dFrImager</param.appname>
|
||||
<param.authnamewatermark>Biswajit Medhi</param.authnamewatermark>
|
||||
<param.email>biswajit.jun@gmail.com</param.email>
|
||||
<param.company>ShanMukha Innovations Pvt. Ltd.</param.company>
|
||||
<param.icon>${PROJECT_ROOT}\Cal_3dFrImager_resources\icon_24.png</param.icon>
|
||||
<param.icons>
|
||||
<file>${PROJECT_ROOT}\Cal_3dFrImager_resources\icon_48.png</file>
|
||||
<file>${PROJECT_ROOT}\Cal_3dFrImager_resources\icon_24.png</file>
|
||||
<file>${PROJECT_ROOT}\Cal_3dFrImager_resources\icon_16.png</file>
|
||||
</param.icons>
|
||||
<param.summary>It performs 3D scanning of an object through Fringe projection technique</param.summary>
|
||||
<param.description>It performs 3D scanning of an object through Fringe projection technique</param.description>
|
||||
<param.screenshot>${PROJECT_ROOT}\src\images\CalibrationIcon.png</param.screenshot>
|
||||
<param.version>1.0</param.version>
|
||||
<param.products.name />
|
||||
<param.products.id />
|
||||
<param.products.version />
|
||||
<param.platforms />
|
||||
<param.output>C:\Users\Biki\Desktop\outPut App</param.output>
|
||||
<param.guid>0509b206-b2cf-43a9-956f-9ae7c5132345</param.guid>
|
||||
<unset>
|
||||
<param.version />
|
||||
<param.products.name />
|
||||
<param.products.id />
|
||||
<param.products.version />
|
||||
<param.platforms />
|
||||
</unset>
|
||||
<fileset.main>
|
||||
<file>${PROJECT_ROOT}\src\dfp\Calibration_Scanner_3D_v2.m</file>
|
||||
</fileset.main>
|
||||
<fileset.depfun>
|
||||
<file>C:\Users\Biki\Documents\MATLAB\Add-Ons\Apps\x3DFrImager\code\Desktop\New folder (5)\Doc\Help_3DFrImager.pdf</file>
|
||||
<file>C:\Users\Biki\Documents\MATLAB\Add-Ons\Apps\x3DFrImager\code\Desktop\New folder (5)\src\dfp\dis_peak.m</file>
|
||||
<file>C:\Users\Biki\Documents\MATLAB\Add-Ons\Apps\x3DFrImager\code\Desktop\New folder (5)\src\dfp\GetComPort.m</file>
|
||||
<file>C:\Users\Biki\Documents\MATLAB\Add-Ons\Apps\x3DFrImager\code\Desktop\New folder (5)\src\dfp\gui_ask_cal_KNOWN_Point.m</file>
|
||||
<file>C:\Users\Biki\Documents\MATLAB\Add-Ons\Apps\x3DFrImager\code\Desktop\New folder (5)\src\dfp\gui_calibration_1.m</file>
|
||||
<file>C:\Users\Biki\Documents\MATLAB\Add-Ons\Apps\x3DFrImager\code\Desktop\New folder (5)\src\dfp\gui_CompleteCalib_Msg.m</file>
|
||||
<file>C:\Users\Biki\Documents\MATLAB\Add-Ons\Apps\x3DFrImager\code\Desktop\New folder (5)\src\dfp\gui_confirm_EXIT.m</file>
|
||||
<file>C:\Users\Biki\Documents\MATLAB\Add-Ons\Apps\x3DFrImager\code\Desktop\New folder (5)\src\dfp\gui_set_destination.m</file>
|
||||
<file>C:\Users\Biki\Documents\MATLAB\Add-Ons\Apps\x3DFrImager\code\Desktop\New folder (5)\src\dfp\gui_StartProfiling.m</file>
|
||||
<file>C:\Users\Biki\Documents\MATLAB\Add-Ons\Apps\x3DFrImager\code\Desktop\New folder (5)\src\dfp\gui_WantCalibration.m</file>
|
||||
<file>C:\Users\Biki\Documents\MATLAB\Add-Ons\Apps\x3DFrImager\code\Desktop\New folder (5)\src\dfp\phase_unwrap.m</file>
|
||||
<file>C:\Users\Biki\Documents\MATLAB\Add-Ons\Apps\x3DFrImager\code\Desktop\New folder (5)\src\dfp\processImage1.m</file>
|
||||
<file>C:\Users\Biki\Documents\MATLAB\Add-Ons\Apps\x3DFrImager\code\Desktop\New folder (5)\src\dfp\processImage2.m</file>
|
||||
<file>C:\Users\Biki\Documents\MATLAB\Add-Ons\Apps\x3DFrImager\code\Desktop\New folder (5)\src\dfp\WFT2.m</file>
|
||||
<file>C:\Users\Biki\Documents\MATLAB\Add-Ons\Apps\x3DFrImager\code\Desktop\New folder (5)\src\images\iisc_logo.png</file>
|
||||
<file>C:\Users\Biki\Documents\MATLAB\Add-Ons\Apps\x3DFrImager\code\Desktop\New folder (5)\src\images\im0.tif</file>
|
||||
<file>C:\Users\Biki\Documents\MATLAB\Add-Ons\Apps\x3DFrImager\code\Desktop\New folder (5)\src\images\im00.tif</file>
|
||||
<file>C:\Users\Biki\Documents\MATLAB\Add-Ons\Apps\x3DFrImager\code\Desktop\New folder (5)\src\images\p1.png</file>
|
||||
<file>C:\Users\Biki\Documents\MATLAB\Add-Ons\Apps\x3DFrImager\code\Desktop\New folder (5)\src\images\Shan_Logo4.png</file>
|
||||
<file>C:\Users\Biki\Documents\MATLAB\Add-Ons\Apps\x3DFrImager\code\Desktop\New folder (5)\src\txt\calibration.txt</file>
|
||||
<file>C:\Users\Biki\Documents\MATLAB\Add-Ons\Apps\x3DFrImager\code\Desktop\New folder (5)\src\txt\CaliObject.txt</file>
|
||||
<file>C:\Users\Biki\Documents\MATLAB\Add-Ons\Apps\x3DFrImager\code\Desktop\New folder (5)\src\txt\camset.txt</file>
|
||||
<file>C:\Users\Biki\Documents\MATLAB\Add-Ons\Apps\x3DFrImager\code\Desktop\New folder (5)\src\txt\CropCordinate.txt</file>
|
||||
<file>C:\Users\Biki\Documents\MATLAB\Add-Ons\Apps\x3DFrImager\code\Desktop\New folder (5)\src\txt\selectCamera.txt</file>
|
||||
<file>C:\Users\Biki\Documents\MATLAB\Add-Ons\Apps\x3DFrImager\code\Desktop\New folder (5)\src\txt\SessionConst.txt</file>
|
||||
</fileset.depfun>
|
||||
<fileset.resources>
|
||||
<file>${PROJECT_ROOT}\Cal_3dFrImager_resources</file>
|
||||
<file>${PROJECT_ROOT}\Doc</file>
|
||||
<file>${PROJECT_ROOT}\src</file>
|
||||
<file>${PROJECT_ROOT}\src\dfp</file>
|
||||
<file>${PROJECT_ROOT}\src\images</file>
|
||||
<file>${PROJECT_ROOT}\src\txt</file>
|
||||
<file>${PROJECT_ROOT}\src\ui</file>
|
||||
</fileset.resources>
|
||||
<fileset.package />
|
||||
<build-deliverables>
|
||||
<file location="C:\Users\Biki\Desktop" name="outPut App" optional="false">C:\Users\Biki\Desktop\outPut App</file>
|
||||
</build-deliverables>
|
||||
<workflow />
|
||||
<matlab>
|
||||
<root>C:\Program Files\MATLAB\R2016b</root>
|
||||
<toolboxes>
|
||||
<toolbox name="fixedpoint" />
|
||||
<toolbox name="matlabcoder" />
|
||||
<toolbox name="matlabhdlcoder" />
|
||||
<toolbox name="embeddedcoder" />
|
||||
</toolboxes>
|
||||
<toolbox>
|
||||
<fixedpoint>
|
||||
<enabled>true</enabled>
|
||||
</fixedpoint>
|
||||
</toolbox>
|
||||
<toolbox>
|
||||
<matlabcoder>
|
||||
<enabled>true</enabled>
|
||||
</matlabcoder>
|
||||
</toolbox>
|
||||
<toolbox>
|
||||
<matlabhdlcoder>
|
||||
<enabled>true</enabled>
|
||||
</matlabhdlcoder>
|
||||
</toolbox>
|
||||
<toolbox>
|
||||
<embeddedcoder>
|
||||
<enabled>true</enabled>
|
||||
</embeddedcoder>
|
||||
</toolbox>
|
||||
</matlab>
|
||||
<platform>
|
||||
<unix>false</unix>
|
||||
<mac>false</mac>
|
||||
<windows>true</windows>
|
||||
<win2k>false</win2k>
|
||||
<winxp>false</winxp>
|
||||
<vista>false</vista>
|
||||
<linux>false</linux>
|
||||
<solaris>false</solaris>
|
||||
<osver>6.1</osver>
|
||||
<os32>false</os32>
|
||||
<os64>true</os64>
|
||||
<arch>win64</arch>
|
||||
<matlab>true</matlab>
|
||||
</platform>
|
||||
</configuration>
|
||||
</deployment-project>
|
||||
BIN
Cal_3dFrImager_resources/icon_16.png
Normal file
|
After Width: | Height: | Size: 735 B |
BIN
Cal_3dFrImager_resources/icon_24.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
Cal_3dFrImager_resources/icon_48.png
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
Doc/Help_3DFrImager.pdf
Normal file
BIN
app/3DFrImager.mlappinstall
Normal file
BIN
app/Cal_3dFrImager.mlappinstall
Normal file
698
src/dfp/Calibration_Scanner_3D_v2.m
Normal file
@@ -0,0 +1,698 @@
|
||||
function varargout = Calibration_Scanner_3D_v2(varargin)
|
||||
% CALIBRATION_SCANNER_3D_V2 MATLAB code for Calibration_Scanner_3D_v2.fig
|
||||
% CALIBRATION_SCANNER_3D_V2, by itself, creates a new CALIBRATION_SCANNER_3D_V2 or raises the existing
|
||||
% singleton*.
|
||||
%
|
||||
% H = CALIBRA5TION_SCANNER_3D_V2 returns the handle to a new CALIBRATION_SCANNER_3D_V2 or the handle to
|
||||
% the existing singleton*.
|
||||
%
|
||||
% CALIBRATION_SCANNER_3D_V2('CALLBACK',hObject,eventData,handles,...) calls the local
|
||||
% function named CALLBACK in CALIBRATION_SCANNER_3D_V2.M with the given input arguments.
|
||||
%
|
||||
% CALIBRATION_SCANNER_3D_V2('Property','Value',...) creates a new CALIBRATION_SCANNER_3D_V2 or raises the
|
||||
% existing singleton*. Starting from the left, property value pairs are
|
||||
% applied to the GUI before Calibration_Scanner_3D_v2_OpeningFcn gets called. An
|
||||
% unrecognized property name or invalid value makes property application
|
||||
% stop. All inputs are passed to Calibration_Scanner_3D_v2_OpeningFcn via varargin.
|
||||
%
|
||||
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
|
||||
% instance to run (singleton)".
|
||||
%
|
||||
% See also: GUIDE, GUIDATA, GUIHANDLES
|
||||
|
||||
% Edit the above text to modify the response to help Calibration_Scanner_3D_v2
|
||||
|
||||
% Last Modified by GUIDE v2.5 03-Jan-2019 18:45:47
|
||||
|
||||
% Begin initialization code - DO NOT EDIT
|
||||
gui_Singleton = 1;
|
||||
gui_State = struct('gui_Name', mfilename, ...
|
||||
'gui_Singleton', gui_Singleton, ...
|
||||
'gui_OpeningFcn', @Calibration_Scanner_3D_v2_OpeningFcn, ...
|
||||
'gui_OutputFcn', @Calibration_Scanner_3D_v2_OutputFcn, ...
|
||||
'gui_LayoutFcn', [] , ...
|
||||
'gui_Callback', []);
|
||||
if nargin && ischar(varargin{1})
|
||||
gui_State.gui_Callback = str2func(varargin{1});
|
||||
end
|
||||
|
||||
if nargout
|
||||
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
|
||||
else
|
||||
gui_mainfcn(gui_State, varargin{:});
|
||||
end
|
||||
% End initialization code - DO NOT EDIT
|
||||
|
||||
|
||||
% --- Executes just before Calibration_Scanner_3D_v2 is made visible.
|
||||
function Calibration_Scanner_3D_v2_OpeningFcn(hObject, eventdata, handles, varargin)
|
||||
% This function has no output args, see OutputFcn.
|
||||
% hObject handle to figure
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles structure with handles and user data (see GUIDATA)
|
||||
% varargin command line arguments to Calibration_Scanner_3D_v2 (see VARARGIN)
|
||||
|
||||
% Choose default command line output for Calibration_Scanner_3D_v2
|
||||
handles.output = hObject;
|
||||
|
||||
axes(handles.axes3);cla;imshow(imread('Shan_Logo4.png'),[]);
|
||||
axes(handles.axes4);cla;imshow(imread('iisc_logo.png'),[]);
|
||||
axes(handles.axes1);cla;imshow(imread('p1.png'),[]);
|
||||
|
||||
% set(handles.check_EnableCali, 'Value',0);
|
||||
% % set(handles.push_calibrate, 'Enable','off');
|
||||
% % set(handles.check_Laser, 'Enable','off');
|
||||
% % set(handles.check_Projector, 'Enable','off');
|
||||
% % set(handles.check_CabinLamp, 'Enable','off');
|
||||
% % set(handles.check_CabinLamp, 'Value',1);
|
||||
% % set(handles.check_Projector, 'Enable','off');
|
||||
% % set(handles.push_SaveExit, 'Enable','off');
|
||||
|
||||
seting_buttons_state(hObject, eventdata, handles,0)
|
||||
set(handles.push_SaveExit, 'Enable','off');
|
||||
set(handles.check_CabinLamp, 'Value',1);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
tic
|
||||
|
||||
wbar = waitbar(0.1,'Connecting Hardware...');
|
||||
|
||||
imaqreset;
|
||||
aa=imaqhwinfo('winvideo');
|
||||
size(aa.DeviceInfo)
|
||||
cnt= size(aa.DeviceInfo,2);
|
||||
a=aa.DeviceInfo;
|
||||
% a=webcamlist;
|
||||
|
||||
waitbar(0.3,wbar);
|
||||
|
||||
|
||||
|
||||
|
||||
if cnt~=0
|
||||
s1=cell((cnt+1),1);
|
||||
s1(1)={'Select'};
|
||||
cnt2=0;
|
||||
for ii=1:cnt
|
||||
if strcmp(a(ii).DeviceName, 'USB Camera')
|
||||
a(ii).DeviceName={'3dFrImager'};
|
||||
s1(ii+1)={'3dFrImager'}
|
||||
cnt2=1;
|
||||
else
|
||||
a(ii).DeviceName={(a(ii).DeviceName)};
|
||||
s1(ii+1)=(a(ii).DeviceName)
|
||||
end
|
||||
end
|
||||
|
||||
set(handles.popup_cameraSelect,'String',s1);
|
||||
else
|
||||
f=errordlg('Camera is Not found','Camera Error');
|
||||
waitfor(f);
|
||||
seting_buttons_state(hObject, eventdata, handles,0) ;
|
||||
% delete(handles.figure1);
|
||||
end
|
||||
|
||||
|
||||
delete(instrfind);
|
||||
nam = GetComPort;
|
||||
|
||||
LASER = serial(nam ,'BaudRate', 9600);
|
||||
handles.LASERRR=LASER;
|
||||
waitbar(0.6,wbar);
|
||||
|
||||
|
||||
try
|
||||
fopen(LASER);
|
||||
pause(2)
|
||||
fprintf(LASER,'%c','p');
|
||||
pause(1)
|
||||
try close(wbar), catch, end
|
||||
catch
|
||||
try close(wbar), catch, end
|
||||
seting_buttons_state(hObject, eventdata, handles,0)
|
||||
pause(.5)
|
||||
f=errordlg('Hardware not found','Hardware Error');
|
||||
waitfor(f);
|
||||
% delete(handles.figure1);
|
||||
end
|
||||
|
||||
|
||||
|
||||
handles.SelectOption = 'NewAcq'; % 'NewAcq' 'OldAcq'
|
||||
handles.scal=1;
|
||||
|
||||
|
||||
|
||||
|
||||
handles.window=30;
|
||||
|
||||
handles.Contrast = 50;
|
||||
handles.Brightness = 12;
|
||||
handles.ExposureMode = 'manual';
|
||||
handles.Exposure = -4;
|
||||
handles.WhiteBalance = 5710;
|
||||
|
||||
|
||||
handles.NN =5;
|
||||
|
||||
|
||||
|
||||
|
||||
handles.destination_NEW =strcat(pwd,'\Result11');
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
handles.NN =10;
|
||||
|
||||
set(handles.push_SaveExit, 'Enable','on');
|
||||
set(handles.popup_cameraSelect, 'Enable','on');
|
||||
% Update handles structure
|
||||
guidata(hObject, handles);
|
||||
|
||||
% UIWAIT makes Calibration_Scanner_3D_v2 wait for user response (see UIRESUME)
|
||||
% uiwait(handles.figure1);
|
||||
|
||||
|
||||
% --- Outputs from this function are returned to the command line.
|
||||
function varargout = Calibration_Scanner_3D_v2_OutputFcn(hObject, eventdata, handles)
|
||||
% varargout cell array for returning output args (see VARARGOUT);
|
||||
% hObject handle to figure
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles structure with handles and user data (see GUIDATA)
|
||||
|
||||
% Get default command line output from handles structure
|
||||
varargout{1} = handles.output;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
% --- Executes on selection change in popup_cameraSelect.
|
||||
function popup_cameraSelect_Callback(hObject, eventdata, handles)
|
||||
% hObject handle to popup_cameraSelect (see GCBO)
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles structure with handles and user data (see GUIDATA)
|
||||
|
||||
% Hints: contents = cellstr(get(hObject,'String')) returns popup_cameraSelect contents as cell array
|
||||
% contents{get(hObject,'Value')} returns selected item from popup_cameraSelect
|
||||
contents = cellstr(get(hObject,'String'));
|
||||
val = contents{get(hObject,'Value')} ;
|
||||
seting_buttons_state(hObject, eventdata, handles,0);
|
||||
set(handles.push_SaveExit, 'Enable','off');
|
||||
|
||||
wbar = waitbar(0.1,'Connecting Camera...');
|
||||
wbar .CloseRequestFcn = '';
|
||||
|
||||
filePh = fopen('selectCamera.txt','w');
|
||||
fprintf(filePh,'%s\n',val);
|
||||
fclose(filePh);
|
||||
|
||||
waitbar(0.3,wbar);
|
||||
|
||||
|
||||
if strcmp(val, '3dFrImager')
|
||||
val='USB Camera';
|
||||
|
||||
try
|
||||
obj = videoinput('winvideo', val, 'YUY2_3264x2448');
|
||||
handles.obj =obj;
|
||||
end
|
||||
|
||||
hsrc = getselectedsource(obj);
|
||||
obj.FramesPerTrigger = 1;
|
||||
hsrc.Contrast = handles.Contrast ;
|
||||
hsrc.Brightness = handles.Brightness ;
|
||||
hsrc.ExposureMode = handles.ExposureMode ;
|
||||
hsrc.Exposure = handles.Exposure ;
|
||||
hsrc.WhiteBalance = handles.WhiteBalance;
|
||||
|
||||
|
||||
|
||||
|
||||
vidRes = get(obj, 'VideoResolution');
|
||||
nBands = get(obj, 'NumberOfBands');
|
||||
axes(handles.axes1);cla;
|
||||
hImage = image( zeros(vidRes(2), vidRes(1), nBands) );
|
||||
preview(obj, hImage); axis equal;
|
||||
handles.hImage=hImage;
|
||||
seting_buttons_state(hObject, eventdata, handles,1)
|
||||
set(handles.push_SaveExit, 'Enable','on');
|
||||
|
||||
waitbar(0.8,wbar);
|
||||
pause(1)
|
||||
try delete(wbar), catch, end
|
||||
else
|
||||
try delete(wbar), catch, end
|
||||
pause(.5)
|
||||
f=errordlg('Select "3dFrImager" from Camera List','Select Camera');
|
||||
waitfor(f);
|
||||
seting_buttons_state(hObject, eventdata, handles,0)
|
||||
set(handles.popup_cameraSelect, 'Enable','on');
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
guidata(hObject, handles);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
% --- Executes during object creation, after setting all properties.
|
||||
function popup_cameraSelect_CreateFcn(hObject, eventdata, handles)
|
||||
% hObject handle to popup_cameraSelect (see GCBO)
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles empty - handles not created until after all CreateFcns called
|
||||
|
||||
% Hint: popupmenu controls usually have a white background on Windows.
|
||||
% See ISPC and COMPUTER.
|
||||
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
|
||||
set(hObject,'BackgroundColor','white');
|
||||
end
|
||||
|
||||
|
||||
% --- Executes on button press in push_calibrate.
|
||||
function push_calibrate_Callback(hObject, eventdata, handles)
|
||||
% hObject handle to push_calibrate (see GCBO)
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles structure with handles and user data (see GUIDATA)
|
||||
|
||||
tmp1=gui_WantCalibration();
|
||||
|
||||
if strcmp(tmp1,'Yes')
|
||||
|
||||
try
|
||||
wbar=waitbar(0.1,'Calibrating System...','windowstyle', 'modal');
|
||||
frames = java.awt.Frame.getFrames();
|
||||
frames(end).setAlwaysOnTop(1);
|
||||
wbar .CloseRequestFcn = '';
|
||||
catch
|
||||
wbar = waitbar(0.1,'Calibrating System...');
|
||||
wbar .CloseRequestFcn = '';
|
||||
end
|
||||
|
||||
if strcmp(handles.SelectOption, 'NewAcq') % 'NewAcq' 'OldAcq'
|
||||
|
||||
set(handles.check_Laser, 'Value',0);
|
||||
try
|
||||
|
||||
fprintf(handles.LASERRR,'%c','o');
|
||||
fprintf(handles.LASERRR,'%c','b');
|
||||
fprintf(handles.LASERRR,'%c','y');
|
||||
pause(1)
|
||||
seting_buttons_state(hObject, eventdata, handles,0) ;
|
||||
set(handles.push_SaveExit, 'Enable','off');
|
||||
catch
|
||||
f=errordlg('Connection Problem','Hardware Error');
|
||||
waitfor(f);
|
||||
seting_buttons_state(hObject, eventdata, handles,0)
|
||||
end
|
||||
|
||||
|
||||
waitbar(0.3,wbar);
|
||||
|
||||
|
||||
|
||||
|
||||
obj= handles.obj;
|
||||
hsrc = getselectedsource(obj );
|
||||
obj.FramesPerTrigger = 1;
|
||||
obj.ROIPosition = [0 ,0 3264,2448];
|
||||
|
||||
hsrc.Contrast = handles.Contrast ;
|
||||
hsrc.Brightness = handles.Brightness ;
|
||||
hsrc.ExposureMode = handles.ExposureMode ;
|
||||
hsrc.Exposure = handles.Exposure ;
|
||||
hsrc.WhiteBalance = handles.WhiteBalance;
|
||||
|
||||
% pause(2)
|
||||
|
||||
vidRes = get(obj, 'VideoResolution');
|
||||
nBands = get(obj, 'NumberOfBands');
|
||||
axes(handles.axes1);cla;
|
||||
hImage = image( zeros(vidRes(2), vidRes(1), nBands) );
|
||||
preview(obj, hImage); axis equal;
|
||||
guidata(hObject, handles);
|
||||
|
||||
% stoppreview(obj);
|
||||
|
||||
waitbar(0.4,wbar);
|
||||
pause(2)
|
||||
|
||||
% Capture Image
|
||||
tmp1=0;
|
||||
|
||||
for jj=1:(1)
|
||||
frame = getsnapshot(obj);
|
||||
tmp= double(ycbcr2rgb(frame));
|
||||
pause(0.5);
|
||||
tmp1 = tmp1+tmp;
|
||||
end
|
||||
tmp1=uint8(tmp1);
|
||||
|
||||
% frame = getsnapshot(obj);
|
||||
handles.im0=tmp1;
|
||||
waitbar(0.6,wbar);
|
||||
imwrite(handles.im0,'im00.tif');
|
||||
% axes(handles.axes1);cla;
|
||||
% hImage = image( zeros(vidRes(2), vidRes(1), nBands) );
|
||||
% preview(obj, hImage); axis equal;
|
||||
|
||||
|
||||
waitbar(0.8,wbar);
|
||||
% pause(2)
|
||||
|
||||
try delete(wbar);catch; end
|
||||
|
||||
|
||||
|
||||
|
||||
[handles.CalStatus, handles.theta, handles.a4, handles.a5, CaliState]...
|
||||
=gui_calibration_1();
|
||||
|
||||
|
||||
if strcmp(handles.CalStatus, 'Done')
|
||||
|
||||
try
|
||||
wbar=waitbar(0.8,'Calibrating System...','windowstyle', 'modal');
|
||||
frames = java.awt.Frame.getFrames();
|
||||
frames(end).setAlwaysOnTop(1);
|
||||
wbar .CloseRequestFcn = '';
|
||||
catch
|
||||
wbar = waitbar(0.8,'Calibrating System...');
|
||||
wbar .CloseRequestFcn = '';
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
yD=dlmread('CropCordinate.txt');
|
||||
|
||||
% stoppreview(obj);
|
||||
|
||||
obj.ROIPosition = yD;
|
||||
hsrc.Contrast = handles.Contrast ;
|
||||
hsrc.Brightness = handles.Brightness ;
|
||||
hsrc.ExposureMode = handles.ExposureMode ;
|
||||
hsrc.Exposure = handles.Exposure ;
|
||||
hsrc.WhiteBalance = handles.WhiteBalance;
|
||||
|
||||
% pause(2)
|
||||
|
||||
vidRes = get(obj, 'VideoResolution');
|
||||
nBands = get(obj, 'NumberOfBands');
|
||||
axes(handles.axes1);cla;
|
||||
hImage = image( zeros(vidRes(2), vidRes(1), nBands) );
|
||||
preview(obj, hImage); axis equal;
|
||||
pause(2)
|
||||
% Capture Image
|
||||
tmp1=0;
|
||||
for jj=1:(handles.NN)
|
||||
frame = getsnapshot(obj);
|
||||
tmp= double(ycbcr2rgb(frame));
|
||||
pause(0.5);
|
||||
tmp1 = tmp1+tmp;
|
||||
end
|
||||
tmp1=uint8(tmp1/(handles.NN));
|
||||
|
||||
|
||||
|
||||
% % tmp1=tmp1( yD(2):yD(2)+yD(4)-1,yD(1):yD(1)+yD(3)-1,:);
|
||||
handles.im0 =tmp1;
|
||||
waitbar(0.88,wbar);
|
||||
imwrite(handles.im0,'im0.tif');
|
||||
|
||||
|
||||
|
||||
axes(handles.axes1);cla;
|
||||
hImage_NEW = image( zeros(size(tmp1,2), size(tmp1,2), nBands) );
|
||||
preview(obj,hImage_NEW ); axis tight,axis equal;
|
||||
|
||||
try delete(wbar), catch, end
|
||||
|
||||
handles.scal = handles.a4/ handles.a5;
|
||||
|
||||
seting_buttons_state(hObject, eventdata, handles,0)
|
||||
|
||||
|
||||
if strcmp(CaliState,'Auto')
|
||||
12345
|
||||
uiwait(msgbox('Place the Calibration Object within FOV','Place Calibration Object','non-modal'));
|
||||
|
||||
|
||||
tmp1=0;
|
||||
for jj=1:(handles.NN)
|
||||
frame = getsnapshot(obj);
|
||||
tmp= double(ycbcr2rgb(frame));
|
||||
pause(0.5);
|
||||
tmp1 = tmp1+tmp;
|
||||
end
|
||||
tmp1=uint8(tmp1/(handles.NN));
|
||||
handles.cal =tmp1;
|
||||
% waitbar(0.88,wbar);
|
||||
imwrite(handles.cal,'calib.tif');
|
||||
|
||||
[data_Org,dataSX]= processImage2(double(rgb2gray(handles.im0)), double(rgb2gray(handles.cal)), 53, 'All Pass');
|
||||
|
||||
figure(199), imshow(data_Org,[]); title('Right Click the MOUSE at the centre of the Obect'),
|
||||
|
||||
|
||||
% % figure(199), imshow(rand(500)); title('Right Click the MOUSE at the centre of the Obect'),
|
||||
while 1
|
||||
[x, y, button]=ginput(1);
|
||||
if button==3
|
||||
x=round(x); y=round(y);
|
||||
break;
|
||||
end
|
||||
end
|
||||
|
||||
mHi= mean(mean(data_Org(x-10:x+10,y-10:y+10)));
|
||||
|
||||
[calHi]=dlmread('CaliObject.txt');
|
||||
[a4a5]=dlmread('SessionConst.txt');
|
||||
theta_new= atan(mHi/calHi *tan(a4a5(1)));
|
||||
a4a5(1)=theta_new;
|
||||
dlmwrite('SessionConst.txt',a4a5);
|
||||
|
||||
sconst=dlmread('calibration.txt');
|
||||
sconst(1)=tan(theta_new)*sconst(2);
|
||||
|
||||
dlmwrite('calibration.txt',sconst);
|
||||
|
||||
|
||||
|
||||
close(199);
|
||||
axes(handles.axes1);cla;imagesc(data_Org);
|
||||
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
gui_CompleteCalib_Msg
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
% % seting_buttons_state(hObject, eventdata, handles,0)
|
||||
set(handles.push_SaveExit, 'Enable','on');
|
||||
|
||||
guidata(hObject, handles);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
% --- Executes on button press in check_Laser.
|
||||
function check_Laser_Callback(hObject, eventdata, handles)
|
||||
% hObject handle to check_Laser (see GCBO)
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles structure with handles and user data (see GUIDATA)
|
||||
|
||||
% Hint: get(hObject,'Value') returns toggle state of check_Laser
|
||||
c = get(hObject,'Value') ;
|
||||
|
||||
if c==1
|
||||
try
|
||||
fprintf(handles.LASERRR,'%c','z');
|
||||
pause(1)
|
||||
catch
|
||||
f=errordlg('Connection Problem','Hardware Error');
|
||||
waitfor(f);
|
||||
seting_buttons_state(hObject, eventdata, handles,0)
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
if c==0
|
||||
try
|
||||
|
||||
% fprintf(LASER,'%c','a');
|
||||
pause(1)
|
||||
fprintf(handles.LASERRR,'%c','y');
|
||||
pause(1)
|
||||
catch
|
||||
f=errordlg('Connection Problem','Hardware Error');
|
||||
waitfor(f);
|
||||
seting_buttons_state(hObject, eventdata, handles,0)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
% --- Executes on button press in check_Projector.
|
||||
function check_Projector_Callback(hObject, eventdata, handles)
|
||||
% hObject handle to check_Projector (see GCBO)
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles structure with handles and user data (see GUIDATA)
|
||||
|
||||
% Hint: get(hObject,'Value') returns toggle state of check_Projector
|
||||
c = get(hObject,'Value') ;
|
||||
|
||||
if c==1
|
||||
try
|
||||
pause(.2)
|
||||
% fprintf(LASER,'%c','b');
|
||||
fprintf(handles.LASERRR,'%c','b');
|
||||
pause(1)
|
||||
catch
|
||||
f=errordlg('Connection Problem','Hardware Error');
|
||||
waitfor(f);
|
||||
seting_buttons_state(hObject, eventdata, handles,0)
|
||||
end
|
||||
end
|
||||
|
||||
if c==0
|
||||
try
|
||||
|
||||
fprintf(handles.LASERRR,'%c','a');
|
||||
pause(1)
|
||||
catch
|
||||
f=errordlg('Connection Problem','Hardware Error');
|
||||
waitfor(f);
|
||||
seting_buttons_state(hObject, eventdata, handles,0)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
% --- Executes on button press in push_SaveExit.
|
||||
function push_SaveExit_Callback(hObject, eventdata, handles)
|
||||
% hObject handle to push_SaveExit (see GCBO)
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles structure with handles and user data (see GUIDATA)
|
||||
|
||||
|
||||
try
|
||||
fprintf(handles.LASERRR,'%c','y');
|
||||
fprintf(handles.LASERRR,'%c','a');
|
||||
fprintf(handles.LASERRR,'%c','o');
|
||||
pause(1)
|
||||
catch
|
||||
end
|
||||
|
||||
try delete(handles.figure1);catch; end
|
||||
|
||||
% --- Executes on button press in check_CabinLamp.
|
||||
function check_CabinLamp_Callback(hObject, eventdata, handles)
|
||||
% hObject handle to check_CabinLamp (see GCBO)
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles structure with handles and user data (see GUIDATA)
|
||||
|
||||
% Hint: get(hObject,'Value') returns toggle state of check_CabinLamp
|
||||
c = get(hObject,'Value') ;
|
||||
if c==1
|
||||
try
|
||||
fprintf(handles.LASERRR,'%c','p');
|
||||
pause(1)
|
||||
catch
|
||||
f=errordlg('Connection Problem','Hardware Error');
|
||||
waitfor(f);
|
||||
seting_buttons_state(hObject, eventdata, handles,0)
|
||||
end
|
||||
end
|
||||
|
||||
if c==0
|
||||
try
|
||||
fprintf(handles.LASERRR,'%c','o');
|
||||
pause(1)
|
||||
catch
|
||||
f=errordlg('Connection Problem','Hardware Error');
|
||||
waitfor(f);
|
||||
seting_buttons_state(hObject, eventdata, handles,0)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function seting_buttons_state(hObject, eventdata, handles,flg)
|
||||
%seting_buttons_state(hObject, eventdata, handles,0)
|
||||
button_list1 =[ handles.check_Laser handles.check_Projector handles.check_CabinLamp];
|
||||
button_list2 =[ handles.push_calibrate handles.popup_cameraSelect ];
|
||||
|
||||
|
||||
if flg==0
|
||||
set(button_list1, 'Enable','off');
|
||||
set(button_list2, 'Enable','off'); end
|
||||
if flg==1
|
||||
set(button_list1, 'Enable','on');
|
||||
set(button_list2, 'Enable','on'); end
|
||||
|
||||
|
||||
guidata(hObject, handles);
|
||||
|
||||
|
||||
% --- Executes on selection change in popup_cameraSelect.
|
||||
function popupmenu2_Callback(hObject, eventdata, handles)
|
||||
% hObject handle to popup_cameraSelect (see GCBO)
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles structure with handles and user data (see GUIDATA)
|
||||
|
||||
% Hints: contents = cellstr(get(hObject,'String')) returns popup_cameraSelect contents as cell array
|
||||
% contents{get(hObject,'Value')} returns selected item from popup_cameraSelect
|
||||
|
||||
|
||||
% --- Executes during object creation, after setting all properties.
|
||||
function popupmenu2_CreateFcn(hObject, eventdata, handles)
|
||||
% hObject handle to popup_cameraSelect (see GCBO)
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles empty - handles not created until after all CreateFcns called
|
||||
|
||||
% Hint: popupmenu controls usually have a white background on Windows.
|
||||
% See ISPC and COMPUTER.
|
||||
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
|
||||
set(hObject,'BackgroundColor','white');
|
||||
end
|
||||
|
||||
|
||||
% --- Executes on button press in push_Help.
|
||||
function push_Help_Callback(hObject, eventdata, handles)
|
||||
% hObject handle to push_Help (see GCBO)
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles structure with handles and user data (see GUIDATA)
|
||||
open('Help_3DFrImager.pdf');
|
||||
40
src/dfp/GetComPort.m
Normal file
@@ -0,0 +1,40 @@
|
||||
function lCOM_Port = GetComPort()
|
||||
% function lCOM_Port = GetComPort()
|
||||
% Return a Cell Array of COM port names available on your computer
|
||||
try
|
||||
s=serial('IMPOSSIBLE_NAME_ON_PORT');fopen(s);
|
||||
catch
|
||||
lErrMsg = lasterr;
|
||||
end
|
||||
fclose(s);
|
||||
delete(s);
|
||||
%Start of the COM available port
|
||||
lIndex1 = findstr(lErrMsg,'COM');
|
||||
%End of COM available port
|
||||
lIndex2 = findstr(lErrMsg,'Use')-3;
|
||||
lComStr = lErrMsg(lIndex1:lIndex2);
|
||||
%Parse the resulting string
|
||||
lIndexDot = findstr(lComStr,',');
|
||||
% If no Port are available
|
||||
if isempty(lIndex1)
|
||||
lCOM_Port{1}='';
|
||||
return;
|
||||
end
|
||||
% If only one Port is available
|
||||
if isempty(lIndexDot)
|
||||
lCOM_Port{1}=lComStr;
|
||||
return;
|
||||
end
|
||||
lCOM_Port{1} = lComStr(1:lIndexDot(1)-1);
|
||||
for i=1:numel(lIndexDot)+1
|
||||
% First One
|
||||
if (i==1)
|
||||
lCOM_Port{1,1} = lComStr(1:lIndexDot(i)-1);
|
||||
% Last One
|
||||
elseif (i==numel(lIndexDot)+1)
|
||||
lCOM_Port{i,1} = lComStr(lIndexDot(i-1)+2:end);
|
||||
% Others
|
||||
else
|
||||
lCOM_Port{i,1} = lComStr(lIndexDot(i-1)+2:lIndexDot(i)-1);
|
||||
end
|
||||
end
|
||||
1307
src/dfp/Scanner_3D_v2.m
Normal file
47
src/dfp/WFT2.m
Normal file
@@ -0,0 +1,47 @@
|
||||
function g=WFT2(f,sigmax,wxl,wxi,wxh,sigmay,wyl,wyi,wyh)
|
||||
|
||||
sx=round(3*sigmax);
|
||||
sy=round(3*sigmay);
|
||||
|
||||
|
||||
|
||||
[m n]=size(f);
|
||||
mm=m+2*sx;nn=n+2*sy;
|
||||
f=fexpand(f,mm,nn);
|
||||
Ff=fft2(f);
|
||||
[y x]=meshgrid(-sy:sy,-sx:sx);
|
||||
w0=exp(-x.*x/2/sigmax/sigmax-y.*y/2/sigmay/sigmay);
|
||||
w0=w0/sqrt(sum(sum(w0.*w0)));
|
||||
|
||||
g.wx=zeros(m,n); g.wy=zeros(m,n); g.phase=zeros(m,n); g.r=zeros(m,n);
|
||||
for wyt=wyl:wyi:wyh
|
||||
for wxt=wxl:wxi:wxh
|
||||
%WFT basis
|
||||
w=w0.*exp(j*wxt*x+j*wyt*y);
|
||||
%expand w to size [mm nn]
|
||||
w=fexpand(w,mm,nn);
|
||||
%spectrum of w
|
||||
Fw=fft2(w);
|
||||
%implement of WFT: conv2(f,w)=ifft2(Ff*Fw);
|
||||
sf=ifft2(Ff.*Fw);
|
||||
%cut to get desired data size
|
||||
sf=sf(1+sx:m+sx,1+sy:n+sy);
|
||||
%indicate where to update
|
||||
t=(abs(sf)>g.r);
|
||||
%update r
|
||||
g.r=g.r.*(1-t)+abs(sf).*t;
|
||||
%update wx
|
||||
g.wx=g.wx.*(1-t)+wxt*t;
|
||||
%update wy
|
||||
g.wy=g.wy.*(1-t)+wyt*t;
|
||||
%update phase
|
||||
g.phase=g.phase.*(1-t)+angle(sf).*t;
|
||||
end
|
||||
end
|
||||
|
||||
function f=fexpand(f,mm,nn)
|
||||
[m n]=size(f);
|
||||
f0=f;
|
||||
f=zeros(mm,nn);
|
||||
f(1:m,1:n)=f0;
|
||||
|
||||
29
src/dfp/dis_peak.m
Normal file
@@ -0,0 +1,29 @@
|
||||
function [dis]= dis_peak(I1)
|
||||
I = abs(I1);
|
||||
pvt=5;
|
||||
|
||||
|
||||
[r, c]=find(I==max(I(:)));
|
||||
|
||||
r =r(1); c=c(1);
|
||||
r1=r; c1= c;
|
||||
|
||||
|
||||
I(r-pvt:r+pvt, c-pvt:c+pvt)=0;
|
||||
|
||||
|
||||
[r, c]=find(I==max(I(:)));
|
||||
r =r(1); c=c(1);
|
||||
r2=r; c2= c;
|
||||
I(r-pvt:r+pvt, c-pvt:c+pvt)=0;
|
||||
|
||||
|
||||
[r, c]=find(I==max(I(:)));
|
||||
r =r(1); c=c(1);
|
||||
r3=r; c3= c;
|
||||
I(r-pvt:r+pvt, c-pvt:c+pvt)=0;
|
||||
|
||||
[r1, c1, r2, c2, r3, c3]
|
||||
dis=sqrt((r2-r3)^2+(c2-c3)^2)
|
||||
|
||||
dis= size(I1,2)*2/dis
|
||||
206
src/dfp/gui_CompleteCalib_Msg.m
Normal file
@@ -0,0 +1,206 @@
|
||||
function varargout = gui_CompleteCalib_Msg(varargin)
|
||||
% GUI_COMPLETECALIB_MSG MATLAB code for gui_CompleteCalib_Msg.fig
|
||||
% GUI_COMPLETECALIB_MSG by itself, creates a new GUI_COMPLETECALIB_MSG or raises the
|
||||
% existing singleton*.
|
||||
%
|
||||
% H = GUI_COMPLETECALIB_MSG returns the handle to a new GUI_COMPLETECALIB_MSG or the handle to
|
||||
% the existing singleton*.
|
||||
%
|
||||
% GUI_COMPLETECALIB_MSG('CALLBACK',hObject,eventData,handles,...) calls the local
|
||||
% function named CALLBACK in GUI_COMPLETECALIB_MSG.M with the given input arguments.
|
||||
%
|
||||
% GUI_COMPLETECALIB_MSG('Property','Value',...) creates a new GUI_COMPLETECALIB_MSG or raises the
|
||||
% existing singleton*. Starting from the left, property value pairs are
|
||||
% applied to the GUI before gui_CompleteCalib_Msg_OpeningFcn gets called. An
|
||||
% unrecognized property name or invalid value makes property application
|
||||
% stop. All inputs are passed to gui_CompleteCalib_Msg_OpeningFcn via varargin.
|
||||
%
|
||||
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
|
||||
% instance to run (singleton)".
|
||||
%
|
||||
% See also: GUIDE, GUIDATA, GUIHANDLES
|
||||
|
||||
% Edit the above text to modify the response to help gui_CompleteCalib_Msg
|
||||
|
||||
% Last Modified by GUIDE v2.5 04-Dec-2018 16:57:10
|
||||
|
||||
% Begin initialization code - DO NOT EDIT
|
||||
gui_Singleton = 1;
|
||||
gui_State = struct('gui_Name', mfilename, ...
|
||||
'gui_Singleton', gui_Singleton, ...
|
||||
'gui_OpeningFcn', @gui_CompleteCalib_Msg_OpeningFcn, ...
|
||||
'gui_OutputFcn', @gui_CompleteCalib_Msg_OutputFcn, ...
|
||||
'gui_LayoutFcn', [] , ...
|
||||
'gui_Callback', []);
|
||||
if nargin && ischar(varargin{1})
|
||||
gui_State.gui_Callback = str2func(varargin{1});
|
||||
end
|
||||
|
||||
if nargout
|
||||
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
|
||||
else
|
||||
gui_mainfcn(gui_State, varargin{:});
|
||||
end
|
||||
% End initialization code - DO NOT EDIT
|
||||
|
||||
% --- Executes just before gui_CompleteCalib_Msg is made visible.
|
||||
function gui_CompleteCalib_Msg_OpeningFcn(hObject, eventdata, handles, varargin)
|
||||
% This function has no output args, see OutputFcn.
|
||||
% hObject handle to figure
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles structure with handles and user data (see GUIDATA)
|
||||
% varargin command line arguments to gui_CompleteCalib_Msg (see VARARGIN)
|
||||
|
||||
% Choose default command line output for gui_CompleteCalib_Msg
|
||||
handles.output = 'Yes';
|
||||
|
||||
% Update handles structure
|
||||
guidata(hObject, handles);
|
||||
|
||||
% Insert custom Title and Text if specified by the user
|
||||
% Hint: when choosing keywords, be sure they are not easily confused
|
||||
% with existing figure properties. See the output of set(figure) for
|
||||
% a list of figure properties.
|
||||
if(nargin > 3)
|
||||
for index = 1:2:(nargin-3),
|
||||
if nargin-3==index, break, end
|
||||
switch lower(varargin{index})
|
||||
case 'title'
|
||||
set(hObject, 'Name', varargin{index+1});
|
||||
case 'string'
|
||||
set(handles.text1, 'String', varargin{index+1});
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
% Determine the position of the dialog - centered on the callback figure
|
||||
% if available, else, centered on the screen
|
||||
FigPos=get(0,'DefaultFigurePosition');
|
||||
OldUnits = get(hObject, 'Units');
|
||||
set(hObject, 'Units', 'pixels');
|
||||
OldPos = get(hObject,'Position');
|
||||
FigWidth = OldPos(3);
|
||||
FigHeight = OldPos(4);
|
||||
if isempty(gcbf)
|
||||
ScreenUnits=get(0,'Units');
|
||||
set(0,'Units','pixels');
|
||||
ScreenSize=get(0,'ScreenSize');
|
||||
set(0,'Units',ScreenUnits);
|
||||
|
||||
FigPos(1)=1/2*(ScreenSize(3)-FigWidth);
|
||||
FigPos(2)=2/3*(ScreenSize(4)-FigHeight);
|
||||
else
|
||||
GCBFOldUnits = get(gcbf,'Units');
|
||||
set(gcbf,'Units','pixels');
|
||||
GCBFPos = get(gcbf,'Position');
|
||||
set(gcbf,'Units',GCBFOldUnits);
|
||||
FigPos(1:2) = [(GCBFPos(1) + GCBFPos(3) / 2) - FigWidth / 2, ...
|
||||
(GCBFPos(2) + GCBFPos(4) / 2) - FigHeight / 2];
|
||||
end
|
||||
FigPos(3:4)=[FigWidth FigHeight];
|
||||
set(hObject, 'Position', FigPos);
|
||||
set(hObject, 'Units', OldUnits);
|
||||
|
||||
% Show a question icon from dialogicons.mat - variables questIconData
|
||||
% and questIconMap
|
||||
load dialogicons.mat
|
||||
|
||||
IconData=questIconData;
|
||||
questIconMap(256,:) = get(handles.figure1, 'Color');
|
||||
IconCMap=questIconMap;
|
||||
|
||||
Img=image(IconData, 'Parent', handles.axes1);
|
||||
set(handles.figure1, 'Colormap', IconCMap);
|
||||
|
||||
set(handles.axes1, ...
|
||||
'Visible', 'off', ...
|
||||
'YDir' , 'reverse' , ...
|
||||
'XLim' , get(Img,'XData'), ...
|
||||
'YLim' , get(Img,'YData') ...
|
||||
);
|
||||
|
||||
% Make the GUI modal
|
||||
set(handles.figure1,'WindowStyle','modal')
|
||||
|
||||
% UIWAIT makes gui_CompleteCalib_Msg wait for user response (see UIRESUME)
|
||||
uiwait(handles.figure1);
|
||||
|
||||
% --- Outputs from this function are returned to the command line.
|
||||
function varargout = gui_CompleteCalib_Msg_OutputFcn(hObject, eventdata, handles)
|
||||
% varargout cell array for returning output args (see VARARGOUT);
|
||||
% hObject handle to figure
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles structure with handles and user data (see GUIDATA)
|
||||
|
||||
% Get default command line output from handles structure
|
||||
varargout{1} = handles.output;
|
||||
|
||||
% The figure can be deleted now
|
||||
delete(handles.figure1);
|
||||
|
||||
% --- Executes on button press in pushbutton1.
|
||||
function pushbutton1_Callback(hObject, eventdata, handles)
|
||||
% hObject handle to pushbutton1 (see GCBO)
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles structure with handles and user data (see GUIDATA)
|
||||
|
||||
handles.output = get(hObject,'String');
|
||||
|
||||
% Update handles structure
|
||||
guidata(hObject, handles);
|
||||
|
||||
% Use UIRESUME instead of delete because the OutputFcn needs
|
||||
% to get the updated handles structure.
|
||||
uiresume(handles.figure1);
|
||||
|
||||
% --- Executes on button press in pushbutton2.
|
||||
function pushbutton2_Callback(hObject, eventdata, handles)
|
||||
% hObject handle to pushbutton2 (see GCBO)
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles structure with handles and user data (see GUIDATA)
|
||||
|
||||
handles.output = get(hObject,'String');
|
||||
|
||||
% Update handles structure
|
||||
guidata(hObject, handles);
|
||||
|
||||
% Use UIRESUME instead of delete because the OutputFcn needs
|
||||
% to get the updated handles structure.
|
||||
uiresume(handles.figure1);
|
||||
|
||||
|
||||
% --- Executes when user attempts to close figure1.
|
||||
function figure1_CloseRequestFcn(hObject, eventdata, handles)
|
||||
% hObject handle to figure1 (see GCBO)
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles structure with handles and user data (see GUIDATA)
|
||||
|
||||
if isequal(get(hObject, 'waitstatus'), 'waiting')
|
||||
% The GUI is still in UIWAIT, us UIRESUME
|
||||
uiresume(hObject);
|
||||
else
|
||||
% The GUI is no longer waiting, just close it
|
||||
delete(hObject);
|
||||
end
|
||||
|
||||
|
||||
% --- Executes on key press over figure1 with no controls selected.
|
||||
function figure1_KeyPressFcn(hObject, eventdata, handles)
|
||||
% hObject handle to figure1 (see GCBO)
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles structure with handles and user data (see GUIDATA)
|
||||
|
||||
% Check for "enter" or "escape"
|
||||
if isequal(get(hObject,'CurrentKey'),'escape')
|
||||
% User said no by hitting escape
|
||||
handles.output = 'No';
|
||||
|
||||
% Update handles structure
|
||||
guidata(hObject, handles);
|
||||
|
||||
uiresume(handles.figure1);
|
||||
end
|
||||
|
||||
if isequal(get(hObject,'CurrentKey'),'return')
|
||||
uiresume(handles.figure1);
|
||||
end
|
||||
206
src/dfp/gui_StartProfiling.m
Normal file
@@ -0,0 +1,206 @@
|
||||
function varargout = gui_StartProfiling(varargin)
|
||||
% GUI_STARTPROFILING MATLAB code for gui_StartProfiling.fig
|
||||
% GUI_STARTPROFILING by itself, creates a new GUI_STARTPROFILING or raises the
|
||||
% existing singleton*.
|
||||
%
|
||||
% H = GUI_STARTPROFILING returns the handle to a new GUI_STARTPROFILING or the handle to
|
||||
% the existing singleton*.
|
||||
%
|
||||
% GUI_STARTPROFILING('CALLBACK',hObject,eventData,handles,...) calls the local
|
||||
% function named CALLBACK in GUI_STARTPROFILING.M with the given input arguments.
|
||||
%
|
||||
% GUI_STARTPROFILING('Property','Value',...) creates a new GUI_STARTPROFILING or raises the
|
||||
% existing singleton*. Starting from the left, property value pairs are
|
||||
% applied to the GUI before gui_StartProfiling_OpeningFcn gets called. An
|
||||
% unrecognized property name or invalid value makes property application
|
||||
% stop. All inputs are passed to gui_StartProfiling_OpeningFcn via varargin.
|
||||
%
|
||||
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
|
||||
% instance to run (singleton)".
|
||||
%
|
||||
% See also: GUIDE, GUIDATA, GUIHANDLES
|
||||
|
||||
% Edit the above text to modify the response to help gui_StartProfiling
|
||||
|
||||
% Last Modified by GUIDE v2.5 03-Dec-2018 13:58:53
|
||||
|
||||
% Begin initialization code - DO NOT EDIT
|
||||
gui_Singleton = 1;
|
||||
gui_State = struct('gui_Name', mfilename, ...
|
||||
'gui_Singleton', gui_Singleton, ...
|
||||
'gui_OpeningFcn', @gui_StartProfiling_OpeningFcn, ...
|
||||
'gui_OutputFcn', @gui_StartProfiling_OutputFcn, ...
|
||||
'gui_LayoutFcn', [] , ...
|
||||
'gui_Callback', []);
|
||||
if nargin && ischar(varargin{1})
|
||||
gui_State.gui_Callback = str2func(varargin{1});
|
||||
end
|
||||
|
||||
if nargout
|
||||
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
|
||||
else
|
||||
gui_mainfcn(gui_State, varargin{:});
|
||||
end
|
||||
% End initialization code - DO NOT EDIT
|
||||
|
||||
% --- Executes just before gui_StartProfiling is made visible.
|
||||
function gui_StartProfiling_OpeningFcn(hObject, eventdata, handles, varargin)
|
||||
% This function has no output args, see OutputFcn.
|
||||
% hObject handle to figure
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles structure with handles and user data (see GUIDATA)
|
||||
% varargin command line arguments to gui_StartProfiling (see VARARGIN)
|
||||
|
||||
% Choose default command line output for gui_StartProfiling
|
||||
handles.output = 'Yes';
|
||||
|
||||
% Update handles structure
|
||||
guidata(hObject, handles);
|
||||
|
||||
% Insert custom Title and Text if specified by the user
|
||||
% Hint: when choosing keywords, be sure they are not easily confused
|
||||
% with existing figure properties. See the output of set(figure) for
|
||||
% a list of figure properties.
|
||||
if(nargin > 3)
|
||||
for index = 1:2:(nargin-3),
|
||||
if nargin-3==index, break, end
|
||||
switch lower(varargin{index})
|
||||
case 'title'
|
||||
set(hObject, 'Name', varargin{index+1});
|
||||
case 'string'
|
||||
set(handles.text1, 'String', varargin{index+1});
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
% Determine the position of the dialog - centered on the callback figure
|
||||
% if available, else, centered on the screen
|
||||
FigPos=get(0,'DefaultFigurePosition');
|
||||
OldUnits = get(hObject, 'Units');
|
||||
set(hObject, 'Units', 'pixels');
|
||||
OldPos = get(hObject,'Position');
|
||||
FigWidth = OldPos(3);
|
||||
FigHeight = OldPos(4);
|
||||
if isempty(gcbf)
|
||||
ScreenUnits=get(0,'Units');
|
||||
set(0,'Units','pixels');
|
||||
ScreenSize=get(0,'ScreenSize');
|
||||
set(0,'Units',ScreenUnits);
|
||||
|
||||
FigPos(1)=1/2*(ScreenSize(3)-FigWidth);
|
||||
FigPos(2)=2/3*(ScreenSize(4)-FigHeight);
|
||||
else
|
||||
GCBFOldUnits = get(gcbf,'Units');
|
||||
set(gcbf,'Units','pixels');
|
||||
GCBFPos = get(gcbf,'Position');
|
||||
set(gcbf,'Units',GCBFOldUnits);
|
||||
FigPos(1:2) = [(GCBFPos(1) + GCBFPos(3) / 2) - FigWidth / 2, ...
|
||||
(GCBFPos(2) + GCBFPos(4) / 2) - FigHeight / 2];
|
||||
end
|
||||
FigPos(3:4)=[FigWidth FigHeight];
|
||||
set(hObject, 'Position', FigPos);
|
||||
set(hObject, 'Units', OldUnits);
|
||||
|
||||
% Show a question icon from dialogicons.mat - variables questIconData
|
||||
% and questIconMap
|
||||
load dialogicons.mat
|
||||
|
||||
IconData=questIconData;
|
||||
questIconMap(256,:) = get(handles.figure1, 'Color');
|
||||
IconCMap=questIconMap;
|
||||
|
||||
Img=image(IconData, 'Parent', handles.axes1);
|
||||
set(handles.figure1, 'Colormap', IconCMap);
|
||||
|
||||
set(handles.axes1, ...
|
||||
'Visible', 'off', ...
|
||||
'YDir' , 'reverse' , ...
|
||||
'XLim' , get(Img,'XData'), ...
|
||||
'YLim' , get(Img,'YData') ...
|
||||
);
|
||||
|
||||
% Make the GUI modal
|
||||
set(handles.figure1,'WindowStyle','modal')
|
||||
|
||||
% UIWAIT makes gui_StartProfiling wait for user response (see UIRESUME)
|
||||
uiwait(handles.figure1);
|
||||
|
||||
% --- Outputs from this function are returned to the command line.
|
||||
function varargout = gui_StartProfiling_OutputFcn(hObject, eventdata, handles)
|
||||
% varargout cell array for returning output args (see VARARGOUT);
|
||||
% hObject handle to figure
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles structure with handles and user data (see GUIDATA)
|
||||
|
||||
% Get default command line output from handles structure
|
||||
varargout{1} = handles.output;
|
||||
|
||||
% The figure can be deleted now
|
||||
delete(handles.figure1);
|
||||
|
||||
% --- Executes on button press in pushbutton1.
|
||||
function pushbutton1_Callback(hObject, eventdata, handles)
|
||||
% hObject handle to pushbutton1 (see GCBO)
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles structure with handles and user data (see GUIDATA)
|
||||
|
||||
handles.output = get(hObject,'String');
|
||||
|
||||
% Update handles structure
|
||||
guidata(hObject, handles);
|
||||
|
||||
% Use UIRESUME instead of delete because the OutputFcn needs
|
||||
% to get the updated handles structure.
|
||||
uiresume(handles.figure1);
|
||||
|
||||
% --- Executes on button press in pushbutton2.
|
||||
function pushbutton2_Callback(hObject, eventdata, handles)
|
||||
% hObject handle to pushbutton2 (see GCBO)
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles structure with handles and user data (see GUIDATA)
|
||||
|
||||
handles.output = get(hObject,'String');
|
||||
|
||||
% Update handles structure
|
||||
guidata(hObject, handles);
|
||||
|
||||
% Use UIRESUME instead of delete because the OutputFcn needs
|
||||
% to get the updated handles structure.
|
||||
uiresume(handles.figure1);
|
||||
|
||||
|
||||
% --- Executes when user attempts to close figure1.
|
||||
function figure1_CloseRequestFcn(hObject, eventdata, handles)
|
||||
% hObject handle to figure1 (see GCBO)
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles structure with handles and user data (see GUIDATA)
|
||||
|
||||
if isequal(get(hObject, 'waitstatus'), 'waiting')
|
||||
% The GUI is still in UIWAIT, us UIRESUME
|
||||
uiresume(hObject);
|
||||
else
|
||||
% The GUI is no longer waiting, just close it
|
||||
delete(hObject);
|
||||
end
|
||||
|
||||
|
||||
% --- Executes on key press over figure1 with no controls selected.
|
||||
function figure1_KeyPressFcn(hObject, eventdata, handles)
|
||||
% hObject handle to figure1 (see GCBO)
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles structure with handles and user data (see GUIDATA)
|
||||
|
||||
% Check for "enter" or "escape"
|
||||
if isequal(get(hObject,'CurrentKey'),'escape')
|
||||
% User said no by hitting escape
|
||||
handles.output = 'No';
|
||||
|
||||
% Update handles structure
|
||||
guidata(hObject, handles);
|
||||
|
||||
uiresume(handles.figure1);
|
||||
end
|
||||
|
||||
if isequal(get(hObject,'CurrentKey'),'return')
|
||||
uiresume(handles.figure1);
|
||||
end
|
||||
206
src/dfp/gui_WantCalibration.m
Normal file
@@ -0,0 +1,206 @@
|
||||
function varargout = gui_WantCalibration(varargin)
|
||||
% GUI_WANTCALIBRATION MATLAB code for gui_WantCalibration.fig
|
||||
% GUI_WANTCALIBRATION by itself, creates a new GUI_WANTCALIBRATION or raises the
|
||||
% existing singleton*.
|
||||
%
|
||||
% H = GUI_WANTCALIBRATION returns the handle to a new GUI_WANTCALIBRATION or the handle to
|
||||
% the existing singleton*.
|
||||
%
|
||||
% GUI_WANTCALIBRATION('CALLBACK',hObject,eventData,handles,...) calls the local
|
||||
% function named CALLBACK in GUI_WANTCALIBRATION.M with the given input arguments.
|
||||
%
|
||||
% GUI_WANTCALIBRATION('Property','Value',...) creates a new GUI_WANTCALIBRATION or raises the
|
||||
% existing singleton*. Starting from the left, property value pairs are
|
||||
% applied to the GUI before gui_WantCalibration_OpeningFcn gets called. An
|
||||
% unrecognized property name or invalid value makes property application
|
||||
% stop. All inputs are passed to gui_WantCalibration_OpeningFcn via varargin.
|
||||
%
|
||||
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
|
||||
% instance to run (singleton)".
|
||||
%
|
||||
% See also: GUIDE, GUIDATA, GUIHANDLES
|
||||
|
||||
% Edit the above text to modify the response to help gui_WantCalibration
|
||||
|
||||
% Last Modified by GUIDE v2.5 02-Dec-2018 18:48:33
|
||||
|
||||
% Begin initialization code - DO NOT EDIT
|
||||
gui_Singleton = 1;
|
||||
gui_State = struct('gui_Name', mfilename, ...
|
||||
'gui_Singleton', gui_Singleton, ...
|
||||
'gui_OpeningFcn', @gui_WantCalibration_OpeningFcn, ...
|
||||
'gui_OutputFcn', @gui_WantCalibration_OutputFcn, ...
|
||||
'gui_LayoutFcn', [] , ...
|
||||
'gui_Callback', []);
|
||||
if nargin && ischar(varargin{1})
|
||||
gui_State.gui_Callback = str2func(varargin{1});
|
||||
end
|
||||
|
||||
if nargout
|
||||
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
|
||||
else
|
||||
gui_mainfcn(gui_State, varargin{:});
|
||||
end
|
||||
% End initialization code - DO NOT EDIT
|
||||
|
||||
% --- Executes just before gui_WantCalibration is made visible.
|
||||
function gui_WantCalibration_OpeningFcn(hObject, eventdata, handles, varargin)
|
||||
% This function has no output args, see OutputFcn.
|
||||
% hObject handle to figure
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles structure with handles and user data (see GUIDATA)
|
||||
% varargin command line arguments to gui_WantCalibration (see VARARGIN)
|
||||
|
||||
% Choose default command line output for gui_WantCalibration
|
||||
handles.output = 'Yes';
|
||||
|
||||
% Update handles structure
|
||||
guidata(hObject, handles);
|
||||
|
||||
% Insert custom Title and Text if specified by the user
|
||||
% Hint: when choosing keywords, be sure they are not easily confused
|
||||
% with existing figure properties. See the output of set(figure) for
|
||||
% a list of figure properties.
|
||||
if(nargin > 3)
|
||||
for index = 1:2:(nargin-3),
|
||||
if nargin-3==index, break, end
|
||||
switch lower(varargin{index})
|
||||
case 'title'
|
||||
set(hObject, 'Name', varargin{index+1});
|
||||
case 'string'
|
||||
set(handles.text1, 'String', varargin{index+1});
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
% Determine the position of the dialog - centered on the callback figure
|
||||
% if available, else, centered on the screen
|
||||
FigPos=get(0,'DefaultFigurePosition');
|
||||
OldUnits = get(hObject, 'Units');
|
||||
set(hObject, 'Units', 'pixels');
|
||||
OldPos = get(hObject,'Position');
|
||||
FigWidth = OldPos(3);
|
||||
FigHeight = OldPos(4);
|
||||
if isempty(gcbf)
|
||||
ScreenUnits=get(0,'Units');
|
||||
set(0,'Units','pixels');
|
||||
ScreenSize=get(0,'ScreenSize');
|
||||
set(0,'Units',ScreenUnits);
|
||||
|
||||
FigPos(1)=1/2*(ScreenSize(3)-FigWidth);
|
||||
FigPos(2)=2/3*(ScreenSize(4)-FigHeight);
|
||||
else
|
||||
GCBFOldUnits = get(gcbf,'Units');
|
||||
set(gcbf,'Units','pixels');
|
||||
GCBFPos = get(gcbf,'Position');
|
||||
set(gcbf,'Units',GCBFOldUnits);
|
||||
FigPos(1:2) = [(GCBFPos(1) + GCBFPos(3) / 2) - FigWidth / 2, ...
|
||||
(GCBFPos(2) + GCBFPos(4) / 2) - FigHeight / 2];
|
||||
end
|
||||
FigPos(3:4)=[FigWidth FigHeight];
|
||||
set(hObject, 'Position', FigPos);
|
||||
set(hObject, 'Units', OldUnits);
|
||||
|
||||
% Show a question icon from dialogicons.mat - variables questIconData
|
||||
% and questIconMap
|
||||
load dialogicons.mat
|
||||
|
||||
IconData=questIconData;
|
||||
questIconMap(256,:) = get(handles.figure1, 'Color');
|
||||
IconCMap=questIconMap;
|
||||
|
||||
Img=image(IconData, 'Parent', handles.axes1);
|
||||
set(handles.figure1, 'Colormap', IconCMap);
|
||||
|
||||
set(handles.axes1, ...
|
||||
'Visible', 'off', ...
|
||||
'YDir' , 'reverse' , ...
|
||||
'XLim' , get(Img,'XData'), ...
|
||||
'YLim' , get(Img,'YData') ...
|
||||
);
|
||||
|
||||
% Make the GUI modal
|
||||
set(handles.figure1,'WindowStyle','modal')
|
||||
|
||||
% UIWAIT makes gui_WantCalibration wait for user response (see UIRESUME)
|
||||
uiwait(handles.figure1);
|
||||
|
||||
% --- Outputs from this function are returned to the command line.
|
||||
function varargout = gui_WantCalibration_OutputFcn(hObject, eventdata, handles)
|
||||
% varargout cell array for returning output args (see VARARGOUT);
|
||||
% hObject handle to figure
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles structure with handles and user data (see GUIDATA)
|
||||
|
||||
% Get default command line output from handles structure
|
||||
varargout{1} = handles.output;
|
||||
|
||||
% The figure can be deleted now
|
||||
delete(handles.figure1);
|
||||
|
||||
% --- Executes on button press in pushbutton1.
|
||||
function pushbutton1_Callback(hObject, eventdata, handles)
|
||||
% hObject handle to pushbutton1 (see GCBO)
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles structure with handles and user data (see GUIDATA)
|
||||
|
||||
handles.output = get(hObject,'String');
|
||||
|
||||
% Update handles structure
|
||||
guidata(hObject, handles);
|
||||
|
||||
% Use UIRESUME instead of delete because the OutputFcn needs
|
||||
% to get the updated handles structure.
|
||||
uiresume(handles.figure1);
|
||||
|
||||
% --- Executes on button press in pushbutton2.
|
||||
function pushbutton2_Callback(hObject, eventdata, handles)
|
||||
% hObject handle to pushbutton2 (see GCBO)
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles structure with handles and user data (see GUIDATA)
|
||||
|
||||
handles.output = get(hObject,'String');
|
||||
|
||||
% Update handles structure
|
||||
guidata(hObject, handles);
|
||||
|
||||
% Use UIRESUME instead of delete because the OutputFcn needs
|
||||
% to get the updated handles structure.
|
||||
uiresume(handles.figure1);
|
||||
|
||||
|
||||
% --- Executes when user attempts to close figure1.
|
||||
function figure1_CloseRequestFcn(hObject, eventdata, handles)
|
||||
% hObject handle to figure1 (see GCBO)
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles structure with handles and user data (see GUIDATA)
|
||||
|
||||
if isequal(get(hObject, 'waitstatus'), 'waiting')
|
||||
% The GUI is still in UIWAIT, us UIRESUME
|
||||
uiresume(hObject);
|
||||
else
|
||||
% The GUI is no longer waiting, just close it
|
||||
delete(hObject);
|
||||
end
|
||||
|
||||
|
||||
% --- Executes on key press over figure1 with no controls selected.
|
||||
function figure1_KeyPressFcn(hObject, eventdata, handles)
|
||||
% hObject handle to figure1 (see GCBO)
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles structure with handles and user data (see GUIDATA)
|
||||
|
||||
% Check for "enter" or "escape"
|
||||
if isequal(get(hObject,'CurrentKey'),'escape')
|
||||
% User said no by hitting escape
|
||||
handles.output = 'No';
|
||||
|
||||
% Update handles structure
|
||||
guidata(hObject, handles);
|
||||
|
||||
uiresume(handles.figure1);
|
||||
end
|
||||
|
||||
if isequal(get(hObject,'CurrentKey'),'return')
|
||||
uiresume(handles.figure1);
|
||||
end
|
||||
338
src/dfp/gui_ask_cal_KNOWN_Point.m
Normal file
@@ -0,0 +1,338 @@
|
||||
function varargout = gui_ask_cal_KNOWN_Point(varargin)
|
||||
% GUI_ASK_CAL_KNOWN_POINT MATLAB code for gui_ask_cal_KNOWN_Point.fig
|
||||
% GUI_ASK_CAL_KNOWN_POINT by itself, creates a new GUI_ASK_CAL_KNOWN_POINT or raises the
|
||||
% existing singleton*.
|
||||
%
|
||||
% H = GUI_ASK_CAL_KNOWN_POINT returns the handle to a new GUI_ASK_CAL_KNOWN_POINT or the handle to
|
||||
% the existing singleton*.
|
||||
%
|
||||
% GUI_ASK_CAL_KNOWN_POINT('CALLBACK',hObject,eventData,handles,...) calls the local
|
||||
% function named CALLBACK in GUI_ASK_CAL_KNOWN_POINT.M with the given input arguments.
|
||||
%
|
||||
% GUI_ASK_CAL_KNOWN_POINT('Property','Value',...) creates a new GUI_ASK_CAL_KNOWN_POINT or raises the
|
||||
% existing singleton*. Starting from the left, property value pairs are
|
||||
% applied to the GUI before gui_ask_cal_KNOWN_Point_OpeningFcn gets called. An
|
||||
% unrecognized property name or invalid value makes property application
|
||||
% stop. All inputs are passed to gui_ask_cal_KNOWN_Point_OpeningFcn via varargin.
|
||||
%
|
||||
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
|
||||
% instance to run (singleton)".
|
||||
%
|
||||
% See also: GUIDE, GUIDATA, GUIHANDLES
|
||||
|
||||
% Edit the above text to modify the response to help gui_ask_cal_KNOWN_Point
|
||||
|
||||
% Last Modified by GUIDE v2.5 03-Aug-2018 03:25:03
|
||||
|
||||
% Begin initialization code - DO NOT EDIT
|
||||
gui_Singleton = 1;
|
||||
gui_State = struct('gui_Name', mfilename, ...
|
||||
'gui_Singleton', gui_Singleton, ...
|
||||
'gui_OpeningFcn', @gui_ask_cal_KNOWN_Point_OpeningFcn, ...
|
||||
'gui_OutputFcn', @gui_ask_cal_KNOWN_Point_OutputFcn, ...
|
||||
'gui_LayoutFcn', [] , ...
|
||||
'gui_Callback', []);
|
||||
if nargin && ischar(varargin{1})
|
||||
gui_State.gui_Callback = str2func(varargin{1});
|
||||
end
|
||||
|
||||
if nargout
|
||||
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
|
||||
else
|
||||
gui_mainfcn(gui_State, varargin{:});
|
||||
end
|
||||
% End initialization code - DO NOT EDIT
|
||||
|
||||
% --- Executes just before gui_ask_cal_KNOWN_Point is made visible.
|
||||
function gui_ask_cal_KNOWN_Point_OpeningFcn(hObject, eventdata, handles, varargin)
|
||||
% This function has no output args, see OutputFcn.
|
||||
% hObject handle to figure
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles structure with handles and user data (see GUIDATA)
|
||||
% varargin command line arguments to gui_ask_cal_KNOWN_Point (see VARARGIN)
|
||||
|
||||
% Choose default command line output for gui_ask_cal_KNOWN_Point
|
||||
handles.output = 'Cancel';
|
||||
|
||||
% Update handles structure
|
||||
guidata(hObject, handles);
|
||||
|
||||
% Insert custom Title and Text if specified by the user
|
||||
% Hint: when choosing keywords, be sure they are not easily confused
|
||||
% with existing figure properties. See the output of set(figure) for
|
||||
% a list of figure properties.
|
||||
if(nargin > 3)
|
||||
for index = 1:2:(nargin-3),
|
||||
if nargin-3==index, break, end
|
||||
switch lower(varargin{index})
|
||||
case 'title'
|
||||
set(hObject, 'Name', varargin{index+1});
|
||||
case 'string'
|
||||
set(handles.text1, 'String', varargin{index+1});
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
% Determine the position of the dialog - centered on the callback figure
|
||||
% if available, else, centered on the screen
|
||||
FigPos=get(0,'DefaultFigurePosition');
|
||||
OldUnits = get(hObject, 'Units');
|
||||
set(hObject, 'Units', 'pixels');
|
||||
OldPos = get(hObject,'Position');
|
||||
FigWidth = OldPos(3);
|
||||
FigHeight = OldPos(4);
|
||||
if isempty(gcbf)
|
||||
ScreenUnits=get(0,'Units');
|
||||
set(0,'Units','pixels');
|
||||
ScreenSize=get(0,'ScreenSize');
|
||||
set(0,'Units',ScreenUnits);
|
||||
|
||||
FigPos(1)=1/2*(ScreenSize(3)-FigWidth);
|
||||
FigPos(2)=2/3*(ScreenSize(4)-FigHeight);
|
||||
else
|
||||
GCBFOldUnits = get(gcbf,'Units');
|
||||
set(gcbf,'Units','pixels');
|
||||
GCBFPos = get(gcbf,'Position');
|
||||
set(gcbf,'Units',GCBFOldUnits);
|
||||
FigPos(1:2) = [(GCBFPos(1) + GCBFPos(3) / 2) - FigWidth / 2, ...
|
||||
(GCBFPos(2) + GCBFPos(4) / 2) - FigHeight / 2];
|
||||
end
|
||||
FigPos(3:4)=[FigWidth FigHeight];
|
||||
set(hObject, 'Position', FigPos);
|
||||
set(hObject, 'Units', OldUnits);
|
||||
|
||||
% Show a question icon from dialogicons.mat - variables questIconData
|
||||
% and questIconMap
|
||||
% load dialogicons.mat
|
||||
%
|
||||
% IconData=questIconData;
|
||||
% questIconMap(256,:) = get(handles.figure1, 'Color');
|
||||
% IconCMap=questIconMap;
|
||||
%
|
||||
% % Img=image(IconData, 'Parent', handles.axes1);
|
||||
% set(handles.figure1, 'Colormap', IconCMap);
|
||||
%
|
||||
% set(handles.axes1, ...
|
||||
% 'Visible', 'off', ...
|
||||
% 'YDir' , 'reverse' , ...
|
||||
% 'XLim' , get(Img,'XData'), ...
|
||||
% 'YLim' , get(Img,'YData') ...
|
||||
% );
|
||||
|
||||
% Make the GUI modal
|
||||
set(handles.figure1,'WindowStyle','modal')
|
||||
|
||||
set(handles.push_SET, 'Enable','off');
|
||||
set(handles.edit1, 'Enable','off');
|
||||
set(handles.push_CANCEL, 'Enable','off');
|
||||
|
||||
handles.value=0;
|
||||
handles.image=varargin{1};
|
||||
guidata(hObject, handles);
|
||||
|
||||
axes(handles.axes3); imshow(handles.image,[]);
|
||||
get_coordinates1(hObject, eventdata, handles);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
% UIWAIT makes gui_ask_cal_KNOWN_Point wait for user response (see UIRESUME)
|
||||
uiwait(handles.figure1);
|
||||
|
||||
|
||||
function get_coordinates1(hObject, eventdata, handles)
|
||||
|
||||
xx=[];
|
||||
yy=[];
|
||||
iter=0;
|
||||
|
||||
% clf
|
||||
% axes(handles.axes1); imshow(handles.image,[]);
|
||||
|
||||
|
||||
while 1
|
||||
|
||||
|
||||
|
||||
[x y button]=ginput(1);
|
||||
|
||||
% if button==27
|
||||
% xx=[];
|
||||
% yy=[];
|
||||
% iter=0;
|
||||
% end
|
||||
%
|
||||
|
||||
if button==3
|
||||
|
||||
|
||||
|
||||
if iter==2,
|
||||
xx=xx(end); yy=yy(end);
|
||||
iter=1;
|
||||
end
|
||||
|
||||
|
||||
xx=[xx;x];
|
||||
yy=[yy;y];
|
||||
iter=iter+1;
|
||||
|
||||
|
||||
imshow(handles.image,[]),
|
||||
h=line(xx,yy);
|
||||
h.LineWidth=2;
|
||||
h.Color=[1 0 0];
|
||||
pause(0.2)
|
||||
|
||||
if iter==2, break; end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
set(handles.push_SET, 'Enable','on');
|
||||
set(handles.edit1, 'Enable','on');
|
||||
set(handles.push_CANCEL, 'Enable','on');
|
||||
set(handles.text_DISPLAY, 'String',num2str(handles.value));
|
||||
|
||||
|
||||
handles.xx=xx(end-1:end);
|
||||
handles.yy=yy(end-1:end);
|
||||
varargout{2}=handles.xx;
|
||||
varargout{3}=handles.yy;
|
||||
|
||||
guidata(hObject, handles);
|
||||
|
||||
|
||||
% --- Outputs from this function are returned to the command line.
|
||||
function varargout = gui_ask_cal_KNOWN_Point_OutputFcn(hObject, eventdata, handles)
|
||||
% varargout cell array for returning output args (see VARARGOUT);
|
||||
% hObject handle to figure
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles structure with handles and user data (see GUIDATA)
|
||||
|
||||
% Get default command line output from handles structure
|
||||
varargout{1} = handles.output;
|
||||
varargout{2}=handles.xx;
|
||||
varargout{3}=handles.yy;
|
||||
varargout{4}=handles.value;
|
||||
% The figure can be deleted now
|
||||
delete(handles.figure1);
|
||||
|
||||
% --- Executes on button press in push_SET.
|
||||
function push_SET_Callback(hObject, eventdata, handles)
|
||||
% hObject handle to push_SET (see GCBO)
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles structure with handles and user data (see GUIDATA)
|
||||
|
||||
handles.output = get(hObject,'String');
|
||||
|
||||
% Update handles structure
|
||||
guidata(hObject, handles);
|
||||
|
||||
% Use UIRESUME instead of delete because the OutputFcn needs
|
||||
% to get the updated handles structure.
|
||||
uiresume(handles.figure1);
|
||||
|
||||
% --- Executes on button press in push_CANCEL.
|
||||
function push_CANCEL_Callback(hObject, eventdata, handles)
|
||||
% hObject handle to push_CANCEL (see GCBO)
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles structure with handles and user data (see GUIDATA)
|
||||
|
||||
handles.output = get(hObject,'String');
|
||||
|
||||
% Update handles structure
|
||||
guidata(hObject, handles);
|
||||
|
||||
% Use UIRESUME instead of delete because the OutputFcn needs
|
||||
% to get the updated handles structure.
|
||||
uiresume(handles.figure1);
|
||||
|
||||
|
||||
% --- Executes when user attempts to close figure1.
|
||||
function figure1_CloseRequestFcn(hObject, eventdata, handles)
|
||||
% hObject handle to figure1 (see GCBO)
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles structure with handles and user data (see GUIDATA)
|
||||
|
||||
if isequal(get(hObject, 'waitstatus'), 'waiting')
|
||||
% The GUI is still in UIWAIT, us UIRESUME
|
||||
uiresume(hObject);
|
||||
else
|
||||
% The GUI is no longer waiting, just close it
|
||||
delete(hObject);
|
||||
end
|
||||
|
||||
|
||||
% --- Executes on key press over figure1 with no controls selected.
|
||||
function figure1_KeyPressFcn(hObject, eventdata, handles)
|
||||
% hObject handle to figure1 (see GCBO)
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles structure with handles and user data (see GUIDATA)
|
||||
|
||||
% Check for "enter" or "escape"
|
||||
if isequal(get(hObject,'CurrentKey'),'escape')
|
||||
% User said no by hitting escape
|
||||
handles.output = 'No';
|
||||
|
||||
% Update handles structure
|
||||
guidata(hObject, handles);
|
||||
|
||||
uiresume(handles.figure1);
|
||||
end
|
||||
|
||||
if isequal(get(hObject,'CurrentKey'),'return')
|
||||
uiresume(handles.figure1);
|
||||
end
|
||||
|
||||
|
||||
|
||||
function edit1_Callback(hObject, eventdata, handles)
|
||||
% hObject handle to edit1 (see GCBO)
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles structure with handles and user data (see GUIDATA)
|
||||
|
||||
% Hints: get(hObject,'String') returns contents of edit1 as text
|
||||
% str2double(get(hObject,'String')) returns contents of edit1 as a double
|
||||
value = str2double(get(hObject,'String')) ;
|
||||
|
||||
if(isnan(value)), handles.value=0; end
|
||||
if(~isnan(value)), handles.value=value; end
|
||||
set(handles.text_DISPLAY, 'String',num2str(handles.value));
|
||||
|
||||
guidata(hObject, handles);
|
||||
|
||||
|
||||
% --- Executes during object creation, after setting all properties.
|
||||
function edit1_CreateFcn(hObject, eventdata, handles)
|
||||
% hObject handle to edit1 (see GCBO)
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles empty - handles not created until after all CreateFcns called
|
||||
|
||||
% Hint: edit controls usually have a white background on Windows.
|
||||
% See ISPC and COMPUTER.
|
||||
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
|
||||
set(hObject,'BackgroundColor','white');
|
||||
end
|
||||
|
||||
|
||||
% --- Executes on button press in push_RESET.
|
||||
function push_RESET_Callback(hObject, eventdata, handles)
|
||||
% hObject handle to push_RESET (see GCBO)
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles structure with handles and user data (see GUIDATA)
|
||||
|
||||
set(handles.push_SET, 'Enable','off');
|
||||
set(handles.edit1, 'Enable','off');
|
||||
|
||||
imshow(handles.image,[]),
|
||||
get_coordinates1(hObject, eventdata, handles)
|
||||
|
||||
|
||||
% --- Executes during object creation, after setting all properties.
|
||||
function text_DISPLAY_CreateFcn(hObject, eventdata, handles)
|
||||
% hObject handle to text_DISPLAY (see GCBO)
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles empty - handles not created until after all CreateFcns called
|
||||
409
src/dfp/gui_calibration_1.m
Normal file
@@ -0,0 +1,409 @@
|
||||
function varargout = gui_calibration_1(varargin)
|
||||
% GUI_CALIBRATION_1 MATLAB code for gui_calibration_1.fig
|
||||
% GUI_CALIBRATION_1 by itself, creates a new GUI_CALIBRATION_1 or raises the
|
||||
% existing singleton*.
|
||||
%
|
||||
% H = GUI_CALIBRATION_1 returns the handle to a new GUI_CALIBRATION_1 or the handle to
|
||||
% the existing singleton*.
|
||||
%
|
||||
% GUI_CALIBRATION_1('CALLBACK',hObject,eventData,handles,...) calls the local
|
||||
% function named CALLBACK in GUI_CALIBRATION_1.M with the given input arguments.
|
||||
%
|
||||
% GUI_CALIBRATION_1('Property','Value',...) creates a new GUI_CALIBRATION_1 or raises the
|
||||
% existing singleton*. Starting from the left, property value pairs are
|
||||
% applied to the GUI before gui_calibration_1_OpeningFcn gets called. An
|
||||
% unrecognized property name or invalid value makes property application
|
||||
% stop. All inputs are passed to gui_calibration_1_OpeningFcn via varargin.
|
||||
%
|
||||
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
|
||||
% instance to run (singleton)".
|
||||
%
|
||||
% See also: GUIDE, GUIDATA, GUIHANDLES
|
||||
|
||||
% Edit the above text to modify the response to help gui_calibration_1
|
||||
|
||||
% Last Modified by GUIDE v2.5 02-Jan-2019 13:23:58
|
||||
|
||||
% Begin initialization code - DO NOT EDIT
|
||||
gui_Singleton = 1;
|
||||
gui_State = struct('gui_Name', mfilename, ...
|
||||
'gui_Singleton', gui_Singleton, ...
|
||||
'gui_OpeningFcn', @gui_calibration_1_OpeningFcn, ...
|
||||
'gui_OutputFcn', @gui_calibration_1_OutputFcn, ...
|
||||
'gui_LayoutFcn', [] , ...
|
||||
'gui_Callback', []);
|
||||
if nargin && ischar(varargin{1})
|
||||
gui_State.gui_Callback = str2func(varargin{1});
|
||||
end
|
||||
|
||||
if nargout
|
||||
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
|
||||
else
|
||||
gui_mainfcn(gui_State, varargin{:});
|
||||
end
|
||||
% End initialization code - DO NOT EDIT
|
||||
|
||||
% --- Executes just before gui_calibration_1 is made visible.
|
||||
function gui_calibration_1_OpeningFcn(hObject, eventdata, handles, varargin)
|
||||
% This function has no output args, see OutputFcn.
|
||||
% hObject handle to figure
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles structure with handles and user data (see GUIDATA)
|
||||
% varargin command line arguments to gui_calibration_1 (see VARARGIN)
|
||||
|
||||
% Choose default command line output for gui_calibration_1
|
||||
handles.output = 'Yes';
|
||||
|
||||
% Update handles structure
|
||||
guidata(hObject, handles);
|
||||
|
||||
% Insert custom Title and Text if specified by the user
|
||||
% Hint: when choosing keywords, be sure they are not easily confused
|
||||
% with existing figure properties. See the output of set(figure) for
|
||||
% a list of figure properties.
|
||||
if(nargin > 3)
|
||||
for index = 1:2:(nargin-3),
|
||||
if nargin-3==index, break, end
|
||||
switch lower(varargin{index})
|
||||
case 'title'
|
||||
set(hObject, 'Name', varargin{index+1});
|
||||
case 'string'
|
||||
set(handles.text1, 'String', varargin{index+1});
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
% Determine the position of the dialog - centered on the callback figure
|
||||
% if available, else, centered on the screen
|
||||
FigPos=get(0,'DefaultFigurePosition');
|
||||
OldUnits = get(hObject, 'Units');
|
||||
set(hObject, 'Units', 'pixels');
|
||||
OldPos = get(hObject,'Position');
|
||||
FigWidth = OldPos(3);
|
||||
FigHeight = OldPos(4);
|
||||
if isempty(gcbf)
|
||||
ScreenUnits=get(0,'Units');
|
||||
set(0,'Units','pixels');
|
||||
ScreenSize=get(0,'ScreenSize');
|
||||
set(0,'Units',ScreenUnits);
|
||||
|
||||
FigPos(1)=1/2*(ScreenSize(3)-FigWidth);
|
||||
FigPos(2)=2/3*(ScreenSize(4)-FigHeight);
|
||||
else
|
||||
GCBFOldUnits = get(gcbf,'Units');
|
||||
set(gcbf,'Units','pixels');
|
||||
GCBFPos = get(gcbf,'Position');
|
||||
set(gcbf,'Units',GCBFOldUnits);
|
||||
FigPos(1:2) = [(GCBFPos(1) + GCBFPos(3) / 2) - FigWidth / 2, ...
|
||||
(GCBFPos(2) + GCBFPos(4) / 2) - FigHeight / 2];
|
||||
end
|
||||
FigPos(3:4)=[FigWidth FigHeight];
|
||||
set(hObject, 'Position', FigPos);
|
||||
set(hObject, 'Units', OldUnits);
|
||||
|
||||
% Show a question icon from dialogicons.mat - variables questIconData
|
||||
% and questIconMap
|
||||
load dialogicons.mat
|
||||
|
||||
IconData=questIconData;
|
||||
questIconMap(256,:) = get(handles.figure1, 'Color');
|
||||
IconCMap=questIconMap;
|
||||
|
||||
Img=image(IconData, 'Parent', handles.axes1);
|
||||
set(handles.figure1, 'Colormap', IconCMap);
|
||||
|
||||
set(handles.axes1, ...
|
||||
'Visible', 'off', ...
|
||||
'YDir' , 'reverse' , ...
|
||||
'XLim' , get(Img,'XData'), ...
|
||||
'YLim' , get(Img,'YData') ...
|
||||
);
|
||||
|
||||
% Make the GUI modal
|
||||
set(handles.figure1,'WindowStyle','modal')
|
||||
|
||||
|
||||
|
||||
handles.Y=1;
|
||||
handles.X=1;
|
||||
|
||||
handles.check = 0;
|
||||
handles.theta= 0;
|
||||
handles.a4=0;
|
||||
handles.a5=0;
|
||||
|
||||
|
||||
|
||||
try
|
||||
z=dlmread('calibration.txt');
|
||||
handles.Y=z(2);
|
||||
handles.X=z(1);
|
||||
handles.a4=z(3);
|
||||
handles.a5=z(4);
|
||||
tmp = handles.a4/handles.a5;
|
||||
set(handles.edit_X, 'String',num2str(handles.X));
|
||||
set(handles.edit_Y, 'String',num2str(handles.Y));
|
||||
set(handles.edit_Resolition, 'String',num2str(tmp));
|
||||
catch
|
||||
1234
|
||||
end
|
||||
|
||||
|
||||
handles.state ='No';
|
||||
|
||||
|
||||
guidata(hObject, handles);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
% UIWAIT makes gui_calibration_1 wait for user response (see UIRESUME)
|
||||
uiwait(handles.figure1);
|
||||
|
||||
% --- Outputs from this function are returned to the command line.
|
||||
function varargout = gui_calibration_1_OutputFcn(hObject, eventdata, handles)
|
||||
% varargout cell array for returning output args (see VARARGOUT);
|
||||
% hObject handle to figure
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles structure with handles and user data (see GUIDATA)
|
||||
|
||||
% Get default command line output from handles structure
|
||||
varargout{1} = handles.output;
|
||||
if handles.check ==1; varargout{1} ='Cancel'; end
|
||||
% The figure can be deleted now
|
||||
varargout{2} = handles.theta;
|
||||
varargout{3} = handles.a4;
|
||||
varargout{4} = handles.a5;
|
||||
varargout{5} = handles.state;
|
||||
|
||||
dlmwrite('SessionConst.txt',[handles.theta, handles.a4, handles.a5]);
|
||||
|
||||
guidata(hObject, handles);
|
||||
delete(handles.figure1);
|
||||
|
||||
% --- Executes on button press in push_done.
|
||||
function push_done_Callback(hObject, eventdata, handles)
|
||||
% hObject handle to push_done (see GCBO)
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles structure with handles and user data (see GUIDATA)
|
||||
|
||||
handles.output = get(hObject,'String');
|
||||
|
||||
tmp =atan(handles.X/handles.Y);
|
||||
handles.theta = tmp;
|
||||
|
||||
|
||||
dlmwrite('calibration.txt',[handles.X,handles.Y, handles.a4, handles.a5])
|
||||
% Update handles structure
|
||||
guidata(hObject, handles);
|
||||
|
||||
% Use UIRESUME instead of delete because the OutputFcn needs
|
||||
% to get the updated handles structure.
|
||||
uiresume(handles.figure1);
|
||||
|
||||
% --- Executes on button press in push_cancel.
|
||||
function push_cancel_Callback(hObject, eventdata, handles)
|
||||
% hObject handle to push_cancel (see GCBO)
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles structure with handles and user data (see GUIDATA)
|
||||
|
||||
handles.output = get(hObject,'String');
|
||||
|
||||
% Update handles structure
|
||||
guidata(hObject, handles);
|
||||
|
||||
% Use UIRESUME instead of delete because the OutputFcn needs
|
||||
% to get the updated handles structure.
|
||||
uiresume(handles.figure1);
|
||||
|
||||
|
||||
% --- Executes when user attempts to close figure1.
|
||||
function figure1_CloseRequestFcn(hObject, eventdata, handles)
|
||||
% hObject handle to figure1 (see GCBO)
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles structure with handles and user data (see GUIDATA)
|
||||
|
||||
if isequal(get(hObject, 'waitstatus'), 'waiting')
|
||||
% The GUI is still in UIWAIT, us UIRESUME
|
||||
uiresume(hObject);
|
||||
else
|
||||
% The GUI is no longer waiting, just close it
|
||||
delete(hObject);
|
||||
end
|
||||
|
||||
|
||||
% --- Executes on key press over figure1 with no controls selected.
|
||||
function figure1_KeyPressFcn(hObject, eventdata, handles)
|
||||
% hObject handle to figure1 (see GCBO)
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles structure with handles and user data (see GUIDATA)
|
||||
|
||||
% Check for "enter" or "escape"
|
||||
if isequal(get(hObject,'CurrentKey'),'escape')
|
||||
% User said no by hitting escape
|
||||
handles.output = 'No';
|
||||
|
||||
% Update handles structure
|
||||
guidata(hObject, handles);
|
||||
|
||||
uiresume(handles.figure1);
|
||||
end
|
||||
|
||||
if isequal(get(hObject,'CurrentKey'),'return')
|
||||
uiresume(handles.figure1);
|
||||
end
|
||||
|
||||
|
||||
|
||||
function edit_Y_Callback(hObject, eventdata, handles)
|
||||
% hObject handle to edit_Y (see GCBO)
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles structure with handles and user data (see GUIDATA)
|
||||
|
||||
% Hints: get(hObject,'String') returns contents of edit_Y as text
|
||||
% str2double(get(hObject,'String')) returns contents of edit_Y as a double
|
||||
tmpY= str2double(get(hObject,'String'));
|
||||
handles.Y =tmpY;
|
||||
guidata(hObject, handles);
|
||||
|
||||
|
||||
% --- Executes during object creation, after setting all properties.
|
||||
function edit_Y_CreateFcn(hObject, eventdata, handles)
|
||||
% hObject handle to edit_Y (see GCBO)
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles empty - handles not created until after all CreateFcns called
|
||||
|
||||
% Hint: edit controls usually have a white background on Windows.
|
||||
% See ISPC and COMPUTER.
|
||||
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
|
||||
set(hObject,'BackgroundColor','white');
|
||||
end
|
||||
|
||||
|
||||
|
||||
function edit_X_Callback(hObject, eventdata, handles)
|
||||
% hObject handle to edit_X (see GCBO)
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles structure with handles and user data (see GUIDATA)
|
||||
|
||||
% Hints: get(hObject,'String') returns contents of edit_X as text
|
||||
% str2double(get(hObject,'String')) returns contents of edit_X as a double
|
||||
tmpX = str2double(get(hObject,'String'));
|
||||
handles.X =tmpX;
|
||||
guidata(hObject, handles);
|
||||
|
||||
|
||||
% --- Executes during object creation, after setting all properties.
|
||||
function edit_X_CreateFcn(hObject, eventdata, handles)
|
||||
% hObject handle to edit_X (see GCBO)
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles empty - handles not created until after all CreateFcns called
|
||||
|
||||
% Hint: edit controls usually have a white background on Windows.
|
||||
% See ISPC and COMPUTER.
|
||||
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
|
||||
set(hObject,'BackgroundColor','white');
|
||||
end
|
||||
|
||||
|
||||
% --- Executes when selected object is changed in uibuttongroup1.
|
||||
function uibuttongroup1_SelectionChangedFcn(hObject, eventdata, handles)
|
||||
% hObject handle to the selected object in uibuttongroup1
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles structure with handles and user data (see GUIDATA)
|
||||
c=get(hObject,'String');
|
||||
|
||||
switch(c)
|
||||
case{'Set X and Y values (in cm)'}
|
||||
set(handles.edit_X, 'Enable','on');
|
||||
set(handles.edit_Y, 'Enable','on');
|
||||
|
||||
|
||||
case{'Auto'}
|
||||
handles.check = 2; %1 for Cancel
|
||||
handles.state='Auto';
|
||||
set(handles.edit_X, 'Enable','off');
|
||||
set(handles.edit_Y, 'Enable','off');
|
||||
|
||||
|
||||
% Update handles structure
|
||||
guidata(hObject, handles);
|
||||
end
|
||||
|
||||
|
||||
|
||||
function edit_Resolition_Callback(hObject, eventdata, handles)
|
||||
% hObject handle to edit_Resolition (see GCBO)
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles structure with handles and user data (see GUIDATA)
|
||||
|
||||
% Hints: get(hObject,'String') returns contents of edit_Resolition as text
|
||||
% str2double(get(hObject,'String')) returns contents of edit_Resolition as a double
|
||||
|
||||
|
||||
% --- Executes during object creation, after setting all properties.
|
||||
function edit_Resolition_CreateFcn(hObject, eventdata, handles)
|
||||
% hObject handle to edit_Resolition (see GCBO)
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles empty - handles not created until after all CreateFcns called
|
||||
|
||||
% Hint: edit controls usually have a white background on Windows.
|
||||
% See ISPC and COMPUTER.
|
||||
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
|
||||
set(hObject,'BackgroundColor','white');
|
||||
end
|
||||
|
||||
|
||||
% --- Executes on button press in check_Calculate_RES.
|
||||
function check_Calculate_RES_Callback(hObject, eventdata, handles)
|
||||
% hObject handle to check_Calculate_RES (see GCBO)
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles structure with handles and user data (see GUIDATA)
|
||||
|
||||
% Hint: get(hObject,'Value') returns toggle state of check_Calculate_RES
|
||||
|
||||
if (get(hObject,'Value') )==1
|
||||
i11= imread('im00.tif');
|
||||
[a1,a2,a3,a4]=gui_ask_cal_KNOWN_Point(i11);
|
||||
handles.a5=sqrt((((a3(2)-a3(1))+(a2(2)-a2(1))).^2));
|
||||
handles.a4=a4;
|
||||
end
|
||||
|
||||
set(handles.edit_Resolition, 'String',num2str(handles.a4/handles.a5));
|
||||
|
||||
guidata(hObject, handles);
|
||||
|
||||
|
||||
% --- Executes on button press in check_SetROI.
|
||||
function check_SetROI_Callback(hObject, eventdata, handles)
|
||||
% hObject handle to check_SetROI (see GCBO)
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles structure with handles and user data (see GUIDATA)
|
||||
|
||||
% Hint: get(hObject,'Value') returns toggle state of check_SetROI
|
||||
|
||||
if (get(hObject,'Value') )==1
|
||||
i11= imread('im00.tif');
|
||||
figure(99),
|
||||
h = imshow(i11,[]);
|
||||
title('Crop the ROI')
|
||||
[~, yD ]= imcrop(h);
|
||||
|
||||
if ~isempty(yD)
|
||||
yD= round(yD);
|
||||
% % im1 = im1( yD(2):yD(2)+yD(4),yD(1):yD(1)+yD(3),:);
|
||||
% % im2 = im2( yD(2):yD(2)+yD(4),yD(1):yD(1)+yD(3),:);
|
||||
dlmwrite('CropCordinate.txt',yD);
|
||||
end
|
||||
figure(99),
|
||||
imshow(i11( yD(2):yD(2)+yD(4)-1,yD(1):yD(1)+yD(3)-1,:),[]);
|
||||
pause(0.5); close(99); pause(0.5)
|
||||
|
||||
|
||||
end
|
||||
guidata(hObject, handles);
|
||||
206
src/dfp/gui_confirm_EXIT.m
Normal file
@@ -0,0 +1,206 @@
|
||||
function varargout = gui_confirm_EXIT(varargin)
|
||||
% GUI_CONFIRM_EXIT MATLAB code for gui_confirm_EXIT.fig
|
||||
% GUI_CONFIRM_EXIT by itself, creates a new GUI_CONFIRM_EXIT or raises the
|
||||
% existing singleton*.
|
||||
%
|
||||
% H = GUI_CONFIRM_EXIT returns the handle to a new GUI_CONFIRM_EXIT or the handle to
|
||||
% the existing singleton*.
|
||||
%
|
||||
% GUI_CONFIRM_EXIT('CALLBACK',hObject,eventData,handles,...) calls the local
|
||||
% function named CALLBACK in GUI_CONFIRM_EXIT.M with the given input arguments.
|
||||
%
|
||||
% GUI_CONFIRM_EXIT('Property','Value',...) creates a new GUI_CONFIRM_EXIT or raises the
|
||||
% existing singleton*. Starting from the left, property value pairs are
|
||||
% applied to the GUI before gui_confirm_EXIT_OpeningFcn gets called. An
|
||||
% unrecognized property name or invalid value makes property application
|
||||
% stop. All inputs are passed to gui_confirm_EXIT_OpeningFcn via varargin.
|
||||
%
|
||||
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
|
||||
% instance to run (singleton)".
|
||||
%
|
||||
% See also: GUIDE, GUIDATA, GUIHANDLES
|
||||
|
||||
% Edit the above text to modify the response to help gui_confirm_EXIT
|
||||
|
||||
% Last Modified by GUIDE v2.5 09-Dec-2018 16:23:20
|
||||
|
||||
% Begin initialization code - DO NOT EDIT
|
||||
gui_Singleton = 1;
|
||||
gui_State = struct('gui_Name', mfilename, ...
|
||||
'gui_Singleton', gui_Singleton, ...
|
||||
'gui_OpeningFcn', @gui_confirm_EXIT_OpeningFcn, ...
|
||||
'gui_OutputFcn', @gui_confirm_EXIT_OutputFcn, ...
|
||||
'gui_LayoutFcn', [] , ...
|
||||
'gui_Callback', []);
|
||||
if nargin && ischar(varargin{1})
|
||||
gui_State.gui_Callback = str2func(varargin{1});
|
||||
end
|
||||
|
||||
if nargout
|
||||
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
|
||||
else
|
||||
gui_mainfcn(gui_State, varargin{:});
|
||||
end
|
||||
% End initialization code - DO NOT EDIT
|
||||
|
||||
% --- Executes just before gui_confirm_EXIT is made visible.
|
||||
function gui_confirm_EXIT_OpeningFcn(hObject, eventdata, handles, varargin)
|
||||
% This function has no output args, see OutputFcn.
|
||||
% hObject handle to figure
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles structure with handles and user data (see GUIDATA)
|
||||
% varargin command line arguments to gui_confirm_EXIT (see VARARGIN)
|
||||
|
||||
% Choose default command line output for gui_confirm_EXIT
|
||||
handles.output = 'No';
|
||||
|
||||
% Update handles structure
|
||||
guidata(hObject, handles);
|
||||
|
||||
% Insert custom Title and Text if specified by the user
|
||||
% Hint: when choosing keywords, be sure they are not easily confused
|
||||
% with existing figure properties. See the output of set(figure) for
|
||||
% a list of figure properties.
|
||||
if(nargin > 3)
|
||||
for index = 1:2:(nargin-3),
|
||||
if nargin-3==index, break, end
|
||||
switch lower(varargin{index})
|
||||
case 'title'
|
||||
set(hObject, 'Name', varargin{index+1});
|
||||
case 'string'
|
||||
set(handles.text1, 'String', varargin{index+1});
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
% Determine the position of the dialog - centered on the callback figure
|
||||
% if available, else, centered on the screen
|
||||
FigPos=get(0,'DefaultFigurePosition');
|
||||
OldUnits = get(hObject, 'Units');
|
||||
set(hObject, 'Units', 'pixels');
|
||||
OldPos = get(hObject,'Position');
|
||||
FigWidth = OldPos(3);
|
||||
FigHeight = OldPos(4);
|
||||
if isempty(gcbf)
|
||||
ScreenUnits=get(0,'Units');
|
||||
set(0,'Units','pixels');
|
||||
ScreenSize=get(0,'ScreenSize');
|
||||
set(0,'Units',ScreenUnits);
|
||||
|
||||
FigPos(1)=1/2*(ScreenSize(3)-FigWidth);
|
||||
FigPos(2)=2/3*(ScreenSize(4)-FigHeight);
|
||||
else
|
||||
GCBFOldUnits = get(gcbf,'Units');
|
||||
set(gcbf,'Units','pixels');
|
||||
GCBFPos = get(gcbf,'Position');
|
||||
set(gcbf,'Units',GCBFOldUnits);
|
||||
FigPos(1:2) = [(GCBFPos(1) + GCBFPos(3) / 2) - FigWidth / 2, ...
|
||||
(GCBFPos(2) + GCBFPos(4) / 2) - FigHeight / 2];
|
||||
end
|
||||
FigPos(3:4)=[FigWidth FigHeight];
|
||||
set(hObject, 'Position', FigPos);
|
||||
set(hObject, 'Units', OldUnits);
|
||||
|
||||
% Show a question icon from dialogicons.mat - variables questIconData
|
||||
% and questIconMap
|
||||
load dialogicons.mat
|
||||
|
||||
IconData=questIconData;
|
||||
questIconMap(256,:) = get(handles.figure1, 'Color');
|
||||
IconCMap=questIconMap;
|
||||
|
||||
Img=image(IconData, 'Parent', handles.axes1);
|
||||
set(handles.figure1, 'Colormap', IconCMap);
|
||||
|
||||
set(handles.axes1, ...
|
||||
'Visible', 'off', ...
|
||||
'YDir' , 'reverse' , ...
|
||||
'XLim' , get(Img,'XData'), ...
|
||||
'YLim' , get(Img,'YData') ...
|
||||
);
|
||||
|
||||
% Make the GUI modal
|
||||
set(handles.figure1,'WindowStyle','modal')
|
||||
|
||||
% UIWAIT makes gui_confirm_EXIT wait for user response (see UIRESUME)
|
||||
uiwait(handles.figure1);
|
||||
|
||||
% --- Outputs from this function are returned to the command line.
|
||||
function varargout = gui_confirm_EXIT_OutputFcn(hObject, eventdata, handles)
|
||||
% varargout cell array for returning output args (see VARARGOUT);
|
||||
% hObject handle to figure
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles structure with handles and user data (see GUIDATA)
|
||||
|
||||
% Get default command line output from handles structure
|
||||
varargout{1} = handles.output;
|
||||
|
||||
% The figure can be deleted now
|
||||
delete(handles.figure1);
|
||||
|
||||
% --- Executes on button press in pushbutton1.
|
||||
function pushbutton1_Callback(hObject, eventdata, handles)
|
||||
% hObject handle to pushbutton1 (see GCBO)
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles structure with handles and user data (see GUIDATA)
|
||||
|
||||
handles.output = get(hObject,'String');
|
||||
|
||||
% Update handles structure
|
||||
guidata(hObject, handles);
|
||||
|
||||
% Use UIRESUME instead of delete because the OutputFcn needs
|
||||
% to get the updated handles structure.
|
||||
uiresume(handles.figure1);
|
||||
|
||||
% --- Executes on button press in pushbutton2.
|
||||
function pushbutton2_Callback(hObject, eventdata, handles)
|
||||
% hObject handle to pushbutton2 (see GCBO)
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles structure with handles and user data (see GUIDATA)
|
||||
|
||||
handles.output = get(hObject,'String');
|
||||
|
||||
% Update handles structure
|
||||
guidata(hObject, handles);
|
||||
|
||||
% Use UIRESUME instead of delete because the OutputFcn needs
|
||||
% to get the updated handles structure.
|
||||
uiresume(handles.figure1);
|
||||
|
||||
|
||||
% --- Executes when user attempts to close figure1.
|
||||
function figure1_CloseRequestFcn(hObject, eventdata, handles)
|
||||
% hObject handle to figure1 (see GCBO)
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles structure with handles and user data (see GUIDATA)
|
||||
|
||||
if isequal(get(hObject, 'waitstatus'), 'waiting')
|
||||
% The GUI is still in UIWAIT, us UIRESUME
|
||||
uiresume(hObject);
|
||||
else
|
||||
% The GUI is no longer waiting, just close it
|
||||
delete(hObject);
|
||||
end
|
||||
|
||||
|
||||
% --- Executes on key press over figure1 with no controls selected.
|
||||
function figure1_KeyPressFcn(hObject, eventdata, handles)
|
||||
% hObject handle to figure1 (see GCBO)
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles structure with handles and user data (see GUIDATA)
|
||||
|
||||
% Check for "enter" or "escape"
|
||||
if isequal(get(hObject,'CurrentKey'),'escape')
|
||||
% User said no by hitting escape
|
||||
handles.output = 'No';
|
||||
|
||||
% Update handles structure
|
||||
guidata(hObject, handles);
|
||||
|
||||
uiresume(handles.figure1);
|
||||
end
|
||||
|
||||
if isequal(get(hObject,'CurrentKey'),'return')
|
||||
uiresume(handles.figure1);
|
||||
end
|
||||
232
src/dfp/gui_set_destination.m
Normal file
@@ -0,0 +1,232 @@
|
||||
function varargout = gui_set_destination(varargin)
|
||||
% GUI_SET_DESTINATION MATLAB code for gui_set_destination.fig
|
||||
% GUI_SET_DESTINATION by itself, creates a new GUI_SET_DESTINATION or raises the
|
||||
% existing singleton*.
|
||||
%
|
||||
% H = GUI_SET_DESTINATION returns the handle to a new GUI_SET_DESTINATION or the handle to
|
||||
% the existing singleton*.
|
||||
%
|
||||
% GUI_SET_DESTINATION('CALLBACK',hObject,eventData,handles,...) calls the local
|
||||
% function named CALLBACK in GUI_SET_DESTINATION.M with the given input arguments.
|
||||
%
|
||||
% GUI_SET_DESTINATION('Property','Value',...) creates a new GUI_SET_DESTINATION or raises the
|
||||
% existing singleton*. Starting from the left, property value pairs are
|
||||
% applied to the GUI before gui_set_destination_OpeningFcn gets called. An
|
||||
% unrecognized property name or invalid value makes property application
|
||||
% stop. All inputs are passed to gui_set_destination_OpeningFcn via varargin.
|
||||
%
|
||||
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
|
||||
% instance to run (singleton)".
|
||||
%
|
||||
% See also: GUIDE, GUIDATA, GUIHANDLES
|
||||
|
||||
% Edit the above text to modify the response to help gui_set_destination
|
||||
|
||||
% Last Modified by GUIDE v2.5 05-Oct-2018 17:01:10
|
||||
|
||||
% Begin initialization code - DO NOT EDIT
|
||||
gui_Singleton = 1;
|
||||
gui_State = struct('gui_Name', mfilename, ...
|
||||
'gui_Singleton', gui_Singleton, ...
|
||||
'gui_OpeningFcn', @gui_set_destination_OpeningFcn, ...
|
||||
'gui_OutputFcn', @gui_set_destination_OutputFcn, ...
|
||||
'gui_LayoutFcn', [] , ...
|
||||
'gui_Callback', []);
|
||||
if nargin && ischar(varargin{1})
|
||||
gui_State.gui_Callback = str2func(varargin{1});
|
||||
end
|
||||
|
||||
if nargout
|
||||
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
|
||||
else
|
||||
gui_mainfcn(gui_State, varargin{:});
|
||||
end
|
||||
% End initialization code - DO NOT EDIT
|
||||
|
||||
% --- Executes just before gui_set_destination is made visible.
|
||||
function gui_set_destination_OpeningFcn(hObject, eventdata, handles, varargin)
|
||||
% This function has no output args, see OutputFcn.
|
||||
% hObject handle to figure
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles structure with handles and user data (see GUIDATA)
|
||||
% varargin command line arguments to gui_set_destination (see VARARGIN)
|
||||
|
||||
% Choose default command line output for gui_set_destination
|
||||
handles.output = 'Yes';
|
||||
handles.destination=varargin{1};
|
||||
% set(handles.edit2,'String',handles.destination);
|
||||
set(handles.text2,'String',handles.destination);
|
||||
|
||||
% Update handles structure
|
||||
guidata(hObject, handles);
|
||||
|
||||
% Insert custom Title and Text if specified by the user
|
||||
% Hint: when choosing keywords, be sure they are not easily confused
|
||||
% with existing figure properties. See the output of set(figure) for
|
||||
% a list of figure properties.
|
||||
if(nargin > 3)
|
||||
for index = 1:2:(nargin-3),
|
||||
if nargin-3==index, break, end
|
||||
switch lower(varargin{index})
|
||||
case 'title'
|
||||
set(hObject, 'Name', varargin{index+1});
|
||||
case 'string'
|
||||
set(handles.text1, 'String', varargin{index+1});
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
% Determine the position of the dialog - centered on the callback figure
|
||||
% if available, else, centered on the screen
|
||||
FigPos=get(0,'DefaultFigurePosition');
|
||||
OldUnits = get(hObject, 'Units');
|
||||
set(hObject, 'Units', 'pixels');
|
||||
OldPos = get(hObject,'Position');
|
||||
FigWidth = OldPos(3);
|
||||
FigHeight = OldPos(4);
|
||||
if isempty(gcbf)
|
||||
ScreenUnits=get(0,'Units');
|
||||
set(0,'Units','pixels');
|
||||
ScreenSize=get(0,'ScreenSize');
|
||||
set(0,'Units',ScreenUnits);
|
||||
|
||||
FigPos(1)=1/2*(ScreenSize(3)-FigWidth);
|
||||
FigPos(2)=2/3*(ScreenSize(4)-FigHeight);
|
||||
else
|
||||
GCBFOldUnits = get(gcbf,'Units');
|
||||
set(gcbf,'Units','pixels');
|
||||
GCBFPos = get(gcbf,'Position');
|
||||
set(gcbf,'Units',GCBFOldUnits);
|
||||
FigPos(1:2) = [(GCBFPos(1) + GCBFPos(3) / 2) - FigWidth / 2, ...
|
||||
(GCBFPos(2) + GCBFPos(4) / 2) - FigHeight / 2];
|
||||
end
|
||||
FigPos(3:4)=[FigWidth FigHeight];
|
||||
set(hObject, 'Position', FigPos);
|
||||
set(hObject, 'Units', OldUnits);
|
||||
|
||||
% Show a question icon from dialogicons.mat - variables questIconData
|
||||
% and questIconMap
|
||||
load dialogicons.mat
|
||||
|
||||
IconData=questIconData;
|
||||
questIconMap(256,:) = get(handles.figure1, 'Color');
|
||||
IconCMap=questIconMap;
|
||||
|
||||
Img=image(IconData, 'Parent', handles.axes1);
|
||||
set(handles.figure1, 'Colormap', IconCMap);
|
||||
|
||||
set(handles.axes1, ...
|
||||
'Visible', 'off', ...
|
||||
'YDir' , 'reverse' , ...
|
||||
'XLim' , get(Img,'XData'), ...
|
||||
'YLim' , get(Img,'YData') ...
|
||||
);
|
||||
|
||||
% Make the GUI modal
|
||||
set(handles.figure1,'WindowStyle','modal')
|
||||
|
||||
% UIWAIT makes gui_set_destination wait for user response (see UIRESUME)
|
||||
uiwait(handles.figure1);
|
||||
|
||||
% --- Outputs from this function are returned to the command line.
|
||||
function varargout = gui_set_destination_OutputFcn(hObject, eventdata, handles)
|
||||
% varargout cell array for returning output args (see VARARGOUT);
|
||||
% hObject handle to figure
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles structure with handles and user data (see GUIDATA)
|
||||
|
||||
% Get default command line output from handles structure
|
||||
varargout{1} = handles.output;
|
||||
try
|
||||
varargout{1} = handles.output;
|
||||
varargout{2} = handles.destination;
|
||||
catch
|
||||
end
|
||||
|
||||
% The figure can be deleted now
|
||||
delete(handles.figure1);
|
||||
|
||||
% --- Executes on button press in pushbutton1.
|
||||
function pushbutton1_Callback(hObject, eventdata, handles)
|
||||
% hObject handle to pushbutton1 (see GCBO)
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles structure with handles and user data (see GUIDATA)
|
||||
|
||||
handles.output = get(hObject,'String');
|
||||
|
||||
% Update handles structure
|
||||
guidata(hObject, handles);
|
||||
|
||||
% Use UIRESUME instead of delete because the OutputFcn needs
|
||||
% to get the updated handles structure.
|
||||
uiresume(handles.figure1);
|
||||
|
||||
% --- Executes on button press in pushbutton2.
|
||||
function pushbutton2_Callback(hObject, eventdata, handles)
|
||||
% hObject handle to pushbutton2 (see GCBO)
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles structure with handles and user data (see GUIDATA)
|
||||
|
||||
handles.output = get(hObject,'String');
|
||||
|
||||
% Update handles structure
|
||||
guidata(hObject, handles);
|
||||
|
||||
% Use UIRESUME instead of delete because the OutputFcn needs
|
||||
% to get the updated handles structure.
|
||||
uiresume(handles.figure1);
|
||||
|
||||
|
||||
% --- Executes when user attempts to close figure1.
|
||||
function figure1_CloseRequestFcn(hObject, eventdata, handles)
|
||||
% hObject handle to figure1 (see GCBO)
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles structure with handles and user data (see GUIDATA)
|
||||
|
||||
if isequal(get(hObject, 'waitstatus'), 'waiting')
|
||||
% The GUI is still in UIWAIT, us UIRESUME
|
||||
uiresume(hObject);
|
||||
else
|
||||
% The GUI is no longer waiting, just close it
|
||||
delete(hObject);
|
||||
end
|
||||
|
||||
|
||||
% --- Executes on key press over figure1 with no controls selected.
|
||||
function figure1_KeyPressFcn(hObject, eventdata, handles)
|
||||
% hObject handle to figure1 (see GCBO)
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles structure with handles and user data (see GUIDATA)
|
||||
|
||||
% Check for "enter" or "escape"
|
||||
if isequal(get(hObject,'CurrentKey'),'escape')
|
||||
% User said no by hitting escape
|
||||
handles.output = 'No';
|
||||
|
||||
% Update handles structure
|
||||
guidata(hObject, handles);
|
||||
|
||||
uiresume(handles.figure1);
|
||||
end
|
||||
|
||||
if isequal(get(hObject,'CurrentKey'),'return')
|
||||
uiresume(handles.figure1);
|
||||
end
|
||||
|
||||
|
||||
% --- Executes on button press in push_SetPath.
|
||||
function push_SetPath_Callback(hObject, eventdata, handles)
|
||||
% hObject handle to push_SetPath (see GCBO)
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles structure with handles and user data (see GUIDATA)
|
||||
[pathname] = uigetdir(handles.destination,'Select Destination Folder');
|
||||
handles.destination = pathname;
|
||||
set(handles.text2,'String',handles.destination);
|
||||
guidata(hObject, handles);
|
||||
|
||||
|
||||
% --- Executes during object creation, after setting all properties.
|
||||
function text2_CreateFcn(hObject, eventdata, handles)
|
||||
% hObject handle to text2 (see GCBO)
|
||||
% eventdata reserved - to be defined in a future version of MATLAB
|
||||
% handles empty - handles not created until after all CreateFcns called
|
||||
13
src/dfp/phase_unwrap.m
Normal file
@@ -0,0 +1,13 @@
|
||||
function phi = phase_unwrap(psi)
|
||||
|
||||
dx = [zeros([size(psi,1),1]), wrapToPi(diff(psi, 1, 2)), zeros([size(psi,1),1])];
|
||||
dy = [zeros([1,size(psi,2)]); wrapToPi(diff(psi, 1, 1)); zeros([1,size(psi,2)])];
|
||||
rho = diff(dx, 1, 2) + diff(dy, 1, 1);
|
||||
|
||||
RhoDct = dct2(rho);
|
||||
[N, M] = size(rho);
|
||||
[I, J] = meshgrid(0:M-1, 0:N-1);
|
||||
dctPhi = RhoDct ./ 2 ./ (cos(pi*I/M) + cos(pi*J/N) - 2);
|
||||
dctPhi(1,1) = 0;
|
||||
phi = idct2(dctPhi);
|
||||
|
||||
91
src/dfp/processImage1.m
Normal file
@@ -0,0 +1,91 @@
|
||||
function [data_Org,dataSX]= processImage1(I1, I2,wndo,spectra)
|
||||
|
||||
|
||||
% % I1= handles.I1;
|
||||
% % I2= handles.I2 ;
|
||||
|
||||
%====================================
|
||||
wbar = waitbar(0.6,'Processing...');
|
||||
wbar .CloseRequestFcn = '';
|
||||
|
||||
mask = ones(size(I1));
|
||||
|
||||
%====================================
|
||||
|
||||
ft1 = fftshift(fft2(I1));
|
||||
ft0 =ft1;
|
||||
ft2 = fftshift(fft2(I2));
|
||||
lmt1 = round(size(ft1,2)/2)+10;
|
||||
ft1(:,1:lmt1)=0;
|
||||
ft2(:,1:lmt1)=0;
|
||||
|
||||
[r, c] = find(abs(ft1) == max(abs(ft1(:))));
|
||||
|
||||
lmt= round( (size(ft1,2)/2)+(c- (size(ft1,2)/2))/2);
|
||||
|
||||
ft1(:,1:lmt)=0;
|
||||
ft2(:,1:lmt)=0;
|
||||
|
||||
cdata=ifft2(fftshift(ft2)).*conj(ifft2(fftshift(ft1)));
|
||||
[N,M]=size(ft2);
|
||||
|
||||
[val,fcx]=max(max(abs(ft2)));
|
||||
[val,fcy]=max(max(abs(ft2).'));
|
||||
fcxn=abs((fcx-M/2)/M); fcyn= abs((fcy-N/2)/N);
|
||||
d=sqrt((N/2-fcy).^2+(M/2-fcx).^2);
|
||||
|
||||
|
||||
% ============ Hilbert and freqn domain filtering
|
||||
% %
|
||||
[x y ]= meshgrid(1:size(I1,2),1:size(I1,1));
|
||||
FIL2d=zeros(size(I1));
|
||||
FIL2d(sqrt((x-fcx).^2+(y-fcy).^2)<=d/2)=1;
|
||||
filter2d=fftshift(FIL2d);
|
||||
|
||||
h1=(ifft2(fft2(I1).*filter2d));
|
||||
h2=(ifft2(fft2(I2).*filter2d));
|
||||
|
||||
Complex_Exp=h2.*conj(h1);
|
||||
Ph_est=angle(Complex_Exp);
|
||||
ex=20;
|
||||
|
||||
sigma = 1/wndo;
|
||||
cdata=cdata.*mask;
|
||||
waitbar(0.66,wbar); pause(.2)
|
||||
|
||||
|
||||
if strcmp(spectra,'All Pass')
|
||||
g=WFT2(cdata,wndo,0,sigma,1.5*2*pi*fcxn,wndo,0,sigma,1.5*2*pi*fcyn);
|
||||
elseif strcmp(spectra,'Band Pass')
|
||||
g=WFT2(Complex_Exp,wndo,0,sigma,1.5*2*pi*fcxn,wndo,0,sigma,1.5*2*pi*fcyn);
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
Ph_WFT = (g.phase);
|
||||
Ph_WFT=Ph_WFT(ex:N-ex,ex:M-ex);
|
||||
sx = g.phase;
|
||||
|
||||
%==========================================
|
||||
|
||||
waitbar(0.8,wbar);
|
||||
|
||||
Ph_FT1 = phase_unwrap(sx(ex:N-ex,ex:M-ex));
|
||||
|
||||
% Ph_FT1 =unwrapping(sx,1,5);
|
||||
Ph_FT1=(Ph_FT1-(Ph_FT1(5,5)));
|
||||
dd = dis_peak(ft0);
|
||||
% d=86e-3/1700*dd;
|
||||
[a4a5]=dlmread('SessionConst.txt');
|
||||
d=a4a5(2)/a4a5(3)*dd;
|
||||
theta= a4a5(1);
|
||||
|
||||
Hi = Ph_FT1/(2*pi*(1/d)*tan(theta));
|
||||
dataSX = sx(81:end-80,81:end-80)/(2*pi*(1/d)*tan(theta));
|
||||
|
||||
data_Org=Hi(41:end-40,41:end-40);
|
||||
|
||||
waitbar(1,wbar); pause(0.1)
|
||||
delete(wbar)
|
||||
|
||||
95
src/dfp/processImage2.m
Normal file
@@ -0,0 +1,95 @@
|
||||
function [data_Org,dataSX]= processImage2(I1, I2,wndo,spectra)
|
||||
|
||||
|
||||
% % I1= handles.I1;
|
||||
% % I2= handles.I2 ;
|
||||
|
||||
%====================================
|
||||
wbar = waitbar(0.6,'Processing...');
|
||||
wbar .CloseRequestFcn = '';
|
||||
|
||||
mask = ones(size(I1));
|
||||
|
||||
%====================================
|
||||
|
||||
ft1 = fftshift(fft2(I1));
|
||||
ft0 =ft1;
|
||||
ft2 = fftshift(fft2(I2));
|
||||
lmt1 = round(size(ft1,2)/2)+10;
|
||||
ft1(:,1:lmt1)=0;
|
||||
ft2(:,1:lmt1)=0;
|
||||
|
||||
[r, c] = find(abs(ft1) == max(abs(ft1(:))));
|
||||
|
||||
lmt= round( (size(ft1,2)/2)+(c- (size(ft1,2)/2))/2);
|
||||
|
||||
ft1(:,1:lmt)=0;
|
||||
ft2(:,1:lmt)=0;
|
||||
|
||||
cdata=ifft2(fftshift(ft2)).*conj(ifft2(fftshift(ft1)));
|
||||
[N,M]=size(ft2);
|
||||
|
||||
[val,fcx]=max(max(abs(ft2)));
|
||||
[val,fcy]=max(max(abs(ft2).'));
|
||||
fcxn=abs((fcx-M/2)/M); fcyn= abs((fcy-N/2)/N);
|
||||
d=sqrt((N/2-fcy).^2+(M/2-fcx).^2);
|
||||
|
||||
|
||||
% ============ Hilbert and freqn domain filtering
|
||||
% %
|
||||
[x y ]= meshgrid(1:size(I1,2),1:size(I1,1));
|
||||
FIL2d=zeros(size(I1));
|
||||
FIL2d(sqrt((x-fcx).^2+(y-fcy).^2)<=d/2)=1;
|
||||
filter2d=fftshift(FIL2d);
|
||||
|
||||
h1=(ifft2(fft2(I1).*filter2d));
|
||||
h2=(ifft2(fft2(I2).*filter2d));
|
||||
|
||||
Complex_Exp=h2.*conj(h1);
|
||||
Ph_est=angle(Complex_Exp);
|
||||
ex=20;
|
||||
|
||||
sigma = 1/wndo;
|
||||
cdata=cdata.*mask;
|
||||
waitbar(0.66,wbar); pause(.2)
|
||||
|
||||
% g=wft2f('wfr',cdata,wndo,0,sigma,1.5*2*pi*fcxn,wndo,0,sigma,1.5*2*pi*fcyn,6);
|
||||
% g=WFT2(cdata,wndo,0,sigma,1.5*2*pi*fcxn,wndo,0,sigma,1.5*2*pi*fcyn);
|
||||
|
||||
if strcmp(spectra,'All Pass')
|
||||
g=WFT2(cdata,wndo,0,sigma,1.5*2*pi*fcxn,wndo,0,sigma,1.5*2*pi*fcyn);
|
||||
elseif strcmp(spectra,'Band Pass')
|
||||
g=WFT2(Complex_Exp,wndo,0,sigma,1.5*2*pi*fcxn,wndo,0,sigma,1.5*2*pi*fcyn);
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
% % % % Ph_WFT = (g.phase);
|
||||
% % % % Ph_WFT=Ph_WFT(ex:N-ex,ex:M-ex);
|
||||
sx = g.phase;
|
||||
|
||||
%==========================================
|
||||
|
||||
waitbar(0.8,wbar);
|
||||
|
||||
% Ph_FT1 = cunwrap(sx);
|
||||
Ph_FT1 = phase_unwrap(sx(ex:N-ex,ex:M-ex));
|
||||
|
||||
% Ph_FT1 =unwrapping(sx,1,5);
|
||||
Ph_FT1=(Ph_FT1-(Ph_FT1(5,5)));
|
||||
dd = dis_peak(ft0);
|
||||
% d=86e-3/1700*dd;
|
||||
[a4a5]=dlmread('SessionConst.txt');
|
||||
d=a4a5(2)/a4a5(3)*dd;
|
||||
theta= a4a5(1);
|
||||
|
||||
|
||||
Hi = Ph_FT1/(2*pi*(1/d)*tan(theta));
|
||||
dataSX = sx(81:end-80,81:end-80)/(2*pi*(1/d)*tan(theta));
|
||||
|
||||
data_Org=Hi(41:end-40,41:end-40);
|
||||
|
||||
waitbar(1,wbar); pause(0.1)
|
||||
delete(wbar)
|
||||
|
||||
60
src/dfp/unwrapping.m
Normal file
@@ -0,0 +1,60 @@
|
||||
%unwrapped_phase=unwrapping(original_phase,original_x,original_y);
|
||||
%
|
||||
%This function is to unwrap the phase for comparison use
|
||||
%input the original phase and output the unwrapped phase
|
||||
%original_x,original_y is the starting point, which defaults to the central point of the map
|
||||
|
||||
|
||||
|
||||
function unwrapped_phase=wrap(original_phase,original_x,original_y);
|
||||
|
||||
error(nargchk(1,3,nargin));
|
||||
|
||||
[M,N]=size(original_phase);
|
||||
|
||||
if (nargin==1)
|
||||
original_x=round(M/2);
|
||||
original_y=round(N/2);
|
||||
end
|
||||
if (nargin==2)
|
||||
original_y=original_x;
|
||||
end
|
||||
|
||||
unwrapped_phase=original_phase;
|
||||
|
||||
%fixed row
|
||||
for (j=original_y+1:N)
|
||||
while (unwrapped_phase(original_x,j)-unwrapped_phase(original_x,j-1)>pi)
|
||||
unwrapped_phase(original_x,j)=unwrapped_phase(original_x,j)-2*pi;
|
||||
end
|
||||
while (unwrapped_phase(original_x,j)-unwrapped_phase(original_x,j-1)<-pi)
|
||||
unwrapped_phase(original_x,j)=unwrapped_phase(original_x,j)+2*pi;
|
||||
end
|
||||
end
|
||||
for (j=original_y-1:-1:1)
|
||||
while (unwrapped_phase(original_x,j)-unwrapped_phase(original_x,j+1)>pi)
|
||||
unwrapped_phase(original_x,j)=unwrapped_phase(original_x,j)-2*pi;
|
||||
end
|
||||
while (unwrapped_phase(original_x,j)-unwrapped_phase(original_x,j+1)<-pi)
|
||||
unwrapped_phase(original_x,j)=unwrapped_phase(original_x,j)+2*pi;
|
||||
end
|
||||
end
|
||||
|
||||
for (j=1:N)
|
||||
for (i=original_x+1:M)
|
||||
while (unwrapped_phase(i,j)-unwrapped_phase(i-1,j)>pi)
|
||||
unwrapped_phase(i,j)=unwrapped_phase(i,j)-2*pi;
|
||||
end
|
||||
while (unwrapped_phase(i,j)-unwrapped_phase(i-1,j)<-pi)
|
||||
unwrapped_phase(i,j)=unwrapped_phase(i,j)+2*pi;
|
||||
end
|
||||
end
|
||||
for (i=original_x-1:-1:1)
|
||||
while (unwrapped_phase(i,j)-unwrapped_phase(i+1,j)>pi)
|
||||
unwrapped_phase(i,j)=unwrapped_phase(i,j)-2*pi;
|
||||
end
|
||||
while (unwrapped_phase(i,j)-unwrapped_phase(i+1,j)<-pi)
|
||||
unwrapped_phase(i,j)=unwrapped_phase(i,j)+2*pi;
|
||||
end
|
||||
end
|
||||
end
|
||||
BIN
src/images/CalibrationIcon.png
Normal file
|
After Width: | Height: | Size: 122 KiB |
BIN
src/images/Shan_Logo2.png
Normal file
|
After Width: | Height: | Size: 51 KiB |
BIN
src/images/Shan_Logo3.png
Normal file
|
After Width: | Height: | Size: 9.8 KiB |
BIN
src/images/Shan_Logo4.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
src/images/calib.tif
Normal file
BIN
src/images/height1.png
Normal file
|
After Width: | Height: | Size: 46 KiB |
BIN
src/images/height1.tif
Normal file
BIN
src/images/height11.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
src/images/iisc_logo.png
Normal file
|
After Width: | Height: | Size: 53 KiB |
BIN
src/images/im0.tif
Normal file
BIN
src/images/im00.tif
Normal file
BIN
src/images/im1.tif
Normal file
BIN
src/images/lines.png
Normal file
|
After Width: | Height: | Size: 4.6 KiB |
BIN
src/images/p1.png
Normal file
|
After Width: | Height: | Size: 9.1 KiB |
1
src/txt/CaliObject.txt
Normal file
@@ -0,0 +1 @@
|
||||
3e-3
|
||||
1
src/txt/Checking.txt
Normal file
@@ -0,0 +1 @@
|
||||
34.263,0.21,1900.7,0.30162
|
||||
1
src/txt/CropCordinate.txt
Normal file
@@ -0,0 +1 @@
|
||||
796,256,1752,1824
|
||||
1
src/txt/SessionConst.txt
Normal file
@@ -0,0 +1 @@
|
||||
0.2834,0.17,1944.7
|
||||
1
src/txt/calibration.txt
Normal file
@@ -0,0 +1 @@
|
||||
13.106,45,0.17,1944.7
|
||||
4
src/txt/camset.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
50
|
||||
12
|
||||
-4
|
||||
5710
|
||||
4
src/txt/defaultCamSet.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
50
|
||||
12
|
||||
-4
|
||||
5710
|
||||
1
src/txt/selectCamera.txt
Normal file
@@ -0,0 +1 @@
|
||||
3dFrImager
|
||||