在 FLANN 模块中,KDTree 构造函数采用配置参数来创建树。我看到默认值为 4。有人可以建议为什么 4 或为什么最近邻居搜索需要多棵树吗?
/**
* KDTree constructor
*
* Params:
* inputData = dataset with the input features
* params = parameters passed to the kdtree algorithm
*/
KDTreeIndex(const Matrix<ElementType>& inputData, const IndexParams& params = KDTreeIndexParams(),
Distance d = Distance() ) :
dataset_(inputData), index_params_(params), distance_(d)
{
size_ = dataset_.rows;
veclen_ = dataset_.cols;
trees_ = get_param(index_params_,"trees",4); <<<<------------------ default 4
tree_roots_ = new NodePtr[trees_];
// Create a permutable array of indices to the input vectors.
vind_.resize(size_);
for (size_t i = 0; i < size_; ++i) {