#include "HxImageRep.h"
Go to the source code of this file.
Functions | |
HxImageRep L_HXIMAGEREP | HxConvolution (HxImageRep img, HxImageRep kernel, HxImageRep::ResultPrecision resPrec) |
Convolution. More... |
|
Convolution. The function performs a convolution on the input image via a generalized convolution operation (see Images). Implementation specifics : The image functor instantiator for 2D images: HxInstMulAddAss2d, and for 3D images : HxInstMulAddAss3d.
00015 { 00016 HxString fname("HxConvolution"); 00017 00018 if (img.isNull()) 00019 { 00020 HxGlobalError::instance()->reportError(fname, img.name(), "null image", HxGlobalError::HX_GE_INVALID); 00021 return HxImageRep(); 00022 } 00023 if (kernel.isNull()) 00024 { 00025 HxGlobalError::instance()->reportError(fname, kernel.name(), "null kernel", HxGlobalError::HX_GE_INVALID); 00026 return HxImageRep(); 00027 } 00028 if (img.dimensionality() != kernel.dimensionality()) 00029 { 00030 HxGlobalError::instance()->reportError(fname, "kernel and image dimensionality do not match", HxGlobalError::HX_GE_INVALID); 00031 return HxImageRep(); 00032 } 00033 if (kernel.pixelDimensionality() != img.pixelDimensionality()) 00034 { 00035 HxGlobalError::instance()->reportError(fname, "kernel and image pixel dimensionality do not match", HxGlobalError::HX_GE_INVALID); 00036 return HxImageRep(); 00037 } 00038 00039 return img.generalizedConvolution( 00040 kernel, "mul", "addAssign", resPrec); 00041 } |