OpenCV分区()底层算法

时间:2015-07-08 10:26:09

标签: opencv machine-learning cluster-analysis

有人知道使用了哪种算法here

我想实现此功能来进行检测的窗口分组。

谢谢。

1 个答案:

答案 0 :(得分:1)

如果您查看partition函数的OpenCV源代码,您将看到以下注释:

// This function splits the input sequence or set into one or more equivalence classes and
// returns the vector of labels - 0-based class indexes for each element.
// predicate(a,b) returns true if the two sequence elements certainly belong to the same class.
//
// The algorithm is described in "Introduction to Algorithms"
// by Cormen, Leiserson and Rivest, the chapter "Data structures for disjoint sets"
template<typename _Tp, class _EqPredicate> int partition( const vector<_Tp>& _vec, vector<int>& labels, _EqPredicate predicate=_EqPredicate())
{
    // ... etc.
}

这为您提供了源代码和算法的参考。

那就是第21章in this book