如何将位图转换为”YUV_420_888″格式?

huangapple go评论210阅读模式
英文:

How to Convert Bitmap to "YUV_420_888" format?

问题

I have a bitmap and i want to process this bitmap with ML-kit face recognition. When I give this bitmap directly to ML kit i see this message: "StreamingFormatChecker: ML Kit has detected that you seem to pass camera frames to the detector as a Bitmap object. This is inefficient. Please use YUV_420_888 format for camera2 API or NV21 format for (legacy) camera API and directly pass down the byte array to ML Kit."

So my question is how can I convert a bitmap to "YUV_420_888" format?

英文:

I have a bitmap and i want to process this bitmap with ML-kit face recognition. When I give this bitmap directly to ML kit i see this message : "StreamingFormatChecker: ML Kit has detected that you seem to pass camera frames to the detector as a Bitmap object. This is inefficient. Please use YUV_420_888 format for camera2 API or NV21 format for (legacy) camera API and directly pass down the byte array to ML Kit."

So my question is how can I convert a bitmap to "YUV_420_888" format?

答案1

得分: 1

你可以尝试使用InputImage.fromBitmap方法,并将结果传递给你想要调用的API。

英文:

You can try using the InputImage.fromBitmap method and pass the result into the API you want to call.

huangapple
  • 本文由 发表于 2020年8月25日 09:13:06
  • 转载请务必保留本文链接:https://go.coder-hub.com/63570682.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定