英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论