資源簡介
基于膚色模型的人臉檢測程序,通過高斯模型建立相似度函數,再經過最佳閾值法來進行二值化,在經過形態學處理得到人臉區域。
代碼片段和文件信息
close?all
clear?all
clc
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%reading?an?image
%I=imread(‘IMG_0141.JPG‘);????
%I=imread(‘test1.JPG‘);
I?=?imread(‘C:\Users\zhy\Downloads\matlab_bmp2jpeg\girl.JPG‘);
%I?=?imread(‘IMG_0143.JPG‘);
%I?=?imread(‘IMG_0146.JPG‘);
[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;
imwrite(I‘我的圖片.jpg‘‘jpg‘)
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;%co
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????3154??2011-11-01?19:36??detection.m
-----------?---------??----------?-----??----
?????????????????3154????????????????????1
評論
共有 條評論