Android Question How to crop image in: Barcode reader based on Google Play Services Vision

Gnappo jr

Active Member
Licensed User
Longtime User
I have tried this example, it is simply amazing. So effective that I need to narrow the recognition area.
Erel provides this solution:
Convert the preview data to a jpeg data (there is such a method in CameraEx) and then load it to a bitmap.
Crop the bitmap and pass it to frameBuilder with:
B4X:
frameBuilder.RunMethod("setBitmap", Array(YourBitmap)) 'instead of the setImageData line
unfortunately I can't implement it, I can get help with an example of the changes to be made on the initial code: barcode reader based on Google Play Services Vision
Thank you all
 

Gnappo jr

Active Member
Licensed User
Longtime User
What exactly do you want to do? Make the preview region smaller?
xerel.PNG


I would like the barcode recognition to take place in a central area of the frame, for example inside the yellow square of the attached image. Could you limit the area where to perform the image analysis? This is necessary because if two or more bar codes are framed at the same time they are read both, the webcam does not have adjustable optics so you have to act via software. I apologize for English, I am using a machine translation.
Thanks
 
Upvote 0

MrKim

Well-Known Member
Licensed User
Longtime User
View attachment 95659

I would like the barcode recognition to take place in a central area of the frame, for example inside the yellow square of the attached image. Could you limit the area where to perform the image analysis? This is necessary because if two or more bar codes are framed at the same time they are read both, the webcam does not have adjustable optics so you have to act via software. I apologize for English, I am using a machine translation.
Thanks
See https://www.b4x.com/android/forum/threads/barcode-reader-improved.130130/
 
Upvote 0
Top