public static < T extends ImageGray < T > , G extends GradientValue > SparseImageGradient < T , G > createSobel ( Class < T > imageType , ImageBorder < T > border ) { if ( imageType == GrayF32 . class ) { return ( SparseImageGradient ) new GradientSparseSobel_F32 ( ( ImageBorder_F32 ) border ) ; } else if ( imageType == GrayU8 . class ) { return ( SparseImageGradient ) new GradientSparseSobel_U8 ( ( ImageBorder_S32 ) border ) ; } else { throw new IllegalArgumentException ( "Unsupported image type " + imageType . getSimpleName ( ) ) ; } }
Creates a sparse sobel gradient operator .