Table of Contents

NAME

QccIMGImageComponentMean, QccIMGImageComponentShapeAdaptiveMean, QccIMGImageComponentVariance, QccIMGImageComponentShapeAdaptiveVariance, QccIMGImageComponentSubtractMean, QccIMGImageComponentAddMean - mean and variance operations on image components

SYNOPSIS

#include "libQccPack.h"

double QccIMGImageComponentMean(const QccIMGImageComponent *image_component);
double QccIMGImageComponentShapeAdaptiveMean(const QccIMGImageComponent *image_component, const QccIMGImageComponent *alpha_mask);

double QccIMGImageComponentVariance(const QccIMGImageComponent *image_component);
double QccIMGImageComponentShapeAdaptiveVariance(const QccIMGImageComponent *image_component, const QccIMGImageComponent *alpha_mask );

int QccIMGImageComponentSubtractMean(QccIMGImageComponent *image_component, double *mean, const QccSQScalarQuantizer *quantizer);
int QccIMGImageComponentAddMean(QccIMGImageComponent *image_component, double mean);

DESCRIPTION

QccIMGImageComponentMean() returns the mean of the image array of image_component.

QccIMGImageComponentShapeAdaptiveMean() performs a mean calculation similar to that of QccIMGImageComponentMean(), except that alpha_mask is assumed to denote regions that are "transparent" in image_component and thus contain no valid pixel data. That is, QccIMGImageComponentShapeAdaptiveMean() skips over pixels in the mean calculation for which QccAlphaTransparent(3) returns non-zero when applied to alpha_mask at the current pixel location.

QccIMGImageComponentVariance() returns the variance of the image array of image_component.

QccIMGImageComponentShapeAdaptiveVariance() performs a variance calculation similar to that of QccIMGImageComponentVariance(), except that alpha_mask is assumed to denote regions that are "transparent" in image_component and thus contain no valid pixel data.

QccIMGImageComponentSubtractMean() first calculates the mean of image_component. If quantizer is not NULL, QccSQScalarQuantization(3) and QccSQInverseScalarQuantization(3) are called in succession to calculate a quantized reconstruction of the mean value, which is then subtracted from each pixel value of image_component. On the other hand, if quantizer is NULL, then the calculated mean is subtracted directly from each pixel value of image_component. If mean is not NULL, the value subtracted from image_component, quantized or not, is returned in the location pointed to by mean.

QccIMGImageComponentAddMean() restores the mean that was removed by QccIMGImageComponentSubtractMean(). That is, mean is added to each pixel in image_component.

RETURN VALUES

QccIMGImageComponentSubtractMean() and QccIMGImageComponentAddMean() return 0 on success and 1 on error; the other routines return the mean or variance value they calculate.

SEE ALSO

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