code: 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;
      }
docs: Converts an YV12 image into a gray scale U8 image.
  
  @param data Input: YV12 image data
  @param width Input: image width
  @param height Input: image height
  @param output Output: Optional storage for output image.  Can be null.
  @return Gray scale image