Advertisement
bkit4s0

[harris] figure m file matlab

Dec 25th, 2014
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 5.29 KB | None | 0 0
  1. function varargout = harris_figure(varargin)
  2. % HARRIS_FIGURE M-file for harris_figure.fig
  3. %      HARRIS_FIGURE, by itself, creates a new HARRIS_FIGURE or raises the existing
  4. %      singleton*.
  5. %
  6. %      H = HARRIS_FIGURE returns the handle to a new HARRIS_FIGURE or the handle to
  7. %      the existing singleton*.
  8. %
  9. %      HARRIS_FIGURE('CALLBACK',hObject,eventData,handles,...) calls the local
  10. %      function named CALLBACK in HARRIS_FIGURE.M with the given input arguments.
  11. %
  12. %      HARRIS_FIGURE('Property','Value',...) creates a new HARRIS_FIGURE or raises the
  13. %      existing singleton*.  Starting from the left, property value pairs are
  14. %      applied to the GUI before harris_figure_OpeningFcn gets called.  An
  15. %      unrecognized property name or invalid value makes property application
  16. %      stop.  All inputs are passed to harris_figure_OpeningFcn via varargin.
  17. %
  18. %      *See GUI Options on GUIDE's Tools menu.  Choose "GUI allows only one
  19. %      instance to run (singleton)".
  20. %
  21. % See also: GUIDE, GUIDATA, GUIHANDLES
  22.  
  23. % Edit the above text to modify the response to help harris_figure
  24.  
  25. % Last Modified by GUIDE v2.5 25-Dec-2014 10:39:26
  26.  
  27. % Begin initialization code - DO NOT EDIT
  28. gui_Singleton = 1;
  29. gui_State = struct('gui_Name',       mfilename, ...
  30.                    'gui_Singleton',  gui_Singleton, ...
  31.                    'gui_OpeningFcn', @harris_figure_OpeningFcn, ...
  32.                    'gui_OutputFcn',  @harris_figure_OutputFcn, ...
  33.                    'gui_LayoutFcn',  [] , ...
  34.                    'gui_Callback',   []);
  35. if nargin && ischar(varargin{1})
  36.     gui_State.gui_Callback = str2func(varargin{1});
  37. end
  38.  
  39. if nargout
  40.     [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
  41. else
  42.     gui_mainfcn(gui_State, varargin{:});
  43. end
  44. % End initialization code - DO NOT EDIT
  45.  
  46.  
  47. % --- Executes just before harris_figure is made visible.
  48. function harris_figure_OpeningFcn(hObject, eventdata, handles, varargin)
  49. % This function has no output args, see OutputFcn.
  50. % hObject    handle to figure
  51. % eventdata  reserved - to be defined in a future version of MATLAB
  52. % handles    structure with handles and user data (see GUIDATA)
  53. % varargin   command line arguments to harris_figure (see VARARGIN)
  54.  
  55. % Choose default command line output for harris_figure
  56. handles.output = hObject;
  57.  
  58. % Update handles structure
  59. guidata(hObject, handles);
  60.  
  61. % UIWAIT makes harris_figure wait for user response (see UIRESUME)
  62. % uiwait(handles.figure1);
  63.  
  64.  
  65. % --- Outputs from this function are returned to the command line.
  66. function varargout = harris_figure_OutputFcn(hObject, eventdata, handles)
  67. % varargout  cell array for returning output args (see VARARGOUT);
  68. % hObject    handle to figure
  69. % eventdata  reserved - to be defined in a future version of MATLAB
  70. % handles    structure with handles and user data (see GUIDATA)
  71.  
  72. % Get default command line output from handles structure
  73. varargout{1} = handles.output;
  74.  
  75.  
  76. % --- Executes on button press in btnbutton.
  77. function btnbutton_Callback(hObject, eventdata, handles)
  78. % hObject    handle to btnbutton (see GCBO)
  79. % eventdata  reserved - to be defined in a future version of MATLAB
  80. % handles    structure with handles and user data (see GUIDATA)
  81.  [fname, path] = uigetfile({ '*.bmp', 'Bimap files'; '*.jpg', 'JPEG files'}, 'Please choose an image file');    
  82.     if(fname == 0) return;
  83.     end
  84.     imageFile = [path fname];
  85.     fHandle = findobj('Tag', 'imageFile');
  86.     set(fHandle, 'String', imageFile);    
  87.     axes(gca);cla(gca);
  88.    
  89.     [data map] = imread(imageFile);    
  90.     imshow(data, map);
  91.    
  92.     %save data+map
  93.     handles.imageData = data;
  94.     handles.imageMap = map;
  95.     guidata(hObject, handles);
  96.    
  97.  
  98. % --- Executes on button press in btnst1.
  99. function btnst1_Callback(hObject, eventdata, handles)
  100. % hObject    handle to btnst1 (see GCBO)
  101. % eventdata  reserved - to be defined in a future version of MATLAB
  102. % handles    structure with handles and user data (see GUIDATA)
  103.  
  104.  
  105. % --- Executes on button press in btnst2.
  106. function btnst2_Callback(hObject, eventdata, handles)
  107. % hObject    handle to btnst2 (see GCBO)
  108. % eventdata  reserved - to be defined in a future version of MATLAB
  109. % handles    structure with handles and user data (see GUIDATA)
  110.  
  111.  
  112. % --- Executes on button press in btnst3.
  113. function btnst3_Callback(hObject, eventdata, handles)
  114. % hObject    handle to btnst3 (see GCBO)
  115. % eventdata  reserved - to be defined in a future version of MATLAB
  116. % handles    structure with handles and user data (see GUIDATA)
  117.  
  118.  
  119. % --- Executes on button press in btn4.
  120. function btn4_Callback(hObject, eventdata, handles)
  121. % hObject    handle to btn4 (see GCBO)
  122. % eventdata  reserved - to be defined in a future version of MATLAB
  123. % handles    structure with handles and user data (see GUIDATA)
  124.  
  125.  
  126. % --- Executes on button press in btnst5.
  127. function btnst5_Callback(hObject, eventdata, handles)
  128. % hObject    handle to btnst5 (see GCBO)
  129. % eventdata  reserved - to be defined in a future version of MATLAB
  130. % handles    structure with handles and user data (see GUIDATA)
  131.  
  132.  
  133. % --- Executes on button press in btnst6.
  134. function btnst6_Callback(hObject, eventdata, handles)
  135. % hObject    handle to btnst6 (see GCBO)
  136. % eventdata  reserved - to be defined in a future version of MATLAB
  137. % handles    structure with handles and user data (see GUIDATA)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement