tesseract  v4.0.0-17-g361f3264
Open Source OCR Engine
KDTreeSearch Class Reference
Collaboration diagram for KDTreeSearch:

Public Member Functions

 KDTreeSearch (KDTREE *tree, float *query_point, int k_closest)
 
 ~KDTreeSearch ()
 
void Search (int *result_count, float *distances, void **results)
 

Private Member Functions

void SearchRec (int Level, KDNODE *SubTree)
 
bool BoxIntersectsSearch (float *lower, float *upper)
 

Private Attributes

KDTREEtree_
 
float * query_point_
 
float * sb_min_
 
float * sb_max_
 
MinK< float, void * > results_
 

Detailed Description

Helper class for searching for the k closest points to query_point in tree.

Constructor & Destructor Documentation

◆ KDTreeSearch()

KDTreeSearch::KDTreeSearch ( KDTREE tree,
float *  query_point,
int  k_closest 
)

◆ ~KDTreeSearch()

KDTreeSearch::~KDTreeSearch ( )

Member Function Documentation

◆ BoxIntersectsSearch()

bool KDTreeSearch::BoxIntersectsSearch ( float *  lower,
float *  upper 
)
private

Return whether the query region (the smallest known circle about query_point_ containing results->k_ points) intersects the box specified between lower and upper. For circular dimensions, we also check the point one wrap distance away from the query.

◆ Search()

void KDTreeSearch::Search ( int *  result_count,
float *  distances,
void **  results 
)

Return the k nearest points' data.

Locate the k_closest points to query_point_, and return their distances and data into the given buffers.

◆ SearchRec()

void KDTreeSearch::SearchRec ( int  level,
KDNODE sub_tree 
)
private

Recursively accumulate the k_closest points to query_point_ into results_.

Parameters
Levellevel in tree of sub-tree to be searched
SubTreesub-tree to be searched

Member Data Documentation

◆ query_point_

float* KDTreeSearch::query_point_
private

◆ results_

MinK<float, void *> KDTreeSearch::results_
private

◆ sb_max_

float* KDTreeSearch::sb_max_
private

◆ sb_min_

float* KDTreeSearch::sb_min_
private

◆ tree_

KDTREE* KDTreeSearch::tree_
private

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