Package boofcv.alg.feature.describe.llah
Class LlahOperations
java.lang.Object
boofcv.alg.feature.describe.llah.LlahOperations
Locally Likely Arrangement Hashing (LLAH) [1] computes a descriptor for a landmark based on the local geometry of
neighboring landmarks on the image plane. Originally proposed for document retrieval. These features are either
invariant to perspective or affine transforms.
Works by sampling the N neighbors around a point. These ports are sorted in clockwise order. However, it is not known which points should be first so all cyclical permutations of set-N are now found. It is assumed that at least M points in set M are a member of the set used to compute the feature, so all M combinations of points in set-N are found. Then the geometric invariants are computed using set-M.
When describing the documents the hash and invariant values of each point in a document is saved. When looking up documents these features are again computed for all points in view, but then the document type is voted upon and returned.
- Nakai, Tomohiro, Koichi Kise, and Masakazu Iwamura. "Use of affine invariants in locally likely arrangement hashing for camera-based document image retrieval." International Workshop on Document Analysis Systems. Springer, Berlin, Heidelberg, 2006.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Used to relate observed dots to landmarks in a documentstatic class
static class
static class
Documents that were found to match observed dots -
Constructor Summary
ConstructorDescriptionLlahOperations
(int numberOfNeighborsN, int sizeOfCombinationM, LlahHasher hasher) Configures the LLAH feature computation -
Method Summary
Modifier and TypeMethodDescriptionvoid
Forgets all the documents and recycles datalong
Computes the maximum number of unique hash code a point can have.createDocument
(List<Point2D_F64> locations2D) Creates a new document from the 2D points.void
learnHashing
(Iterable<List<Point2D_F64>> pointSets, int numDiscrete, int histogramLength, double maxInvariantValue) Learns the hashing function from the set of point setsboolean
lookUpDocument
(List<Point2D_F64> dots, LlahOperations.FoundDocument output) Place holder function for the document retrieval in the LLAH paper.void
lookupDocuments
(List<Point2D_F64> dots, int minLandmarks, List<LlahOperations.FoundDocument> output) Looks up all the documents which match observed features.
-
Constructor Details
-
LlahOperations
Configures the LLAH feature computation- Parameters:
numberOfNeighborsN
- Number of neighbors to be consideredsizeOfCombinationM
- Number of different combinations within the neighborshasher
- Computes the hash code
-
-
Method Details
-
clearDocuments
public void clearDocuments()Forgets all the documents and recycles data -
learnHashing
public void learnHashing(Iterable<List<Point2D_F64>> pointSets, int numDiscrete, int histogramLength, double maxInvariantValue) Learns the hashing function from the set of point sets- Parameters:
pointSets
- Point sets. Each set represents one documentnumDiscrete
- Number of discrete values the invariant is converted tohistogramLength
- Number of elements in the histogram. 100,000 is recommendedmaxInvariantValue
- The maximum number of value an invariant is assumed to have. For affine ~25. Cross Ratio
-
createDocument
Creates a new document from the 2D points. The document and points are added to the hash table for later retrieval.- Parameters:
locations2D
- Location of points inside the document- Returns:
- The document which was added to the hash table.
-
computeMaxUniqueHashPerPoint
public long computeMaxUniqueHashPerPoint()Computes the maximum number of unique hash code a point can have. -
lookupDocuments
public void lookupDocuments(List<Point2D_F64> dots, int minLandmarks, List<LlahOperations.FoundDocument> output) Looks up all the documents which match observed features.- Parameters:
dots
- Observed feature locationsminLandmarks
- Minimum number of landmarks that are assigned to a document for it to be acceptedoutput
- Storage for results. WARNING: Results are recycled on next call!
-
lookUpDocument
Place holder function for the document retrieval in the LLAH paper. Just throws an exception for now.- Parameters:
dots
- observed dotsoutput
- storage for found document- Returns:
- true if successful
-