function varargout = MainForm(varargin)
% MAINFORM MATLAB code for MainForm.fig
% MAINFORM, by itself, creates a new MAINFORM or raises the existing
% singleton*.
%
% H = MAINFORM returns the handle to a new MAINFORM or the handle to
% the existing singleton*.
%
% MAINFORM('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in MAINFORM.M with the given input arguments.
%
% MAINFORM('Property','Value',...) creates a new MAINFORM or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before MainForm_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to MainForm_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 MainForm
% Last Modified by GUIDE v2.5 17-Mar-2014 21:27:08
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @MainForm_OpeningFcn, ...
'gui_OutputFcn', @MainForm_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 MainForm is made visible.
function MainForm_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 MainForm (see VARARGIN)
% Choose default command line output for MainForm
handles.output = hObject;
clc;
set(handles.axes1, 'XTick', [], 'YTick', [], ...
'XTickLabel', '', 'YTickLabel', '', 'Color', [0.7020 0.7804 1.0000], 'Box', 'On',...
'xlim', [-1 1], 'ylim', [-1 1]);
set(handles.axes2, 'XTick', [], 'YTick', [], ...
'XTickLabel', '', 'YTickLabel', '', 'Color', [0.7020 0.7804 1.0000], 'Box', 'On',...
'xlim', [-1 1], 'ylim', [-1 1]);
set(handles.axes3, 'XTick', [], 'YTick', [], ...
'XTickLabel', '', 'YTickLabel', '', 'Color', [0.7020 0.7804 1.0000], 'Box', 'On',...
'xlim', [-1 1], 'ylim', [-1 1]);
handles.Ims = 0;
handles.c = 0;
handles.Im = 0;
handles.f = 0;
handles.Img = 0;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes MainForm wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = MainForm_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;
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
% --- 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 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)
filePath = OpenImageFile();
if filePath == 0
return;
end
Img = imread(filePath);
if ndims(Img) == 3
Img = rgb2gray(Img);
end
sz = size(Img);
sz0 = [112 92];
if ~isequal(sz, sz0);
Img = imresize(Img, sz0, 'bilinear');
end
% wh = 600;
% if sz(1) > wh
% rate = wh/sz(1);
% Img = imresize(Img, rate, 'bilinear');
% end
% 显示
imshow(Img, [], 'Parent', handles.axes1);
handles.Img = Img;
handles.sz = size(Img);
guidata(hObject, handles);
% --- 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)
if isequal(handles.Img, 0)
return;
end
f = GetFaceVector(handles.Img);
f = f(1:round(length(f)*0.9));
handles.f = f;
guidata(hObject, handles);
msgbox('降维成功!', '提示信息');
% --- Executes on button press in pushbutton3.
function pushbutton3_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
if isequal(handles.f, 0)
return;
end
Im = QrGen(handles.f);
% 显示
imshow(Im, [], 'Parent', handles.axes2);
handles.Im = Im;
guidata(hObject, handles);
% --- Executes on button press in pushbutton4.
function pushbutton4_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
if isequal(handles.Im, 0)
return;
end
c = QrDen(handles.Im);
set(handles.edit1, 'String', c);
handles.c = c;
guidata(hObject, handles);
% --- Executes on button press in pushbutton5.
function pushbutton5_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton5 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
if isequal(handles.c, 0)
return;
end
Ims = FaceRec(handles.c, handles.sz);
% 显示
imshow(Ims, [], 'Parent', handles.axes3);
handles.Ims = Ims;
guidata(hObject, handles);
% --- Executes on button press in pushbutton6.
function pushbutton6_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton6 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% 清理工作空间
axes(handles.axes1); cla reset;
axes(handles.axes2); cla reset;
axes(handles.axes3); cla reset;
set(handles.axes1, 'XTick', [], 'YTick', [], ...
'XTickLabel', '', 'YTickLabel', '', 'Color', [0.7020 0.7804 1.0000], 'Box', 'On');
set(handles.axes2, 'XTick', [], 'YTick', [], ...
'XTickLabel', '', 'YTickLabel', '', 'Color', [0.7020 0.7804 1.0000], 'Box', 'On');
set(handles.axes3, 'XTick', [], 'YTick', [], ...
'XTickLabel', '', 'YTickLabel', '', 'Color', [0.7020 0.7804 1.0000], 'Box', 'On');
set(handles.edit1, 'String', '');
% --- Executes on button press in pushbutton7.
function pushbutton7_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton7 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
choice = questdlg('确定要退出系统?', ...
'退出', ...
'确定','取消','取消');
没有合适的资源?快使用搜索试试~ 我知道了~
《Matlab计算机视觉与深度学习实战》代码 基于主成分分析的人脸二维码识别.zip
共419个文件
bmp:402个
m:11个
mat:2个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 25 浏览量
2023-07-15
16:31:12
上传
评论
收藏 4.46MB ZIP 举报
温馨提示
《Matlab计算机视觉与深度学习实战》代码
资源推荐
资源详情
资源评论
收起资源包目录
《Matlab计算机视觉与深度学习实战》代码 基于主成分分析的人脸二维码识别.zip (419个子文件)
ORL369.BMP 11KB
ORL080.BMP 11KB
ORL204.BMP 11KB
ORL364.BMP 11KB
ORL291.BMP 11KB
ORL110.BMP 11KB
ORL361.BMP 11KB
ORL054.BMP 11KB
ORL325.BMP 11KB
ORL218.BMP 11KB
ORL130.BMP 11KB
ORL206.BMP 11KB
ORL247.BMP 11KB
ORL282.BMP 11KB
ORL026.BMP 11KB
ORL105.BMP 11KB
ORL132.BMP 11KB
ORL289.BMP 11KB
ORL147.BMP 11KB
ORL344.BMP 11KB
ORL270.BMP 11KB
ORL244.BMP 11KB
ORL115.BMP 11KB
ORL300.BMP 11KB
ORL342.BMP 11KB
ORL269.BMP 11KB
ORL320.BMP 11KB
ORL028.BMP 11KB
ORL069.BMP 11KB
ORL385.BMP 11KB
ORL039.BMP 11KB
ORL175.BMP 11KB
ORL051.BMP 11KB
ORL390.BMP 11KB
ORL277.BMP 11KB
ORL303.BMP 11KB
ORL349.BMP 11KB
ORL016.BMP 11KB
ORL233.BMP 11KB
ORL088.BMP 11KB
ORL081.BMP 11KB
ORL393.BMP 11KB
ORL359.BMP 11KB
ORL015.BMP 11KB
ORL050.BMP 11KB
ORL236.BMP 11KB
ORL155.BMP 11KB
ORL142.BMP 11KB
ORL355.BMP 11KB
ORL394.BMP 11KB
ORL104.BMP 11KB
ORL113.BMP 11KB
ORL193.BMP 11KB
ORL280.BMP 11KB
ORL052.BMP 11KB
ORL040.BMP 11KB
ORL314.BMP 11KB
ORL398.BMP 11KB
ORL024.BMP 11KB
ORL338.BMP 11KB
ORL330.BMP 11KB
ORL124.BMP 11KB
ORL171.BMP 11KB
ORL189.BMP 11KB
ORL311.BMP 11KB
ORL284.BMP 11KB
ORL084.BMP 11KB
ORL228.BMP 11KB
ORL037.BMP 11KB
ORL356.BMP 11KB
ORL169.BMP 11KB
ORL261.BMP 11KB
ORL331.BMP 11KB
ORL251.BMP 11KB
ORL307.BMP 11KB
ORL252.BMP 11KB
ORL106.BMP 11KB
ORL008.BMP 11KB
ORL367.BMP 11KB
ORL063.BMP 11KB
ORL042.BMP 11KB
ORL308.BMP 11KB
ORL085.BMP 11KB
ORL235.BMP 11KB
ORL234.BMP 11KB
ORL256.BMP 11KB
ORL185.BMP 11KB
ORL160.BMP 11KB
ORL131.BMP 11KB
ORL035.BMP 11KB
ORL255.BMP 11KB
ORL161.BMP 11KB
ORL197.BMP 11KB
ORL041.BMP 11KB
ORL263.BMP 11KB
ORL286.BMP 11KB
ORL045.BMP 11KB
ORL075.BMP 11KB
ORL207.BMP 11KB
ORL103.BMP 11KB
共 419 条
- 1
- 2
- 3
- 4
- 5
资源评论
AbelZ_01
- 粉丝: 894
- 资源: 5441
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功