使用哪种算法训练/预测Opencv LBPH人脸识别器?

时间:2016-05-09 09:11:01

标签: c++ opencv machine-learning computer-vision

我无法理解训练阶段和前奏阶段是如何工作的。在找到LBPH特征后,它是否使用了另一种算法,如svm或k-nearestneighbour?

1 个答案:

答案 0 :(得分:0)

如果您选中:https://github.com/Itseez/opencv_contrib/blob/master/modules/face/src/lbph_faces.cpp 然后你会看到他们使用1最近的邻居,摘自检测功能:

// find 1-nearest neighbor
collector->init((int)_histograms.size(), state);
for (size_t sampleIdx = 0; sampleIdx < _histograms.size(); sampleIdx++) {
    double dist = compareHist(_histograms[sampleIdx], query, HISTCMP_CHISQR_ALT);
    int label = _labels.at<int>((int)sampleIdx);
    if (!collector->collect(label, dist, state))return;
}

使用1最近邻分类器,因为本地二进制模式描述符足够简单。有关该文章的更深入解释,请参阅:“使用本地二进制模式进行人脸识别

旁注。这不是一个实施/实际问题,因此并不属于这个论坛。我建议使用opencv论坛。

相关问题