gpt4 book ai didi

OpenCV的partition()底层算法

转载 作者:行者123 更新时间:2023-11-30 09:55:40 24 4
gpt4 key购买 nike

有谁知道使用什么算法here

我想实现这个函数来进行检测的窗口分组。

谢谢。

最佳答案

如果您查看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 .

关于OpenCV的partition()底层算法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31289929/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com