基于matlab 的简单人脸识别实例简介人脸识别特指利用分析比较人脸视觉特征信息进行身份鉴别的计算机技术
人脸识别是一项热门的计算机技术讨论领域,在生活中许多领域都有着重要应用
内容这里通过对人脸图像打上网格,对区域块图像做二值分析,通过像素比例来做处理
进而得到人脸区域
代码% By lyqmath% DLUT School of Mathematical Sciences% BLOG:http://blog
net/lyqmathclc; clear all; close all;% 载入图像Img = imread('face
jpg');if ndims(Img) == 3I=rgb2gray(Img);elseI = Img;endBW = im2bw(I, graythresh(I)); % 二值化figure;subplot(2, 2, 1); imshow(Img);title('原图像', 'FontWeight', 'Bold');subplot(2, 2, 2); imshow(Img);title('网格标记图像', 'FontWeight', 'Bold');hold on;[xt, yt] = meshgrid(round(linspace(1, size(I, 1), 10)),
round(linspace(1, size(I, 2), 10)));mesh(yt, xt, zeros(size(xt)), 'FaceColor',
'None', 'LineWidth', 3,
'EdgeColor', 'r');subplot(2, 2, 3); imshow(BW);title('二值图像', 'FontWeight', 'Bold');[n1, n2] = size(BW);r = floor(n1/10)