Skip to content
This repository has been archived by the owner on Feb 25, 2021. It is now read-only.

focusMode = AVCaptureFocusModeContinuousAutoFocus #81

Closed
JacopoKenzo opened this issue Sep 16, 2016 · 4 comments
Closed

focusMode = AVCaptureFocusModeContinuousAutoFocus #81

JacopoKenzo opened this issue Sep 16, 2016 · 4 comments

Comments

@JacopoKenzo
Copy link

Hi,
I was playing around with the library and I found out that changing the focusMode to AutoFocus improves a lot the usability of the scanner.
Testing with iPhone 5 iOS 10 GM was really hard to focus on a QR code even if the autoFocusRangeRestriction is set to AVCaptureAutoFocusRangeRestrictionNear.

    // Focus on the center of the image
    if ([deviceInput.device respondsToSelector:@selector(isFocusPointOfInterestSupported)] &&
        deviceInput.device.isFocusPointOfInterestSupported) {

        self.initialFocusPoint = deviceInput.device.focusPointOfInterest;
        deviceInput.device.focusPointOfInterest = CGPointMake(kFocalPointOfInterestX, kFocalPointOfInterestY);
        deviceInput.device.focusMode = AVCaptureFocusModeContinuousAutoFocus;
    }

Cheers!

@mikebuss
Copy link
Owner

Thanks @JacopoKenzo - it looks like the focusMode is currently set to AVCaptureFocusModeContinuousAutoFocus in the latest version (line 338) of MTBBarcodeScanner. If you try the latest version, does this fix any focus issues on your end?

@JacopoKenzo
Copy link
Author

@mikebuss yes i'm using the last version, AVCaptureFocusModeContinuousAutoFocus is set when the user tap-to-focus, not when the camera starts. That means an extra tap from the user.

And also tapping the camera didn't really focus on my end, that's why i set the AutoFocus property in the init of the camera, so the user doesn't have to tap.

@mikebuss
Copy link
Owner

Good catch - I've updated this in e7a6f26 and will push a new version out shortly. Thank you!

@mikebuss
Copy link
Owner

This is now in the pod version 2.1.0 if you'd like to update on your end. Thanks again!

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

No branches or pull requests

2 participants