-
Notifications
You must be signed in to change notification settings - Fork 9
RetrievalIndexer: index image
loic911 edited this page Nov 24, 2014
·
1 revision
An indexer is a little client that add/delete pictures on a specific server. The indexer can purge, list images and storages too.
Each image must be indexed on a server before appearing in the CBIR results.
./indexer host port image synchrone storage id propertiesKeys propertiesValue
Example:
./indexer.sh localhost 1234 http://personalphdenis.appspot.com/images/cbir.png
./indexer.sh test 123 http://personalphdenis.appspot.com/images/cbir.png true abc 56 date,path 20141122,cbir.png
| index | name | description | type |
|---|---|---|---|
| 0 | Host | A RetrievalServer host | String |
| 1 | Port | A RetrievalServer port | String |
| 2 | Picture URI | An image URI (File or URL) | Long |
| 3 | Synchrone (Optional) | If false, indexer just add the image on the index queue. Otherwise, the indexer will wait until the server index the image. | Boolean |
| 4 | Storage name (Optional) | The storage name. Use '###EQUITABLY###' to index image on a random storage. If you create N storage, its better to have storage with more or less the same size. | String |
| 5 | Picture id (Optional) | The image will be indexed with this id. An id must be unique for a server. | Long |
| 6 | Picture properties keys (Optional) | A list of properties keys (comma sep) e.g.: ' name,date,path' | String |
| 7 | Picture properties values (Optional) | A list of properties value (comma sep) e.g.: ' 123,test,2014/10/31,/home/myself/mypicture.png' | String |
Link to the javadoc: TODO
Object Server
public RetrievalIndexerLocalStorage(Storage storage, boolean synchronous)
- storage: index name where the image will be indexed.
- synchronous: if false, indexer just add the image on the index queue You can use the RetrievalIndexerDistantStorage to index a picture in a distant server.
Example
boolean sync = true;
RetrievalServer server = ...
RetrievalIndexer index = new RetrievalIndexerLocalStorage(server.getStorage(“0”),sync); // server.getNextStorage() to take a random storage
Distant Server
public RetrievalIndexerDistantStorage(String host, int port, String storage, boolean synchronous)
The index method takes the image (File, URL or BufferedImage), an id (optional) and a properties map (optional)
Long index.index(File file)
Long index.index(File file, Map<String,String> properties)
Long index.index(File file, Long id)
Long index.index(File file, Long id, Map<String,String> properties)
Long index.index(URL url)
Long index.index(URL url, Map<String,String> properties)
Long index.index(URL url, Long id)
Long index.index(URL url, Long id, Map<String,String> properties)
Long index.index(BufferedImage img)
Long index.index(BufferedImage img, Map<String,String> properties)
Long index.index(BufferedImage img, Long id)
Long index.index(BufferedImage img, Long id, Map<String,String> properties)
Documentation:
- Home/Quickstart
- License/Authors
- How to run a server
- How to index an image
- How to search for similar images
- How to delete an image
- How to list images
- How to list storages
- How to use Redis as database
- How to have an HTTP REST API
- [How to improve performance] (https://github.com/loic911/CBIRetrieval/wiki/Improve-perf)
- How to have a distribued architecture