#include "HxImageRep.h"
Go to the source code of this file.
Functions | |
HxImageRep L_HXIMAGEREP | HxGauss (HxImageRep img, double sigma, double accuracy=3.0) |
Convolution Gaussian. More... |
|
Convolution Gaussian. Equivalent to : img.genConvSeparated( gauss, "mul", "addAssign", HxImageRep::ARITH_PREC) where gauss is the 1d double-precision Gaussian kernel based on sigma and accuracy. Notice that the kernel is applied to every dimension of the image separately and that the result image has a double-precision pixel type.
00018 { 00019 HxString fname("HxGauss"); 00020 00021 if (img.isNull()) 00022 { 00023 HxGlobalError::instance()->reportError(fname, img.name(), "null image", HxGlobalError::HX_GE_INVALID); 00024 return HxImageRep(); 00025 } 00026 00027 if (sigma <= 0.0) 00028 { 00029 HxGlobalError::instance()->reportError(fname, img.name(), "invalid value of sigma", HxGlobalError::HX_GE_INVALID); 00030 return HxImageRep(); 00031 } 00032 if (truncation < 0.0) 00033 { 00034 HxGlobalError::instance()->reportError(fname, img.name(), "invalid value of truncation", HxGlobalError::HX_GE_INVALID); 00035 return HxImageRep(); 00036 } 00037 00038 00039 int minSize = HxImageMinSize(img); 00040 HxImageRep gauss = HxMakeGaussian1d(sigma, 0, truncation, minSize); 00041 return img.genConvSeparated( 00042 gauss, "mul", "addAssign", HxImageRep::ARITH_PREC); 00043 } |