w2img::ImageComparator Class Reference

Inheritance diagram for w2img::ImageComparator:

w2img::ProbabilisticImageComparator w2kmeans::ObjectImageComparator List of all members.

Detailed Description

Compares two images and gives estimates of how much image b resembles image a (the first input to all the score methods is assumed to be the real thing and the second an estimate).

Images that are invalid in both images do not contribute to the denominator of the mean square error etc. For further information on the algorithm used, see the documentation of Score::updateScore

Author:
Lakshman
Version:
Id
w2img_ImageComparator.h,v 1.13 2009/06/02 20:17:57 lakshman Exp


Public Member Functions

 ImageComparator (double minValue, double maxValue, bool maxIsBetter, const std::vector< code::Image< float > > &kernels, size_t searchDistance=0, bool includeNulls=false)
 Compare two images.
virtual ~ImageComparator ()
std::vector< Scorescore (const code::CartesianGrid2D &orig, const code::CartesianGrid2D &fil) const
 the two images should be of identical sizes.
std::vector< Scorescore (const code::LatLonGrid &orig, const code::LatLonGrid &fil) const
 the two images should be of identical sizes.
std::vector< Scorescore (const code::PolarGrid &orig, const code::PolarGrid &fil) const
 the two images should be of identical sizes.
std::vector< Scorescore (const code::Image< float > &orig, const code::Image< float > &fil) const
virtual Score scoreFiltered (const code::Image< float > &orig, const code::Image< float > &fil) const
 returns the score for pre-filtered images.
void updateScore (double orig, double filtered, ImageComparator::Score *score) const
 Updates this score based on the orig and filtered values if findError returns true.
bool findError (double orig, double filtered, double &error, bool &origValid, bool &estValid) const
 Find the error.

Protected Attributes

std::vector< code::SmartPtr<
KernelFilter > > 
filters
double minValue
double maxValue
bool maxIsBetter
int searchRadius
bool includeNulls

Classes

class  Score


Constructor & Destructor Documentation

w2img::ImageComparator::ImageComparator ( double  minValue,
double  maxValue,
bool  maxIsBetter,
const std::vector< code::Image< float > > &  kernels,
size_t  searchDistance = 0,
bool  includeNulls = false 
)

Compare two images.

Values in the range minValue-maxValue are considered.

The kernel is used to smooth the filtered image before searching. A box within the search-radius is searched for the best match (lowest error) -- pass in a radius of 0 to just use the pixel value.

virtual w2img::ImageComparator::~ImageComparator (  )  [inline, virtual]


Member Function Documentation

bool w2img::ImageComparator::findError ( double  orig,
double  filtered,
double &  error,
bool origValid,
bool estValid 
) const

Find the error.

The error is (filtered - orig) if both numbers are valid.

Returns:
true if the error returned is a usable number The error will be flagged as Constants::MissingData if both orig and filtered are invalid unless includeNulls was set in the constructor. Definition: An invalid value is a value equal to Constants::MISSING_DATA or less than minValue (if maxIsBetter).

std::vector<Score> w2img::ImageComparator::score ( const code::Image< float > &  orig,
const code::Image< float > &  fil 
) const

std::vector<Score> w2img::ImageComparator::score ( const code::PolarGrid &  orig,
const code::PolarGrid &  fil 
) const

the two images should be of identical sizes.

std::vector<Score> w2img::ImageComparator::score ( const code::LatLonGrid &  orig,
const code::LatLonGrid &  fil 
) const

the two images should be of identical sizes.

std::vector<Score> w2img::ImageComparator::score ( const code::CartesianGrid2D &  orig,
const code::CartesianGrid2D &  fil 
) const

the two images should be of identical sizes.

the return is the Score for each of the given kernels.

virtual Score w2img::ImageComparator::scoreFiltered ( const code::Image< float > &  orig,
const code::Image< float > &  fil 
) const [virtual]

returns the score for pre-filtered images.

Reimplemented in w2img::ProbabilisticImageComparator, and w2kmeans::ObjectImageComparator.

void w2img::ImageComparator::updateScore ( double  orig,
double  filtered,
ImageComparator::Score score 
) const

Updates this score based on the orig and filtered values if findError returns true.

See also:
findError


Member Data Documentation

std::vector< code::SmartPtr<KernelFilter> > w2img::ImageComparator::filters [protected]

bool w2img::ImageComparator::includeNulls [protected]

bool w2img::ImageComparator::maxIsBetter [protected]

double w2img::ImageComparator::maxValue [protected]

double w2img::ImageComparator::minValue [protected]

int w2img::ImageComparator::searchRadius [protected]


Generated on Fri May 4 13:40:23 2012 for WDSS-IIw2algs by  doxygen 1.4.7