private static void convolve1D ( GrayU8 gray ) { ImageBorder < GrayU8 > border = FactoryImageBorder . wrap ( BorderType . EXTENDED , gray ) ; Kernel1D_S32 kernel = new Kernel1D_S32 ( 2 ) ; kernel . offset = 1 ; // specify the kernel's origin kernel . data [ 0 ] = 1 ; kernel . data [ 1 ] = - 1 ; GrayS16 output = new GrayS16 ( gray . width , gray . height ) ; GConvolveImageOps . horizontal ( kernel , gray , output , border ) ; panel . addImage ( VisualizeImageData . standard ( output , null ) , "1D Horizontal" ) ; GConvolveImageOps . vertical ( kernel , gray , output , border ) ; panel . addImage ( VisualizeImageData . standard ( output , null ) , "1D Vertical" ) ; }
Convolves a 1D kernel horizontally and vertically