有人知道使用了什么算法吗?这里
我想要实现这个函数来执行检测窗口分组。
谢谢。
发布于 2015-07-08 10:41:23
如果您查看OpenCV函数的partition源代码,您将看到以下注释:
// 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章在这本书里。
https://stackoverflow.com/questions/31289929
复制相似问题