ICSV - Image Color Similarity Visualization
Vienna Technical University - Course 'Visualization 2'. Author: Stefan Spelitz (0925601)
ICSV.Server.DistanceProvider Class Reference

This provider is responsible for calculating Earth Mover Distances between images. It gets notified about new images by the ImageProvider. It works asynchronously and uses multiple threads to effectively calculate the EMDs. More...

Inheritance diagram for ICSV.Server.DistanceProvider:
ICSV.Server.ImageProviderCallback

Public Member Functions

 DistanceProvider (DistanceCallback callback, CancellationToken cancelToken)
 A new instance, using the callback for status updates and the cancellation token in case it gets cancelled. More...
 
int GetImageCount ()
 Returns the current image count this provider has calculated distances for. More...
 
double[][] GetDistanceMatrix (out ImageContainer[] images)
 Returns an 'adjacency' matrix, containing the distances between already calculated images. All images with finished distance calculations are returned in the 'images' out-parameter. More...
 
void addImage (ImageContainer image, bool suppressEvents)
 Manually add an image to calculate distance for. More...
 
void foundImage (ImageContainer image)
 Will be called as soon as an image has been found. The given 'image' is already initialized with all relevant data (e.g. signature, data, color, ...) More...
 
void finished ()
 A previous search has been finished. More...
 
void erroneous (String message)
 An error occurred during searching. More...
 
void info (String message)
 A status update for the current ongoing search. More...
 

Detailed Description

This provider is responsible for calculating Earth Mover Distances between images. It gets notified about new images by the ImageProvider. It works asynchronously and uses multiple threads to effectively calculate the EMDs.

Constructor & Destructor Documentation

ICSV.Server.DistanceProvider.DistanceProvider ( DistanceCallback  callback,
CancellationToken  cancelToken 
)

A new instance, using the callback for status updates and the cancellation token in case it gets cancelled.

Parameters
callbackthe callback for continous status updates
cancelTokenthe cancellation token, controlling the possibility to cancel the provider's work

Member Function Documentation

void ICSV.Server.DistanceProvider.addImage ( ImageContainer  image,
bool  suppressEvents 
)

Manually add an image to calculate distance for.

Parameters
imagethe image to add
suppressEventsIf true, then no calls to the callback will be made.
void ICSV.Server.DistanceProvider.erroneous ( String  message)

An error occurred during searching.

Parameters
messageThe error message

Implements ICSV.Server.ImageProviderCallback.

void ICSV.Server.DistanceProvider.finished ( )

A previous search has been finished.

Implements ICSV.Server.ImageProviderCallback.

void ICSV.Server.DistanceProvider.foundImage ( ImageContainer  image)

Will be called as soon as an image has been found. The given 'image' is already initialized with all relevant data (e.g. signature, data, color, ...)

Parameters
imagethe image which has been found (e.g. on Flickr) and has been initialized

Implements ICSV.Server.ImageProviderCallback.

double [][] ICSV.Server.DistanceProvider.GetDistanceMatrix ( out ImageContainer[]  images)

Returns an 'adjacency' matrix, containing the distances between already calculated images. All images with finished distance calculations are returned in the 'images' out-parameter.

Parameters
imageswill contain all images processed so far
Returns
the distance matrix
int ICSV.Server.DistanceProvider.GetImageCount ( )

Returns the current image count this provider has calculated distances for.

Returns
void ICSV.Server.DistanceProvider.info ( String  message)

A status update for the current ongoing search.

Parameters
messageThe info message

Implements ICSV.Server.ImageProviderCallback.