Click or drag to resize

NativeImageIOReadImageFileToTensorT Method

https://www.emgu.com
Read an image file, covert the data and save it to the native pointer

Namespace:  Emgu.Models
Assembly:  Emgu.TF.Lite.Models (in Emgu.TF.Lite.Models.dll) Version: 2.19.0.1709+574f567263f3c76bb77304b9eeb79ab6660ba101
Syntax
public static void ReadImageFileToTensor<T>(
	string fileName,
	IntPtr dest,
	int inputHeight = -1,
	int inputWidth = -1,
	float inputMean = 0f,
	float scale = 1f,
	bool flipUpSideDown = false,
	bool swapBR = false
)
where T : struct, new()

Parameters

fileName
Type: SystemString
The name of the image file
dest
Type: SystemIntPtr
The native pointer where the image pixels values will be saved to. The pixel will have 3 color channles (BGR or RGB depends on the swapBR flag).
inputHeight (Optional)
Type: SystemInt32
The height of the image, must match the height requirement for the tensor
inputWidth (Optional)
Type: SystemInt32
The width of the image, must match the width requirement for the tensor
inputMean (Optional)
Type: SystemSingle
The mean value, it will be subtracted from the input image pixel values
scale (Optional)
Type: SystemSingle
The scale, after mean is subtracted, the scale will be used to multiply the pixel values
flipUpSideDown (Optional)
Type: SystemBoolean
If true, the image needs to be flipped up side down
swapBR (Optional)
Type: SystemBoolean
If true, will flip the Blue channel with the Red. e.g. If false, the tensor's color channel order will be RGB. If true, the tensor's color channel order will be BGR

Type Parameters

T
The type of the data to covert the image pixel values to. e.g. "float" or "byte"
See Also