You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use simplest qr scanning image analyzer.
And I am trying to scan not the entire area of the screen, but only the center bounded by the frame.
In this example, I set the crop rect for MediaImage, which will be converted to the InputImage and then passed to the scanner.
but scanner still scan entire area
override fun analyze(imageProxy: ImageProxy) {
val mediaImage = imageProxy.image
if (mediaImage != null) {
val cropSize = (min(mediaImage.width, mediaImage.height) * 0.6f).toInt()
val cropRect = Rect(mediaImage.width / 2 - cropSize / 2, mediaImage.height / 2 - cropSize / 2,
mediaImage.width / 2 + cropSize / 2, mediaImage.height / 2 + cropSize / 2)
//here i set crop rect
mediaImage.cropRect = cropRect
val image = InputImage.fromMediaImage(mediaImage, imageProxy.imageInfo.rotationDegrees)
//but here scanner wil process whole image instead of small area
pendingTask = scanner.process(image)
.addOnSuccessListener { barcodes ->
//do something
}
.addOnCompleteListener {
imageProxy.close()
}
}
}
The text was updated successfully, but these errors were encountered:
Is there any progress or an alternative issue that we can subscribe to?
Currently UseCaseGroup is pretty much useless since the Analyzer does not use the cropRect of input images. Manually cropping images seems to be pretty messy.
I'm trying to use simplest qr scanning image analyzer.
And I am trying to scan not the entire area of the screen, but only the center bounded by the frame.
In this example, I set the crop rect for MediaImage, which will be converted to the InputImage and then passed to the scanner.
but scanner still scan entire area
The text was updated successfully, but these errors were encountered: