|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.semanticmetadata.lire.DocumentBuilderFactory
public class DocumentBuilderFactory
System.out.println(">> Indexing " + images.size() + " files.");
DocumentBuilder builder = DocumentBuilderFactory.getExtensiveDocumentBuilder();
IndexWriter iw = new IndexWriter(indexPath, new SimpleAnalyzer(), true);
int count = 0;
long time = System.currentTimeMillis();
for (String identifier : images) {
Document doc = builder.createDocument(new FileInputStream(identifier), identifier);
iw.addDocument(doc);
count ++;
if (count % 25 == 0) System.out.println(count + " files indexed.");
}
long timeTaken = (System.currentTimeMillis() - time);
float sec = ((float) timeTaken) / 1000f;
System.out.println(sec + " seconds taken, " + (timeTaken / count) + " ms per image.");
iw.optimize();
iw.close();
This file is part of the Caliph and Emir project: http://www.SemanticMetadata.net
| Constructor Summary | |
|---|---|
DocumentBuilderFactory()
|
|
| Method Summary | |
|---|---|
static DocumentBuilder |
getColorOnlyDocumentBuilder()
Creates a simple version of a DocumentBuilder. |
static DocumentBuilder |
getDefaultAutoColorCorrelationDocumentBuilder()
Creates a DocumentBuilder for the AutoColorCorrelation feature. |
static DocumentBuilder |
getDefaultDocumentBuilder()
Creates a simple version of a DocumentBuilder. |
static DocumentBuilder |
getExtensiveDocumentBuilder()
Creates a simple version of a DocumentBuilder. |
static DocumentBuilder |
getFastAutoColorCorrelationDocumentBuilder()
Creates a DocumentBuilder for the AutoColorCorrelation feature. |
static DocumentBuilder |
getFastDocumentBuilder()
Creates a simple version of a DocumentBuilder. |
static DocumentBuilder |
getFullDocumentBuilder()
Creates and returns a DocumentBuilder, which contains all available features. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DocumentBuilderFactory()
| Method Detail |
|---|
public static DocumentBuilder getDefaultDocumentBuilder()
SimpleDocumentBuilder is used, only ColorLayout and ScalableColor are
used to index the images. Note that the color histogram weight in
ImageSearcherFactory.createWeightedSearcher(int,float,float,float)
won't have any effect on documents created with a DocumentBuilder like this. Only the color distribution
weight and the texture weight are used in such a case.
SimpleDocumentBuilderpublic static DocumentBuilder getExtensiveDocumentBuilder()
SimpleDocumentBuilder is used,
all available descriptors are used.
SimpleDocumentBuilderpublic static DocumentBuilder getColorOnlyDocumentBuilder()
SimpleDocumentBuilder is used,
only ColorLayout is used. So this can be taken for color only images.
SimpleDocumentBuilderpublic static DocumentBuilder getFastDocumentBuilder()
SimpleDocumentBuilder is used,
only ColorLayout is used to index the images. Note that the weights in
ImageSearcherFactory.createWeightedSearcher(int,float,float,float)
won't have any effect on documents created with a DocumentBuilder like this, as only color distribution is used.
SimpleDocumentBuilderpublic static DocumentBuilder getDefaultAutoColorCorrelationDocumentBuilder()
AutoColorCorrelogram for more information on the image feature.
Be sure to use the same options for the ImageSearcher as you used for the DocumentBuilder.
public static DocumentBuilder getFastAutoColorCorrelationDocumentBuilder()
AutoColorCorrelogram for more information on the image feature.
Be sure to use the same options for the ImageSearcher as you used for the DocumentBuilder.
public static DocumentBuilder getFullDocumentBuilder()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||