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
Syntaxpublic 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()
Public Shared Sub ReadImageFileToTensor(Of T As {Structure, New}) (
fileName As String,
dest As IntPtr,
Optional inputHeight As Integer = -1,
Optional inputWidth As Integer = -1,
Optional inputMean As Single = 0F,
Optional scale As Single = 1F,
Optional flipUpSideDown As Boolean = false,
Optional swapBR As Boolean = false
)
public:
generic<typename T>
where T : value class, gcnew()
static void ReadImageFileToTensor(
String^ fileName,
IntPtr dest,
int inputHeight = -1,
int inputWidth = -1,
float inputMean = 0f,
float scale = 1f,
bool flipUpSideDown = false,
bool swapBR = false
)
static member ReadImageFileToTensor :
fileName : string *
dest : IntPtr *
?inputHeight : int *
?inputWidth : int *
?inputMean : float32 *
?scale : float32 *
?flipUpSideDown : bool *
?swapBR : bool
(* Defaults:
let _inputHeight = defaultArg inputHeight -1
let _inputWidth = defaultArg inputWidth -1
let _inputMean = defaultArg inputMean 0f
let _scale = defaultArg scale 1f
let _flipUpSideDown = defaultArg flipUpSideDown false
let _swapBR = defaultArg swapBR false
*)
-> unit when '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