I am trying to implement a Barcode scanner by using the Google ML Kit latest SDK and passing captured barcode bitmap image inside the below method. However, the ML kit keeps throwing errors like below. Does anyone have a solution to resolve this error?
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.
val image = InputImage.fromBitmap(bitmap, 0)
implementation 'com.google.mlkit:barcode-scanning:16.2.0'
Following this doc: https://developers.google.com/ml-kit/vision/barcode-scanning/android
I am passing below cropped bitmap image to ML Kit for the process.