MATLAB matlab人脸识别源码+使用说明+操作说明内容清晰适合新手

news/2024/11/9 1:48:20/

程序运行界面:

部分代码:

function varargout = facerecg(varargin)
% FACERECG MATLAB code for facerecg.fig
%      FACERECG, by itself, creates a new FACERECG or raises the existing
%      singleton*.
%
%      H = FACERECG returns the handle to a new FACERECG or the handle to
%      the existing singleton*.
%
%      FACERECG('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in FACERECG.M with the given input arguments.
%
%      FACERECG('Property','Value',...) creates a new FACERECG or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before facerecg_OpeningFcn gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to facerecg_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 facerecg% Last Modified by GUIDE v2.5 14-May-2021 00:27:13% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...'gui_Singleton',  gui_Singleton, ...'gui_OpeningFcn', @facerecg_OpeningFcn, ...'gui_OutputFcn',  @facerecg_OutputFcn, ...'gui_LayoutFcn',  [] , ...'gui_Callback',   []);
if nargin && ischar(varargin{1})gui_State.gui_Callback = str2func(varargin{1});
endif nargout[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
elsegui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT% --- Executes just before facerecg is made visible.
function facerecg_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 facerecg (see VARARGIN)% Choose default command line output for facerecg
handles.output = hObject;
set(gcf,'name','联系微信:matfun  ');% Update handles structure
guidata(hObject, handles);% UIWAIT makes facerecg wait for user response (see UIRESUME)
% uiwait(handles.figure1);% --- Outputs from this function are returned to the command line.
function varargout = facerecg_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 button press in pushbuttontrain.
function pushbuttontrain_Callback(hObject, eventdata, handles)
% hObject    handle to pushbuttontrain (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)% --- Executes on button press in pushbuttonloadimg.
function pushbuttonloadimg_Callback(hObject, eventdata, handles)
% hObject    handle to pushbuttonloadimg (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)%文件筛选框 选择图片
[filename,pathname] = uigetfile({'*.jpg;*.bmp;*.tif;*.png;*.gif','All Image Files'},'请选择一张图片');
if filename == 0%如果没有选择,直接返回即可return;
end
strfullname = strcat(pathname,filename);%取得图像文件全名I = imread(strfullname);%读取图片
axes(handles.axes1)
imshow(I);%显示图片
title('测试图像')%存入到handles内,以便被别的函数调用
handles.I = I;
handles.faceI = I;
% Update handles structure
guidata(hObject, handles);% --- Executes on button press in pushbuttonfacedetect.
function pushbuttonfacedetect_Callback(hObject, eventdata, handles)
% hObject    handle to pushbuttonfacedetect (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
msgbox('微信:matfun')% --- Executes on button press in pushbuttonalltest.
function pushbuttonalltest_Callback(hObject, eventdata, handles)
% hObject    handle to pushbuttonalltest (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)% --- Executes on button press in pushbuttonreco.
function pushbuttonreco_Callback(hObject, eventdata, handles)
% hObject    handle to pushbuttonreco (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)msgbox('具体请联系微信:matfun')% --- Executes on button press in pushbuttonsave.
function pushbuttonsave_Callback(hObject, eventdata, handles)
% hObject    handle to pushbuttonsave (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)% --- Executes on button press in pushbutton7.
function pushbutton7_Callback(hObject, eventdata, handles)
msgbox('不同版本摄像头调取函数不同,微信:matfun');
return% 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)% --- Executes on button press in pushbutton8.
function pushbutton8_Callback(hObject, eventdata, handles)
msgbox('不同版本摄像头调取函数不同,微信:matfun');
return
global vid
global I
I = getsnapshot(vid);
axes(handles.axes1);
imshow(I)save I
% hObject    handle to pushbutton8 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

整套文件,如需要可自行点击下载:

MATLABmatlab人脸识别源码+使用说明+操作说明内容清晰适合新手资源-CSDN文库https://download.csdn.net/download/m0_71122770/87952148

如何使用:

1、压缩包解压成文件夹以后,放桌面,无须放入MATLAB安装目录里;
2、在MATLAB命令行窗口输入guide,回车,这时候有一个是新建GUI,一个是选择已有的GUI。选择已有GUI选项卡,点击右下角浏览按钮;
3、选择文件夹里面的fig后缀的文件,当问及是否改变路径的时候,选择是。
5、点击绿色三角形运行按钮,开始运行。


http://www.ppmy.cn/news/680956.html

相关文章

利用spleeter库实现人声和音乐分离(踩过的坑及解决方法)

0:起因 事情的起因是:想用一首歌的伴奏剪视频,但找遍各大平台,都只有原曲,没有伴奏。能找到的进行人声和背景音乐分离的软件都要收费,最后决定用spleeter库,尝试进行音频分离。 1:…

如何用【在 ABT 节点上安装】来部署 Blocklet

作者: Matt McKinney 译者: 陈俊 这一演示向你展示如何使用在 ABT 节点上安装选项将任何 Blocklet 直接部署到你的 ABT 节点上。 在 ABT 节点上安装 ArcBlock 区块基石[1] 推出了一项新功能,让所有人都可以轻松地将 Github 中的 Blocklet 直接…

ABT Node:为去中心应用开发带来的范式迁移

作者: 冒志鸿(ArcBlock 首席执行官、首席架构师) 2020 年 5 月 20 日,ArcBlock 区块基石发布 ABT Node 的“技术预览版”(Technical Preview)。 去年 5 月 20 日,我们成功发布了全球第一个去中心…

ABT 链网是怎样建成的? | ArcBlock 博客

题记 昨天,也就是 3 月 29 日,ABT Network(ABT 链网) 正式发布。ABT Network 以完全去中心化方式连接编织多条区块链形成的网络,以云节点和织链为网的方式重新定义了新一代区块链基础架构。本文谈谈 ABT Network 诞生前…

ABT 平台开发两周年 初心愿景更聚焦

时光飞逝,ArcBlock 区块基石平台从 2018 年 5 月第一次能对外提供服务将有两年了。 过去两年里,我们按照《ArcBlock 平台技术白皮书》[1]和路线图有条不紊地推出开放链访问协议(OCAP)[2]、ABT 链网[3]、ABT 链节点[4]、ArcBlock 开…

K8S之可用年限修改

K8S之可用年限修改 1. 查看证书有效期: [rootmaster1 kubernetes]# kubeadm alpha certs check-expiration由上图可见,除了ca根证书,其他证书有效期都是1年。 2. go环境部署: //下载go二进制包 wget https://studygolang.com/…

Maven manual

Download maven Download 设置 system env… E:\apache-maven-3.9.3\bin查看版本信息 mvn -v Apache Maven 3.9.3 (21122926829f1ead511c958d89bd2f672198ae9f) Maven home: E:\apache-maven-3.9.3与Eclipse integrate Referrence,通常Eclipse原本就已经集成&am…

KONICA MINOLTA 501设置扫描文件到电脑

1、电脑安装 FTP Utility 软件开启FTP设置 2、浏览器打开一体机web设置 3、在一体机上操作找到abc组中的 52 机器。