Inheritance diagram for w2img::ImageComparator:
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
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< Score > | score (const code::CartesianGrid2D &orig, const code::CartesianGrid2D &fil) const |
the two images should be of identical sizes. | |
std::vector< Score > | score (const code::LatLonGrid &orig, const code::LatLonGrid &fil) const |
the two images should be of identical sizes. | |
std::vector< Score > | score (const code::PolarGrid &orig, const code::PolarGrid &fil) const |
the two images should be of identical sizes. | |
std::vector< Score > | score (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 |
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] |
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.
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.
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] |