digiKam
kd_tree.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam
4  *
5  * Date : 2019-06-08
6  * Description : Implementation of KD-Tree for vector space partitioning
7  *
8  * Copyright (C) 2020 by Nghia Duong <minhnghiaduong997 at gmail dot com>
9  *
10  * This program is free software; you can redistribute it
11  * and/or modify it under the terms of the GNU General
12  * Public License as published by the Free Software Foundation;
13  * either version 2, or (at your option)
14  * any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * ============================================================ */
22 
23 #ifndef DIGIKAM_KD_TREE_H
24 #define DIGIKAM_KD_TREE_H
25 
26 // Local includes
27 
28 #include "kd_node.h"
29 
30 namespace Digikam
31 {
32 
33 class KDTree
34 {
35 
36 public:
37 
38  explicit KDTree(int dim);
39  ~KDTree();
40 
44  QMap<double, QVector<int> > getClosestNeighbors(const cv::Mat& position,
45  float sqRange,
46  float cosThreshold,
47  int maxNbNeighbors) const;
48 
55  KDNode* add(const cv::Mat& position, const int identity);
56 
57 private:
58 
59  // Disable
60  KDTree(const KDTree&) = delete;
61  KDTree& operator=(const KDTree&) = delete;
62 
63 private:
64 
65  class Private;
66  Private* d;
67 };
68 
69 } // namespace Digikam
70 
71 #endif // DIGIKAM_KD_TREE_H
Definition: kd_node.h:43
Definition: kd_tree.h:34
KDNode * add(const cv::Mat &position, const int identity)
add new node to KD-Tree
Definition: kd_tree.cpp:65
QMap< double, QVector< int > > getClosestNeighbors(const cv::Mat &position, float sqRange, float cosThreshold, int maxNbNeighbors) const
Definition: kd_tree.cpp:87
~KDTree()
Definition: kd_tree.cpp:60
KDTree(int dim)
Definition: kd_tree.cpp:55
Definition: datefolderview.cpp:43
Definition: scan.h:26