简体   繁体   English

使用 LBPH 进行面部检测 - 提取特征

[英]Facial Detection with LBPH - Extracting Features

I've created the the framework of the system, which takes a picture, converts it to an LBPH image, and then gets the histograms from each tile of the grid(8x8).我已经创建了系统框架,它拍摄一张照片,将其转换为 LBPH 图像,然后从网格的每个图块(8x8)中获取直方图。 I'm following this paper on it, but am confused what to do next to identify features after step 4. Do I just compare each square of the grid with a set of known feature squares and find the closest match?我正在关注这篇论文,但我很困惑在第 4 步之后下一步要做什么来识别特征。我是否只需将网格的每个正方形与一组已知特征正方形进行比较并找到最接近的匹配? This is my first facial detection program so I'm very new to it.这是我的第一个面部检测程序,所以我对它很陌生。

So basically image processing works like this.所以基本上图像处理是这样工作的。 Pixel intensity values are way too variant and uninformative by themselves to be useful for algorithms to make sense of an image.像素强度值本身变化太大且信息不足,无法用于算法理解图像。 Much more useful is the local relationships between pixel intensity values So image processing for recognition, detection is basically a 2-step process.更有用的是像素强度值之间的局部关系因此用于识别的图像处理,检测基本上是一个两步过程。

  1. Feature Extraction - Transform the low-level, high variance, uninformative features such as pixel intensities into a high-level, lower variance, more informative feature set (eg edges, visual patterns, etc.) this is referred to as feature extraction .特征提取- 将低级、高方差、无信息特征(如像素强度)转换为高级、低方差、信息量更大的特征集(例如边缘、视觉图案等),这称为特征提取 Over the years, there have been a number of feature extraction mechanisms suggested such as edge detection with Sobel filters, histogram of oriented gradients (HOG), Haar-like features, Scale invariant features (SIFTS) and LBPH as you are trying to use.多年来,已经提出了许多特征提取机制,例如使用 Sobel 滤波器进行边缘检测、定向梯度直方图 (HOG)、类似 Haar 的特征、尺度不变特征 (SIFTS) 和您尝试使用的 LBPH。 (Note that in most modern applications that are not computationally limited, convolutional neural networks (CNNs) are used for the feature extraction step because they empirically work much much better. (请注意,在大多数不受计算限制的现代应用程序中,卷积神经网络(CNN)用于特征提取步骤,因为它们在经验上工作得更好。

  2. Use Transformed Features - once more useful information (a more informative set of features) has been extracted, you need to use these features to perform the reasoning operation you're hoping to accomplish.使用转换后的特征- 一旦提取了更多有用的信息(一组信息量更大的特征),您需要使用这些特征来执行您希望完成的推理操作。 In this step, you fit a model (function approximator) such that given your high-level features as an input, the model outputs the information you want (in this case a classification on whether an image contains a face I think).在此步骤中,您将安装 model(函数逼近器),以便将您的高级特征作为输入,model 输出您想要的信息(在这种情况下,是关于图像是否包含我认为的面部的分类)。 Thus, you need to select and fit a model that can make use of the high-level features for classification.因此,您需要 select 并安装一个可以利用高级特征进行分类的 model。 Some classic approaches to this include decision trees, support vector machines, and neural networks.一些经典的方法包括决策树、支持向量机和神经网络。 Essentially, model fitting is a standard machine learning problem, and will require using a labelled set of training data to "teach" the model what the high-level feature set will look like for an image that contains a face, versus an image that does not.从本质上讲,model 拟合是一个标准的机器学习问题,需要使用一组标记的训练数据来“教”model 高级特征集对于包含人脸的图像的外观,而不是包含人脸的图像不是。

It sounds like your code in its current state is missing the second piece.听起来您当前 state 中的代码缺少第二部分。 As a good starting place, look into using sci-kit learn's decision tree package.作为一个好的起点,研究使用 sci-kit learn 的决策树 package。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM