Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frame-Focusing Scanner on Android #200

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

Jayson1999
Copy link

As the Google's API used in Android for barcode scanning only comes with whole-screen scanning. The UI of the barcode scanning shows a focus-frame in the center of the screen, thus indicating users that the barcode in the frame will be detected.

scanfocus

However, in the case like the above screenshot where multiple barcodes are shown in the screen, the barcode reader will have to pick between the 2 barcodes. Therefore, enhancement has been implemented with a sub-class to read only the barcode inside the frame by cropping accordingly to the frame's size. This can help to prevent constantly receiving wrong barcode in the Single-Scan mode where the Activity will close and return the result instantly upon detecting a barcode. The detection may always be too fast for user to be able to single-tap to select the targeted barcode or even try the zoom gesture, so I feel that the enhancement might be helpful in scenarios.

Hopefully this request can be reviewed and thank you for the time.

@Jayson1999 Jayson1999 changed the title Frame-Focusing Barcode Scanner on Android Frame-Focusing Scanner on Android May 18, 2021
@AmolGangadhare AmolGangadhare self-requested a review May 31, 2021 09:47
@utsavDave97
Copy link

any updates on this one as this feature is needed

@Jayson1999
Copy link
Author

any updates on this one as this feature is needed

I think you can clone from my branch if you would like to use it.

@utsavDave97
Copy link

any updates on this one as this feature is needed

I think you can clone from my branch if you would like to use it.

Thank you @Jayson1999 Appreciate it! I guess the owner of this repo is not active since last 6-7 months. God knows!!

@utsavDave97
Copy link

any updates on this one as this feature is needed

I think you can clone from my branch if you would like to use it.

Hey @Jayson1999 So I got this error when I was building the project!

error: incompatible types: CentralDetector cannot be converted to BarcodeDetector
        CameraSource.Builder builder = new CameraSource.Builder(getApplicationContext(), centralDetector)

Please let me know.

@utsavDave97
Copy link

Hey @Jayson1999 So I got this error when I was building the project!

error: incompatible types: CentralDetector cannot be converted to BarcodeDetector
        CameraSource.Builder builder = new CameraSource.Builder(getApplicationContext(), centralDetector)

Please let me know.

@Jayson1999
Copy link
Author

Hey @Jayson1999 So I got this error when I was building the project!

error: incompatible types: CentralDetector cannot be converted to BarcodeDetector
        CameraSource.Builder builder = new CameraSource.Builder(getApplicationContext(), centralDetector)

Please let me know.

Hi, might need some weekends to look into it. In the meantime, feel free to explore around it and share with me the good news if you have one!

@Jayson1999
Copy link
Author

Hey @Jayson1999 So I got this error when I was building the project!

error: incompatible types: CentralDetector cannot be converted to BarcodeDetector
        CameraSource.Builder builder = new CameraSource.Builder(getApplicationContext(), centralDetector)

Please let me know.

@utsavDave97 Tested mine was working well... Mind sharing your use case and the complete trace log?

@utsavDave97
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants