|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.imageterrier.locfile.QLFDocument<F>
F - public class QLFDocument<F extends org.openimaj.feature.local.quantised.QuantisedLocalFeature<?>>
A concrete Document implementation for documents
built up of a list of visual terms in the form of
QuantisedLocalFeatures.
| Nested Class Summary | |
|---|---|
protected class |
QLFDocument.DistEntry
|
| Field Summary | |
|---|---|
protected F |
current
|
protected List<F> |
featureList
|
protected Iterator<F> |
iterator
|
protected Map<String,String> |
props
|
protected String |
termPrefix
|
protected String |
termSuffix
|
| Constructor Summary | |
|---|---|
QLFDocument(byte[] bytes,
Class<F> clz,
String docno,
Map<String,String> extraProps)
Construct a new QLFDocument instance from the contents of the given byte array. |
|
QLFDocument(File file,
Class<F> clz,
String docno,
Map<String,String> extraProps)
Construct a new QLFDocument instance from the contents of the given file. |
|
QLFDocument(List<F> list,
String docno,
Map<String,String> extraProps)
Construct a new QLFDocument instance from the contents of the given feature list. |
|
| Method Summary | |
|---|---|
boolean |
endOfDocument()
|
void |
filter(org.openimaj.math.geometry.shape.Rectangle rect)
Convenience methods to filter all features that have spatial locations outside the given rectangle. |
Map<String,String> |
getAllProperties()
|
int[] |
getCurrentNearestNeighbourTIds(int limit)
Get the spatially nearest neighbouring terms to the current term. |
int[] |
getCurrentNearestNeighbourTIdsKD(int limit)
Get the spatially nearest neighbouring terms to the current term. |
List<F> |
getEntries()
Get the underlying list of features. |
Set<String> |
getFields()
|
org.openimaj.feature.local.Location |
getLocation()
Get the location associated with the current term pointer. |
List<F> |
getNearestNeighbours(F target,
int nNeighbours)
Get the spatially nearest neighbouring terms to the target term. |
int[] |
getNearestNeighboursKD(F target,
int nNeighbours)
Get the spatially nearest neighbouring terms to the target term. |
String |
getNextTerm()
|
String |
getProperty(String name)
|
Reader |
getReader()
|
void |
reset()
Reset the document to its default state, with the current term pointer just before the first term. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected List<F extends org.openimaj.feature.local.quantised.QuantisedLocalFeature<?>> featureList
protected Iterator<F extends org.openimaj.feature.local.quantised.QuantisedLocalFeature<?>> iterator
protected Map<String,String> props
protected String termPrefix
protected String termSuffix
protected F extends org.openimaj.feature.local.quantised.QuantisedLocalFeature<?> current
| Constructor Detail |
|---|
public QLFDocument(File file,
Class<F> clz,
String docno,
Map<String,String> extraProps)
throws IOException
FileLocalFeatureList.
file - the file to readclz - the class of QuantisedLocalFeature.docno - the document identifier or numberextraProps - a map of properties to store in the metadata index
IOException
public QLFDocument(byte[] bytes,
Class<F> clz,
String docno,
Map<String,String> extraProps)
throws IOException
MemoryLocalFeatureList.
bytes - an array of bytes from which to read the features.clz - the class of QuantisedLocalFeature.docno - the document identifier or numberextraProps - a map of properties to store in the metadata index
IOException
public QLFDocument(List<F> list,
String docno,
Map<String,String> extraProps)
list - the feature listdocno - the document identifier or numberextraProps - a map of properties to store in the metadata index| Method Detail |
|---|
public String getNextTerm()
getNextTerm in interface org.terrier.indexing.Documentpublic Set<String> getFields()
getFields in interface org.terrier.indexing.Documentpublic boolean endOfDocument()
endOfDocument in interface org.terrier.indexing.Documentpublic Reader getReader()
getReader in interface org.terrier.indexing.Documentpublic String getProperty(String name)
getProperty in interface org.terrier.indexing.Documentpublic Map<String,String> getAllProperties()
getAllProperties in interface org.terrier.indexing.Documentpublic List<F> getEntries()
public void filter(org.openimaj.math.geometry.shape.Rectangle rect)
rect - the rectangle.public void reset()
public org.openimaj.feature.local.Location getLocation()
public List<F> getNearestNeighbours(F target,
int nNeighbours)
target - the target term.nNeighbours - the number of neighbours.
public int[] getCurrentNearestNeighbourTIds(int limit)
limit - the number of neighbours.
public int[] getNearestNeighboursKD(F target,
int nNeighbours)
target - the target term.nNeighbours - the number of neighbours.
public int[] getCurrentNearestNeighbourTIdsKD(int limit)
limit - the number of neighbours.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||