cbr.service
Class FinderProxy

java.lang.Object
  extended byde.fhg.igd.semoa.service.AbstractService
      extended bycbr.service.FinderProxy
All Implemented Interfaces:
PicsFinder, Service

public class FinderProxy
extends AbstractService
implements PicsFinder

Finds images according in an index. The pictures are seeked by means of the PicsFinder interface via a local service. Instances can be bound to an index instance by means of a constructor. This class serves as a proxy for the index such that the index can implement additional interfaces to which access shall be restricted.

Version:
"$Id: FinderProxy.java 1913 2007-08-08 02:41:53Z jpeters $"
Author:
Volker Roth

Field Summary
private  PicsFinder index_
          The PicsFinder instance from which pictures are retrieved.
 
Fields inherited from class de.fhg.igd.semoa.service.AbstractService
REV_POSTFIX, REV_PREFIX
 
Constructor Summary
FinderProxy()
          Creates an instance.
FinderProxy(PicsFinder index)
          Creates an instance that finds images by means of the given PicsFinder implementation.
 
Method Summary
 String author()
          Returns the name of the author of the service.
 PictureEntry[] find(FeatureVector v, float threshold, int max)
          Matches the given feature vector against the ones of the known Pictures and returns the picture entries of at most max pictures that have a normalised distance less than the given threshold to the query vector.
 PictureEntry[] find(Image im, float threshold, int max)
          Matches the given image against the stored images and returnes the entries of the max most similar pictures known.
 String info()
          Returns the informative string which should describe the service's essence in a sentence.
 String revision()
          Returns the revision number of this class as a string.
 
Methods inherited from class de.fhg.igd.semoa.service.AbstractService
checkDependencies, dependencies, docs, doPrivileged, doPrivileged, getACC, getEnvironment, majorVersion, minorVersion, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

index_

private PicsFinder index_
The PicsFinder instance from which pictures are retrieved.

Constructor Detail

FinderProxy

public FinderProxy()
Creates an instance. This instance must be configured before it can be used.


FinderProxy

public FinderProxy(PicsFinder index)
Creates an instance that finds images by means of the given PicsFinder implementation.

Parameters:
index - The PicsFinder instance from which picture entries are retrieved.
Throws:
NullPointerException - if the given index is null.
Method Detail

author

public String author()
Description copied from class: AbstractService
Returns the name of the author of the service. The format to be used should be John Doe <jdoe@zilch.net>.

Specified by:
author in interface Service
Specified by:
author in class AbstractService
Returns:
the String with the author's name.

revision

public String revision()
Description copied from class: AbstractService
Returns the revision number of this class as a string. This class provides default implementations of methods majorVersion(), minorVersion based on the assumption that this method returns a revision string as generated by rcs(1) for the template "$Revision: 1.7 $/$Date: 2007-08-08 04:41:53 +0200 (Wed, 08 Aug 2007) $".

Specified by:
revision in class AbstractService

info

public String info()
Description copied from class: AbstractService
Returns the informative string which should describe the service's essence in a sentence.

Specified by:
info in interface Service
Specified by:
info in class AbstractService
Returns:
the String with the service's short description.

find

public PictureEntry[] find(Image im,
                           float threshold,
                           int max)
                    throws IOException
Matches the given image against the stored images and returnes the entries of the max most similar pictures known. All returned picture entries represent pictures that have a distance from the query picture that is less than the given threshold. The threshold is normalised in the range [0.0,1.0] where 0 denotes identity (of feature vectors) and 1 denotes infinite distance.

Specified by:
find in interface PicsFinder
Parameters:
im - The query image.
threshold - The maximum distance retrieved pictures are allowed to have from the query image.
max - The maximum number of hits to return.
Throws:
IllegalStateException - if this service is not initialised properly.
IOException

find

public PictureEntry[] find(FeatureVector v,
                           float threshold,
                           int max)
                    throws IOException
Matches the given feature vector against the ones of the known Pictures and returns the picture entries of at most max pictures that have a normalised distance less than the given threshold to the query vector. If the feature vector is not of a supported type then an exception is thrown.

Specified by:
find in interface PicsFinder
Parameters:
v - The feature vector to match known picture entries against.
threshold - The maximum distance a picture in the result set is allowed to have from the query vector.
Throws:
UnsupportedAlgorithmException - if the given feature vector cannot be mapped to the supported ones.
IllegalStateException - if this service is not initialised properly.
IOException


Copyright © Fraunhofer Gesellschaft. All Rights Reserved.