/elasticsearch-image

Content Based Image Retrieval Plugin for Elasticsearch. It allows users to index images and search for similar images.

Primary LanguageJavaApache License 2.0Apache-2.0

Image Plugin for Elasticsearch

Build Status License GitHub release

The Image Plugin is an Content Based Image Retrieval Plugin for Elasticsearch using LIRE (Lucene Image Retrieval). It allows users to index images and search for similar images.

It adds an image field type and an image query

In order to install the plugin, simply run: bin\plugin install zengde/elasticsearch-image.

Image Plugin elasticsearch Release date
2.2.0dev 2.2.0 2016-04-21
2.1.1dev 2.1.1 2016-04-03
2.1.1 2.1.1 2016-02-23
1.3.0-SNAPSHOT (master) 1.1.0
1.2.0 1.0.1 2014-03-20
1.1.0 1.0.1 2014-03-13
1.0.0 1.0.1 2014-03-05

Example

Create Mapping

curl -XPUT 'localhost:9200/test/test/_mapping' -d '{
    "test": {
		"_source": {
            "excludes": ["my_img"]
        },
        "properties": {
            "my_img": {
                "type": "image",
                "feature": ["CEDD","JCD","FCTH"],
                "hash":"BitSampling",
                "store":false
            },
            "name": {
                "type": "string",
                "index": "not_analyzed"
            }
        }
    }
}'

type should be image. Mandatory

feature is a map of features for index. Mandatory, at least one is required

hash can be set if you want to search on hash. Optional

Index Image

curl -XPOST 'localhost:9200/test/test' -d '{
    "my_img": "... base64 encoded image ..."
}'

Search Image

curl -XPOST 'localhost:9200/test/test/_search' -d '{
    "query": {
        "image": {
            "my_img": {
                "feature": "CEDD",
                "image": "... base64 encoded image to search ...",
                "hash": "BIT_SAMPLING"
            }
        }
    }
}'

feature should be one of the features in the mapping. Mandatory

image base64 of image to search. Optional if search using existing image

hash should be same to the hash set in mapping. Optional

boost score boost Optional

Supported Features

####Global Features: SIMPLE_CENTRIST, SPATIAL_PYRAMID_CENTRIST, JOINT_HISTOGRAM, LOCAL_BINARY_PATTERNS_AND_OPPONENT, RANK_AND_OPPONENT, SPACC, SPCEDD, SPFCTH, SPJCD, SPLBP, AUTO_COLOR_CORRELOGRAM, BINARY_PATTERNS_PYRAMID, CEDD, COLOR_LAYOUT, EDGE_HISTOGRAM, FCTH, FUZZY_COLOR_HISTOGRAM, FUZZY_OPPONENT_HISTOGRAM, GABOR, JCD, JPEG_COEFFICIENT_HISTOGRAM, LOCAL_BINARY_PATTERNS, LUMINANCE_LAYOUT, OPPONENT_HISTOGRAM, PHOG, ROTATION_INVARIANT_LOCAL_BINARY_PATTERNS, SCALABLE_COLOR, SIMPLE_COLOR_HISTOGRAM, TAMURA

Supported Hash Mode

BitSampling, LSH, MetricSpaces

Hash will increase search speed with large data sets

See Large image data sets with LIRE ?some new numbers

ChangeLog

2.1.1dev (2016-04-03)

  • change mapping and search rest format and ralated code
  • change indexed image document structure
  • upgrade to LIRE1.0b2 , new Hash mode MetricSpaces and some Features
  • change buld tools to gradle
  • remove redundant files

2.1.1 (2016-02-23)

  • support es 2.1.1

1.2.0 (2014-03-20)

  • Use multi-thread when multiple features are required to improve index speed
  • Allow index metadata
  • Allow query by existing image in index

1.1.0 (2014-03-13)

  • Added limit in image query
  • Added plugin version in es-plugin.properties

1.0.0 (2014-03-05)

  • initial release