18 #ifndef PIC_METRICS_MAXIMUM_ERROR_HPP 19 #define PIC_METRICS_MAXIMUM_ERROR_HPP 23 #include "../base.hpp" 24 #include "../image.hpp" 25 #include "../metrics/base.hpp" 38 if(ori == NULL || cmp == NULL) {
50 int size = ori->
size();
54 if(!bLargeDifferences) {
55 largeDifferences = FLT_MAX;
58 float maxVal = -FLT_MAX;
59 for(
int i = 0; i < size; i++) {
60 float delta = fabsf(ori->
data[i] - cmp->
data[i]);
int size() const
size computes the number of values.
Definition: image.hpp:481
float * data
data is the main buffer where pixel values are stored.
Definition: image.hpp:91
bool isSimilarType(const Image *img)
isSimilarType checks if the current image is similar to img; i.e. if they have the same width...
#define PIC_INLINE
Definition: base.hpp:33
The Image class stores an image as buffer of float.
Definition: image.hpp:60
Definition: bilateral_separation.hpp:25
bool isValid()
isValid checks if the current image is valid, which means if they have an allocated buffer or not...
const float C_LARGE_DIFFERENCESf
Definition: base.hpp:28
PIC_INLINE float MaximumError(Image *ori, Image *cmp, bool bLargeDifferences=false)
MaximumError computes the maximum error between two images.
Definition: maximum_error.hpp:36
const double C_LARGE_DIFFERENCES
Definition: base.hpp:27