public static GrayU8 yu12ToGray ( byte [ ] data , int width , int height , GrayU8 output ) { if ( output != null ) { if ( output . width != width || output . height != height ) throw new IllegalArgumentException ( "output width and height must be " + width + " " + height ) ; } else { output = new GrayU8 ( width , height ) ; } if ( BoofConcurrency . USE_CONCURRENT ) { ImplConvertNV21_MT . nv21ToGray ( data , output ) ; } else { ImplConvertNV21 . nv21ToGray ( data , output ) ; } return output ; }
Converts an YV12 image into a gray scale U8 image .