void MatToTexture2D()
    {
        //Convert Mat to Texture2D
        int tw = tex.width;
        int th = tex.height;

        OpenCVInterop.GetRawImageBytes(ref pixelPtr, ref tw, ref th);
        //Update the Texture2D with array updated in C++
        tex.SetPixels32(pixel32);
        tex.Apply();
        //Debug.Log("Tex Updated");
    }
 public static void GetFrame(IntPtr pixelPtr, int width, int height)
 {
     OpenCVInterop.GetRawImageBytes(pixelPtr, width, height);
 }