語言

MLImage.CreateFromPixels 方法

定義

從像素資料範圍建立 MLImage 物件。

public static Microsoft.ML.Data.MLImage CreateFromPixels(int width, int height, Microsoft.ML.Data.MLPixelFormat pixelFormat, ReadOnlySpan<byte> imagePixelData);
static member CreateFromPixels : int * int * Microsoft.ML.Data.MLPixelFormat * ReadOnlySpan<byte> -> Microsoft.ML.Data.MLImage
Public Shared Function CreateFromPixels (width As Integer, height As Integer, pixelFormat As MLPixelFormat, imagePixelData As ReadOnlySpan(Of Byte)) As MLImage

參數

width
Int32

影像的寬度,以像素為單位。

height
Int32

影像的高度,以像素為單位。

pixelFormat
MLPixelFormat

用來製作影像的像素格式。

imagePixelData
ReadOnlySpan<Byte>

用來製作影像的像素資料。

傳回

MLImage 物件。

適用於