Closed dev-ptdi closed 3 years ago
@dev-ptdi
frame.Data
is IntPtr indicate pixel data. You can copy data from it by Marshal.Copy.
I don't think we can use frame.Data with Marshal.Copy since we have to know the array size before we can copy to byte[]
byte[] managedArray = new byte[size]; // Here we don;t know the size
Marshal.Copy(frame.Data, managedArray, 0, size);
if we generate and use temporary file to read / save then delete the file, it would be an IO issue
@dev-ptdi
var total = frame.Total();
byte[] managedArray = new byte[total ];
Marshal.Copy(frame.Data, managedArray, 0, total );
NcnnDotNet 0.0.0.20210417 is now release and it support convert to Mat from byte[]
I am new to UltraFaceDotNet, how to input and output from/to byte array?
using (var ultraFace = UltraFace.Create(param))// config model input, { using var frame = Cv2.ImRead(_jpg); // --> I need from byte array