资源简介
基于matlab的人脸识别算法,可以识别单个几多个人脸,希望对大家有用哈
代码片段和文件信息
close all
clear all
clc
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%reading an image
tic
I = imread(‘E:\123.png‘);
[IxIyIz]=size(I);
if Ix>400&Iy>300
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%reducing the scale of image let the high is 400
I=imresize(I[400Iy*400/Ix]‘nearest‘);
end
figure
imshow(I)
title(‘normal image‘)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%skin detection
I=double(I); %converting the integer into decimal fraction
[huesv]=rgb2hsv(I); %converting RGB space into HSV space
cb=0.148*I(::1)-0.291*I(::2)+0.439*I(::3)+128;%converting RGB space into YCrCb space
cr=0.439*I(::1)-0.368*I(::2)-0.071*I(::3)+128;
[w h]=size(I(::1)); %size of the image
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%% let the skin pels points in the YCrCb space as 1
for i=1:w
for j=1:h
% segmenting the yellow skin colour areas
if 145<=cr(ij)&cr(ij)<=165&145<=cb(ij)&cb(ij)<=180&0.01<=hue(ij)&hue(ij)<=0.15
segment(ij)=1; %skin areas
else
segment(ij)=0;
end
end
end
figure
imshow(segment);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%% processing on the detected areas
skin=segment;
% removing small connected pixels
skin=bwareaopen(skinround(w*h/900));
%dilating
se=strel(‘disk‘5);
skin=imdilate(skinse);
%%%%%%%%%
- 上一篇:层次聚类matlab程序
- 下一篇:梯度下降拟合算法例程
相关资源
- 层次聚类matlab程序
- rgb2lab程序matlab实现RGB到LAB转换
- 二维图像卷积matlab程序
- BP神经网络时间序列预测matlab代码ma
- 语音信号处理matlab GUI
- 关于四元数法捷联惯导解算算法的m
- matlab均衡器67280
- matlab快速傅里叶变换进行数字图像处
- 电池储能仿真
- matlab实现水平集方法
- matlab 圆形识别并标注
- 车牌字符分割垂直投影切分matlab程序
- LFM及匹配滤波的MATLAB程序
- 多光谱图像融合 matlab.zip
- matlab中仿真自适应信号处理LMSNewton算
- matlab中仿真自适应信号处理LMS算法
- 四步相移法程序
- 基于区域生长的MATLAB实现
- matlab 遗传算法优化BP神经网络程序
- 点云滤波算法 一维双向扫描方法 ma
- matlab游程编码的实现
- 一个搞定Matlab gui编程
- matlab使用混沌序列进行图像加密
- 室内可见光通信光照分布MATLAB代码
- HBV模型matlab源代码
- 手指静脉识别技术 余文波 第九章ma
- MATLAB图像腐蚀和膨胀
- Parafac 有关matlab代码
- C/A产生matlab程序
- matlab连通区域的提取
评论
共有 条评论