#include "host.h"
#include "cutil.h"
#include "ocrfeatures.h"
Go to the source code of this file.
Classes |
struct | KDNODE |
struct | KDTREE |
Defines |
#define | RootOf(T) ((T)->Root.Left->Data) |
Functions |
KDTREE * | MakeKDTree (inT16 KeySize, const PARAM_DESC KeyDesc[]) |
void | KDStore (KDTREE *Tree, FLOAT32 *Key, void *Data) |
void | KDDelete (KDTREE *Tree, FLOAT32 Key[], void *Data) |
void | KDNearestNeighborSearch (KDTREE *Tree, FLOAT32 Query[], int QuerySize, FLOAT32 MaxDistance, int *NumberOfResults, void **NBuffer, FLOAT32 DBuffer[]) |
void | KDWalk (KDTREE *Tree, void_proc Action, void *context) |
void | FreeKDTree (KDTREE *Tree) |
KDNODE * | MakeKDNode (KDTREE *tree, FLOAT32 Key[], void *Data, int Index) |
void | FreeKDNode (KDNODE *Node) |
FLOAT32 | DistanceSquared (int k, PARAM_DESC *dim, FLOAT32 p1[], FLOAT32 p2[]) |
FLOAT32 | ComputeDistance (int k, PARAM_DESC *dim, FLOAT32 p1[], FLOAT32 p2[]) |
int | QueryInSearch (KDTREE *tree) |
void | Walk (KDTREE *tree, void_proc action, void *context, KDNODE *SubTree, inT32 Level) |
void | InsertNodes (KDTREE *tree, KDNODE *nodes) |
void | FreeSubTree (KDNODE *SubTree) |
Define Documentation
#define RootOf |
( |
|
T | ) |
((T)->Root.Left->Data) |
Function Documentation
void FreeKDNode |
( |
KDNODE * |
Node | ) |
|
void FreeKDTree |
( |
KDTREE * |
Tree | ) |
|
void FreeSubTree |
( |
KDNODE * |
SubTree | ) |
|
This routine deletes a node from Tree. The node to be deleted is specified by the Key for the node and the Data contents of the node. These two pointers must be identical to the pointers that were used for the node when it was originally stored in the tree. A node will be deleted from the tree only if its key and data pointers are identical to Key and Data respectively. The tree is re-formed by removing the affected subtree and inserting all elements but the root.
- Parameters:
-
Tree | K-D tree to delete node from |
Key | key of node to be deleted |
Data | data contents of node to be deleted |
- Note:
- Exceptions: none
-
History: 3/13/89, DSJ, Created. 7/13/89, DSJ, Specify node indirectly by key and data.
void KDNearestNeighborSearch |
( |
KDTREE * |
Tree, |
|
|
FLOAT32 |
Query[], |
|
|
int |
QuerySize, |
|
|
FLOAT32 |
MaxDistance, |
|
|
int * |
NumberOfResults, |
|
|
void ** |
NBuffer, |
|
|
FLOAT32 |
DBuffer[] |
|
) |
| |
This routine stores Data in the K-D tree specified by Tree using Key as an access key.
- Parameters:
-
Tree | K-D tree in which data is to be stored |
Key | ptr to key by which data can be retrieved |
Data | ptr to data to be stored in the tree |
- Note:
- Exceptions: none
-
History: 3/10/89, DSJ, Created. 7/13/89, DSJ, Changed return to void.
Return a new KDTREE based on the specified parameters. Parameters: KeySize # of dimensions in the K-D tree KeyDesc array of params to describe key dimensions
int QueryInSearch |
( |
KDTREE * |
tree | ) |
|