XDcsy / SkinColourDetection

一个使用SPM模型,基于贝叶斯分类器的肤色检测器。 A skin colour detector based on Bayes classifier using SPM(skin probability map) model.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SkinColourDetection

一个简单的肤色区域检测器。A simple skin detection tool using color information.
程序中基于Bayes决策下的SPM模型是根据此文献中2.4.3节“颜色建模方法-直方图法”设计的。
The SPM module using Bayes classifier is designed refering to the 2.4.3 chapter of this paper.

  • train.m
    input: *_skin.tif *_nonskin.tif
    output: SPM.mat
    description:
    从训练用的图片中手动选取出皮肤与非皮肤区域,其它区域擦成透明,分别保存为*_skin.tif*_nonskin.tif。使用tif格式是因为tif格式被matlab读取后,img(:,:,4)即表示透明通道,方便程序判断被选取出的区域。
    在处理时256量化级数的RGB图像被转换为32量化级数,这是因为有文献中指出量化级数为32的模型具有最优的肤色检测综合性能。
    Manually pick up the skin and nonskin spaces in the training images and set the other spaces transparent. Save them as *_skin.tif and *_nonskin.tif. I'm using .tif format because then in matlab, img(:,:,4) represents the Alpha Channel so that it's easy for the program to recogonize the picked spaces.
    While processing, the quantization level of the images is transformed from 256 to 32. It is because a paper points out that using images with 32 quantization levels leads to the best comprehensive efficiency.
  • test.m
    input: SPM.mat *.jpg
    output: *.jpg
    description:
    通过SPM对测试图像进行检测,输出对应的二值图像:检测为皮肤的部分标为纯白、其它部分标为纯黑。
    Use SPM to detect the images and output binary images. The skin pixels are marked with pure white and nonskin pixels with pure black.

About

一个使用SPM模型,基于贝叶斯分类器的肤色检测器。 A skin colour detector based on Bayes classifier using SPM(skin probability map) model.


Languages

Language:MATLAB 100.0%