code: public INDArray asRowVector(BufferedImage image) {
          if (centerCropIfNeeded) {
              image = centerCropIfNeeded(image);
          }
          image = scalingIfNeed(image, true);
          if (channels == 3) {
              return toINDArrayBGR(image).ravel();
          }
          int[][] ret = toIntArrayArray(image);
          return NDArrayUtil.toNDArray(ArrayUtil.flatten(ret));
      }
docs: Convert an image in to a row vector
  
  @param image the image to convert
  @return the row vector based on a rastered
  representation of the image