private static void normalize2D ( GrayU8 gray ) { // Create a Gaussian kernel with radius of 3 Kernel2D_S32 kernel = FactoryKernelGaussian . gaussian2D ( GrayU8 . class , - 1 , 3 ) ; // Note that there is a more efficient way to compute this convolution since it is a separable kernel // just use BlurImageOps instead. // Since it's normalized it can be saved inside an 8bit image GrayU8 output = new GrayU8 ( gray . width , gray . height ) ; GConvolveImageOps . convolveNormalized ( kernel , gray , output ) ; panel . addImage ( VisualizeImageData . standard ( output , null ) , "2D Normalized Kernel" ) ; }
Convolves a 2D normalized kernel . This kernel is divided by its sum after computation .