#include "HxImageRep.h"
Go to the source code of this file.
Functions | |
HxImageRep L_HXIMAGEREP | HxRecGauss (HxImageRep im, double sx, double sy, int dx=0, int dy=0, int recurOrder=3) |
Recursive Gaussian. More... |
|
Recursive Gaussian.
00065 { 00066 GaussIIR gx(sx, dx, recurOrder); 00067 GaussIIR gy(sy, dy, recurOrder); 00068 HxImageRep fx = HxImageFactory::instance().fromGenerator(HXIMAGESIG2DDOUBLE, &gx); 00069 HxImageRep fy = HxImageFactory::instance().fromGenerator(HXIMAGESIG2DDOUBLE, &gy); 00070 00071 HxImageRep res = im.recGenConv2dSep(fx, fy, "mul", "addAssign", 00072 HxImageRep::ARITH_PREC); 00073 00074 switch (dx) { 00075 case 1: { 00076 FilterN fdx(-0.5,0,0.5); 00077 HxImageRep hdx = HxImageFactory::instance().fromGenerator( 00078 HXIMAGESIG2DDOUBLE, &fdx); 00079 res = res.generalizedConvolutionK1d(1,hdx, "mul", "addAssign"); 00080 } 00081 break; 00082 case 2: { 00083 FilterN fdx(1,-2,1); 00084 HxImageRep hdx = HxImageFactory::instance().fromGenerator( 00085 HXIMAGESIG2DDOUBLE, &fdx); 00086 res = res.generalizedConvolutionK1d(1,hdx, "mul", "addAssign"); 00087 } 00088 break; 00089 } 00090 switch (dy) { 00091 case 1: { 00092 FilterN fdy(-0.5,0,0.5); 00093 HxImageRep hdy = HxImageFactory::instance().fromGenerator( 00094 HXIMAGESIG2DDOUBLE, &fdy); 00095 res = res.generalizedConvolutionK1d(2,hdy, "mul", "addAssign"); 00096 } 00097 break; 00098 case 2: { 00099 FilterN fdy(1,-2,1); 00100 HxImageRep hdy = HxImageFactory::instance().fromGenerator( 00101 HXIMAGESIG2DDOUBLE, &fdy); 00102 res = res.generalizedConvolutionK1d(2,hdy, "mul", "addAssign"); 00103 } 00104 break; 00105 } 00106 00107 return res; 00108 } |