digiKam
Digikam::KDNode Class Reference

Public Member Functions

double getClosestNeighbors (QMap< double, QVector< int > > &neighborList, const cv::Mat &position, float sqRange, float cosThreshold, int maxNbNeighbors) const
 
int getIdentity ()
 
cv::Mat getPosition () const
 
KDNodeinsert (const cv::Mat &nodePos, const int identity)
 
 KDNode (const cv::Mat &nodePos, const int identity, int splitAxis, int dimension)
 
void setNodeId (int id)
 
 ~KDNode ()
 

Static Public Member Functions

static float cosDistance (const float *const pos1, const float *const pos2, int dimension)
 
static float sqrDistance (const float *const pos1, const float *const pos2, int dimension)
 

Constructor & Destructor Documentation

◆ KDNode()

Digikam::KDNode::KDNode ( const cv::Mat &  nodePos,
const int  identity,
int  splitAxis,
int  dimension 
)
explicit

◆ ~KDNode()

Digikam::KDNode::~KDNode ( )

Member Function Documentation

◆ cosDistance()

float Digikam::KDNode::cosDistance ( const float *const  pos1,
const float *const  pos2,
int  dimension 
)
static

Referenced by getClosestNeighbors().

◆ getClosestNeighbors()

double Digikam::KDNode::getClosestNeighbors ( QMap< double, QVector< int > > &  neighborList,
const cv::Mat &  position,
float  sqRange,
float  cosThreshold,
int  maxNbNeighbors 
) const

Return a list of closest neighbors, limited by maxNbNeighbors and sqRange

References cosDistance(), DBL_MAX, and sqrDistance().

◆ getIdentity()

int Digikam::KDNode::getIdentity ( )

Return identity of the node

◆ getPosition()

cv::Mat Digikam::KDNode::getPosition ( ) const

Return position vector of a node

◆ insert()

KDNode * Digikam::KDNode::insert ( const cv::Mat &  nodePos,
const int  identity 
)

Insert a new node to the sub-tree

◆ setNodeId()

void Digikam::KDNode::setNodeId ( int  id)

Set database entry ID of the node

Referenced by Digikam::OpenCVDNNFaceRecognizer::Private::insertData().

◆ sqrDistance()

float Digikam::KDNode::sqrDistance ( const float *const  pos1,
const float *const  pos2,
int  dimension 
)
static

Referenced by getClosestNeighbors().


The documentation for this class was generated from the following files: