Skip to content
Jonathon Hare edited this page Feb 25, 2015 · 2 revisions

Introduction

With ImageTerrier we provide two tools to facilitate the integrated construction and search of indexes from the command line. The tools provided are:

  • imageterrier-indexer. Generation of a searchable inverted indexes from a directory of images. Allows specification of feature extraction, codebook generation and index options. The image-specific operations use the OpenIMAJ library modules.

  • imageterrier-searcher. Allows both one off and interactive querying of an index using images. Allows for the specification of searching scheme and consistency measures.

These tools support all major functionality from OpenIMAJ for feature construction, codebook generation and index compilation as well as support for all ImageTerrier search and post-search weighting functions.

On this page we provide an end to end example using the OpenIMAJ FlickrCrawler Tool to download a set of images. We then use the ImageTerrier tools to generate a searchable index and perform some content based queries. Some results are also shown.

Example 1

FlickCrawler

More extensive instructions for the OpenIMAJ FlickrCrawler Tool can be found on the OpenIMAJ wiki. In this example we simply show our settings. The following configuration file is used to perfomr a Flickr crawl.

crawler {
	apikey="<key>",secret="<secret>"
	outputdir="highfield" 
	queryparams {woeId="43761"}
	images {targetSize=["large", "original", "medium"]} 
}

With these crawler settings we ask flickr for a set of images at the where on earth ID (woe_id) for highfield, Southampton, UK. Save this in a file called hampshire.config and call the tool using:

groovy FlickrCrawler.groovy hampshire.config

This results in roughly 3000 images generated in a directory called highfield. Once the set has been downloaded you are ready to construct an ImageTerrier index

ImageTerrier Index

This tool allows specification of: extracted feature type, generated codebook type and various ImageTerrier index options. In this example we generate the default SIFT features and specify that a Random codebook of size 100000 be generated using all extracted features as training samples. We also specify that the cluster generated is BYTE encoded. Using the codebook, the features are quantised and used to construct an index. With this command, a position index is generated, which means that geometric consistency constraints can be applied when searches are performed. The generated codebook is also stored with the index. The image set is now searchable.

To generate this index use the following command:

imageterrier-indexer -o idx -qt RANDOM -p BYTE -k 100000 -t POSITION -pm SPATIAL_SCALE_ORI -nb 8,8,8,8 -mins 0.0,0.0,0.0,-3.14157 -maxs 1000.0,1000.0,150.0,3.14157 highfield

ImageTerrier searcher

Once the index and codebook are generated the directory of images is now searchable. The imageterrier-searcher tool can be used to search indexes with images. The tool provides a useful command line interface for multiple queries, but in this example a single query image is used and 10 results are requested. Furthermore a geometric consistency constraint is specified which guarantees matched terms in two images must have orientation consistency between them.

imageterrier-searcher -i idx -q query.jpg -dr -l 10 -sm CONSISTENT_ORIENTATION

This results in