public static < T extends ImageGray < T > > T bitmapToGray ( Bitmap input , T output , Class < T > imageType , byte [ ] storage ) { if ( imageType == GrayF32 . class ) return ( T ) bitmapToGray ( input , ( GrayF32 ) output , storage ) ; else if ( imageType == GrayU8 . class ) return ( T ) bitmapToGray ( input , ( GrayU8 ) output , storage ) ; else throw new IllegalArgumentException ( "Unsupported BoofCV Image Type" ) ; }
Converts Bitmap image into a single band image of arbitrary type .