Package boofcv.alg.scene.nister2006
Class LearnNodeWeights<Point>
java.lang.Object
boofcv.alg.scene.nister2006.LearnNodeWeights<Point>
Learns node weights in the
HierarchicalVocabularyTree
for use in RecognitionVocabularyTreeNister2006
by counting the number of unique images a specific node/word appears in then computes the weight using an entropy
like cost function.
Functions must be called in a specific order:
reset(boofcv.alg.scene.vocabtree.HierarchicalVocabularyTree<Point>)
addImage(java.util.List<Point>)
fixate()
addImage(java.util.List<Point>)
.-
Field Summary
Modifier and TypeFieldDescriptionboolean
Sanity check.If a node has more than this number of images passing through it, it's weight is set to 0.protected HierarchicalVocabularyTree<Point>
Tree which has been learned already but with unspecified weights -
Constructor Summary
-
Method Summary
-
Field Details
-
tree
Tree which has been learned already but with unspecified weights -
maximumNumberImagesInNode
If a node has more than this number of images passing through it, it's weight is set to 0. The idea being that there is little information gained by considering this node, but it adds significantly to the cost of searching the tree as many images now need to be considered. -
checkEveryNodeSeenOnce
public boolean checkEveryNodeSeenOnceSanity check. If true it will make sure every node is observed by an image. This is true when the training set and the set of images passed into this are the same. This is set to false by default because in rare situations floating point noise can cause a false positive.
-
-
Constructor Details
-
LearnNodeWeights
public LearnNodeWeights()
-
-
Method Details
-
reset
Initializes and resets with a new tree. Reference to the passed in tree is saved. -
addImage
Adds a new image to the weight computation. It's highly recommended that the same images used to train the tree be added here. This will ensure that all nodes are filled in with a valid weight.- Parameters:
descriptors
- Set of all image feature descriptors for a single image
-
fixate
public void fixate()Call when done. This will compute the weight using an entropy like function: weight[i] = log(N/N[i]) where N[i] is the number of times a specific node/work appears at least once in the images.
-