Feature
Class WrapperFeatureWindsurfMySQL

java.lang.Object
  extended by Feature.WrapperFeature
      extended by Feature.WrapperFeatureWindsurfMySQL

public class WrapperFeatureWindsurfMySQL
extends WrapperFeature

Implements an utility class for managing Windsurf image features over a MySQL DB.


Field Summary
 
Fields inherited from class Feature.WrapperFeature
feat, timeImgRetrieve
 
Constructor Summary
WrapperFeatureWindsurfMySQL(java.lang.String propFile, java.lang.String tempPath, java.lang.String relPath)
          Initializes the Feature Manager, the Raw Data Manager and the Feature Interface.
 
Method Summary
 void close()
          Closes all connections and deletes active objects.
 Document.ImageID getID(java.lang.String url)
          Checks whether an image with a given URL is contained in the feature DB.
 java.lang.String getImagePath(Document.ImageID id)
          Retrieves the path of an image with a given ID.
 java.util.Vector<QueryProcessor.SF.ScoredResultImage> kNNQuery(Document.ImageID id, int k, QueryProcessor.SF.ScoringFunction.ScoringFunction sf)
          Performs a k-NN query for a given image using a sequential scan.
 Document.Region retrieveRegion(Document.ImageID id)
          Given a region ID retrieves its features from the DB.
 
Methods inherited from class Feature.WrapperFeature
extractImage, getDistance, getFM, getImageURL, getRDM, getResultIDs, getTime, resetTime, retrieveImage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WrapperFeatureWindsurfMySQL

public WrapperFeatureWindsurfMySQL(java.lang.String propFile,
                                   java.lang.String tempPath,
                                   java.lang.String relPath)
Initializes the Feature Manager, the Raw Data Manager and the Feature Interface.

Parameters:
propFile - Path of the Properties file Properties used to store informations about the MySQL DB.
tempPath - Directory used for storing temporary index files.
relPath - Path used as the base directory containing image files.
Method Detail

close

public void close()
Closes all connections and deletes active objects.


retrieveRegion

public Document.Region retrieveRegion(Document.ImageID id)
Given a region ID retrieves its features from the DB.

Parameters:
id - ID of the region to be searched.
Returns:
The requested region or null if such region is not found.

getImagePath

public java.lang.String getImagePath(Document.ImageID id)
Retrieves the path of an image with a given ID.

Parameters:
id - ID of the image to be searched.
Returns:
The path of the image with the given ID, if such image exists, null otherwise.

getID

public Document.ImageID getID(java.lang.String url)
Checks whether an image with a given URL is contained in the feature DB.

Parameters:
url - URL of the image to be searched.
Returns:
The image ID if the image is contained in the DB, an invalid ID otherwise.

kNNQuery

public java.util.Vector<QueryProcessor.SF.ScoredResultImage> kNNQuery(Document.ImageID id,
                                                                      int k,
                                                                      QueryProcessor.SF.ScoringFunction.ScoringFunction sf)
Performs a k-NN query for a given image using a sequential scan.

Parameters:
id - ID of the query image.
k - Number of requested results.
sf - Scoring function to be used.
Returns:
A vector of ScoredResultImages or null if the query image does not exist.