Function fromImage

  • Creates a Tensor object from an existing p5.Image.

    Parameters

    • img: any

      the image

    • Optional numChannels: number

      (optional) the number of channels of the output tensor

    Returns Tensor

    the image as a tensor