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

[Feature Request] camera focus #145

Open
Erica-W opened this issue Dec 16, 2020 · 10 comments
Open

[Feature Request] camera focus #145

Erica-W opened this issue Dec 16, 2020 · 10 comments

Comments

@Erica-W
Copy link

Erica-W commented Dec 16, 2020

Hi,
thanks for your great work!
when qrcode is small, can the camera auto focus be achieved?
Cheers

@raufozturk
Copy link

that's exactly what we need. On small QR Codes the scanning performace is very bad, 1cm x 1cm QR Size for example is very hard to scan, also maybe an option to enable the camera light on mobile phone will be helpful.

@nitin282001
Copy link

Hi there
I am also facing this issue of focusing the camera , my qr are small and camera is not focusing anyone got any solution for this ?
Anyone help me out of this 💯
Thanks in advance

@bcalik
Copy link

bcalik commented Feb 3, 2021

Is there any improvements on auto-focus?

@haimiko
Copy link

haimiko commented Jun 14, 2021

Hi there
I am also facing this issue of focusing the camera , my qr are small and camera is not focusing anyone got any solution for this ?
Anyone help me out of this 💯
Thanks in advance

Managed to fix this by increasing the aspect ratio to 2.

this.html5Qrcode.start(this.cameraId, {
      fps: 10,    // Optional frame per seconds for qr code scanning
      qrbox: undefined,  // Optional if you want bounded box UI, std 250, undefined disables
      aspectRatio: 2)
      
    },

@sjlongland
Copy link

aspectRatio seems counter-intuitive, aren't QR codes meant to be square (1:1 ratio)?

@haimiko
Copy link

haimiko commented Jun 14, 2021

it's the aspectRatio of the videostream which has the effect of enlarging/reducing the image.

@pstanton
Copy link

thanks @haimiko - aspectRatio: 2 definitely helps, now to figure out how to "mask" the top/bottom of the videostream. unfortunately aspectRatio: 3 breaks the UI entirely.

@pstanton
Copy link

qr-scanner works better

@mebjas
Copy link
Owner

mebjas commented Oct 5, 2021

This is a harder problem - one solution would be to add a QR code classifier and then another instance that zooms the camera stream to the given position if supported.

Aspect ratio will partially help but will also work upto a certain limit.

@mebjas
Copy link
Owner

mebjas commented Oct 21, 2021

Feature request for zoom feature: #330

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

No branches or pull requests

8 participants