Lire - Lucene Image REtrieval

Lire is a simple way to create a Lucene index of image features for content based image retrieval.
Download

Lire - Lucene Image REtrieval Ranking & Summary

Advertisement

  • Rating:
  • License:
  • GPL
  • Price:
  • FREE
  • Publisher Name:
  • Lire Team
  • Publisher web site:
  • http://www.semanticmetadata.net/lire/

Lire - Lucene Image REtrieval Tags


Lire - Lucene Image REtrieval Description

Lire is a simple way to create a Lucene index of image features for content based image retrieval. Lire, the Lucene Image REtrieval library is a simple way to create a Lucene index of image features for content based image retrieval (CBIR).The used features are taken from the MPEG-7 Standard: ScalableColor, ColorLayout and EdgeHistogram. Furthermore methods for searching the index are provided.The LIRE library is part of the Caliph & Emir project and aims to provide the CBIR features of Caliph & Emir to other Java projects in an easy and light weight way.Creating an IndexUse DocumentBuilderFactory to create a DocumentBuilder, which will create Lucene Documents from images. Add this documents to an index like this: 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();Searching in an IndexUse the ImageSearcherFactory for creating an ImageSearcher, which will retrieve the images for you from the index. IndexReader reader = IndexReader.open(indexPath); ImageSearcher searcher = ImageSearcherFactory.createDefaultSearcher(); FileInputStream imageStream = new FileInputStream("image.jpg"); BufferedImage bimg = ImageIO.read(imageStream); // searching for an image: ImageSearchHits hits = null; hits = searcher.search(bimg, reader); for (int i = 0; i < 5; i++) { System.out.println(hits.score(i) + ": " + hits.doc(i).getField(DocumentBuilder.FIELD_NAME_IDENTIFIER).stringValue()); } // searching for a document: Document document = hits.doc(0); hits = searcher.search(document, reader); for (int i = 0; i < 5; i++) { System.out.println(hits.score(i) + ": " + hits.doc(i).getField(DocumentBuilder.FIELD_NAME_IDENTIFIER).stringValue()); } What's New in This Release: · It fixes a lot of bugs and introduces several new features including a new descriptor, a simplified way to use descriptors by introducing new generic searchers and indexers, as well as a generalized interface for image descriptors. · There are also several improvements in indexing and search speed. · Furthermore, retrieval performance was optimized based on the Wang 1000 data set. · All new features have also found their way into LireDemo.


Lire - Lucene Image REtrieval Related Software