Home > other >  Matlab GUI Settings button to switch the next image
Matlab GUI Settings button to switch the next image

Time:10-03

In the opening set the global variable Fun global I

Under the need to each button statement which global I again set I=I + 1

Ps: by using GUI interface manual to determine whether a human face camera
You need to set up start reading button or easily confused with whether
Impossible for us to make the picture is included in the next picture

And storage TXT documents first, then read image
Pay attention to the content and image matching

CodePudding user response:

Eldest brother, can you explain it to the source code

CodePudding user response:

B: yes, you can

The function varargout=untitled (varargin)
% UNTITLED MATLAB code for UNTITLED. FIG
% UNTITLED, by itself, and creates a new UNTITLED or raises the existing
% singleton *.
%
% H=UNTITLED returns the handle to a new UNTITLED or the handle to
% the existing singleton *.
%
% UNTITLED (' CALLBACK 'hObject, eventData, handles,... ) calls the local
% function named CALLBACK in UNTITLED. M with the given input arguments.
%
% UNTITLED (' Property ', 'Value',... ) creates a new UNTITLED or raises the
% existing singleton *. Starting from the left, the property value pairs are
% applied to the GUI before untitled_OpeningFcn gets called. An
% unrecognized property name or invalid value top service property application
% stop. All inputs are passed to untitled_OpeningFcn via varargin.
%
% * See GUI Options on GUIDE 's the Tools menu, Choose "GUI allows only one
% the instance to run (singleton). "
%
% (See also: GUIDE, GUIDATA GUIHANDLES

% Edit the above text to modify the response to help untitled

% Last Modified by GUIDE 21:25:26 v2.5 - Aug 01-2019

% the Begin initialization code - DO NOT EDIT
Gui_Singleton=1;
Gui_State=struct (' gui_Name, mfilename,...
'gui_Singleton' gui_Singleton,...
'gui_OpeningFcn, @ untitled_OpeningFcn,...
'gui_OutputFcn, @ untitled_OutputFcn,...
'gui_LayoutFcn, [],...
'gui_Callback, []);
If nargin & amp; & Ischar (varargin {1})
Gui_State. Gui_Callback=str2func (varargin {1});
End

If nargout
[varargout {1: nargout}]=gui_mainfcn (gui_State, varargin {that});
The else
Gui_mainfcn (gui_State, varargin {that});
End
% End initialization code - DO NOT EDIT


% - Executes just before untitled is made visible.
The function untitled_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 untitled (see varargin)

% Choose the default command line output for untitled
Handles. The output=hObject;

% the Update handles structure
Guidata (hObject, handles);

% UIWAIT top service untitled wait for the user the response (see UIRESUME)
% uiwait (handles. Figure1);
Global I
i=1;

% - the Outputs from this function are returned to the command line.
The function varargout=untitled_OutputFcn (hObject, eventdata, handles)
% varargout cell array for returning the 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)

% the Get the default command line output from handles structure
Varargout {1}=handles. The output;


% - Executes on the button press in pushbutton1.
The 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)
ImgRoot='./z. LFW/' data sets. % of test image path
[imgRoot imnames=dir (' * ' 'JPG']);
Num=length (imnames);

Imagedata=https://bbs.csdn.net/topics/imread ([imgRoot imnames (1). The name]);
% in turn read imageImname=[imgRoot imnames (1). The name (1: end - 4) '].
Axis off % % off axis according to
% % to axes1 open axes1 handle work
The axes (handles. Axes1);
% % in axes1 display images
Imshow (Imagedata)

% - Executes on the button press in pushbutton2.
The 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)
ImgRoot='./z. LFW/' data sets. % of test image path
[imgRoot imnames=dir (' * ' 'JPG']);
Num=length (imnames);

Global I
Fp=fopen ([' E: \ z. result ', '\', imnames (I). The name (1: end - 4), '. TXT '], 'a'); % 'A.t xt file name; 'a' to open the way: in the end of the open file to add data, if the file does not exist, create
J=1, 0] [;
For jj=1:2
Fprintf (fp, "% d", j (jj));
End
Fp % for the file handle, assigned to write data files, note: % d space after



% - Executes on the button press in pushbutton3.
The function pushbutton3_Callback (hObject, eventdata, handles)
% hObject handle to pushbutton3 (see GCBO)
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related