Table of Contents

NAME

QccIMGImageComponentMSE, QccIMGImageComponentShapeAdaptiveMSE, QccIMGImageComponentMAE, QccIMGImageComponentShapeAdaptiveMAE - mean squared error and maximum absolute error between image components

SYNOPSIS

#include "libQccPack.h"

double QccIMGImageComponentMSE(const QccIMGImageComponent *image_component1, const QccIMGImageComponent *image_component2);
double QccIMGImageComponentShapeAdaptiveMSE(const QccIMGImageComponent *image_component1, const QccIMGImageComponent *image_component2, const QccIMGImageComponent *alpha_mask);

double QccIMGImageComponentMAE(const QccIMGImageComponent *image_component1, const QccIMGImageComponent *image_component2);
double QccIMGImageComponentShapeAdaptiveMAE(const QccIMGImageComponent *image_component1, const QccIMGImageComponent *image_component2, const QccIMGImageComponent *alpha_mask);

DESCRIPTION

QccIMGImageComponentMSE() returns the mean squared error (MSE) between image_component1 and image_component2. The MSE is calculated by taking the difference between a pixel in image_component1 and its corresponding pixel in image_component2, squaring this difference, and finally averaging all the squared differences over the entire image component. image_component1 and image_component2 must have the same size.

QccIMGImageComponentShapeAdaptiveMSE() performs an MSE calculation similar to that of QccIMGImageComponentMSE(), except that alpha_mask is assumed to denote regions that are "transparent" in both image_component1 and image_component2 and thus contain no valid pixel data. That is, QccIMGImageComponentShapeAdaptiveMSE() skips over pixels in the MSE calculation for which QccAlphaTransparent(3) returns non-zero when applied to alpha_mask at the current pixel location. If alpha_mask is NULL, the usual, full-image MSE is calculated via QccIMGImageComponentMSE(). image_component1, image_component2, and alpha_mask (if it is non-NULL) must all have the same size.

QccIMGImageComponentMAE() returns the maximum absolute error (MAE) between image_component1 and image_component2. The MAE is calculated by taking the difference between a pixel in image_component1 and its corresponding pixel in image_component2, and then calculating the absolute value of this difference using fabs(3) . The largest absolute value encountered in this fashion over the entire image component is returned by QccIMGImageComponentMAE(). image_component1 and image_component2 must have the same size.

QccIMGImageComponentShapeAdaptiveMAE() performs an MAE calculation similar to that of QccIMGImageComponentMAE(), except that alpha_mask is assumed to denote regions that are "transparent" in both image_component1 and image_component2 and thus contain no valid pixel data. alpha_mask is NULL, the usual, full-image MAE is calculated via QccIMGImageComponentMAE(). image_component1, image_component2, and alpha_mask (if it is non-NULL) must all have the same size.

RETURN VALUES

These routines return the value of the MSE or MAE quantity they calculate; in the case of an error, these routines return 0.0.

SEE ALSO

fabs(3) , QccAlphaTransparent(3) , QccIMGImageComponent(3) , QccPackIMG(3) , QccPack(3)

AUTHOR

Copyright (C) 1997-2021 James E. Fowler


Table of Contents



Get QccPack at SourceForge.net. Fast, secure and Free Open Source software downloads