Comments (3)
As @dgoldman-ebay has commented elsewhere, card.io was designed to scan, not to take sharp images.
In general, determining absolutely whether an image is in focus is a very hard problem. We do a very crude approximation to this with our focus score calculation, which is probably what you want to look at if, you want to just try fiddling with some thresholds.
Other options include attempting to monitor focus scores over time, waiting for them to stabilize (with hysteresis), in the hopes that that indicates that the camera has finished focusing.
Or perhaps best of all, dig into the camera APIs. I seem to recall that in recent iOS versions, there's a newly-added ability to set the focal depth programatically. It might have to be set per-device, but this could entirely circumvent the entire issue.
Please do experiment with a wide range of lighting conditions and cards. We found that focus scores and related metrics tend to vary greatly...which is why the emphasis was placed on being able to scan blurry cards. :)
from card.io-ios-source.
I seem to recall that in recent iOS versions, there's a newly-added ability to set the focal depth programatically.
We're already using the AVCaptureAutoFocusRangeRestrictionNear
introduced in iOS 7, which helps somewhat.
iOS 8 added setFocusModeLockedWithLensPosition:completionHandler:
. It does indeed look like one could call that to set an initial guess at focus. Doing so also sets the focus mode to AVCaptureFocusModeLocked
, so upon completion one would then want to set the focus mode to AVCaptureFocusModeContinuousAutoFocus
to resume auto-focusing thereafter.
It will take a bit of experimenting with the lensPosition
value. As @josharian speculated, Apple helpfully tells us that A given lens position value does not correspond to an exact physical distance, nor does it represent a consistent focus distance from device to device.
I'm almost talking myself into coding this myself! But I really don't have the time these days.
from card.io-ios-source.
See also #21. Maybe you two can work on this together?
from card.io-ios-source.
Related Issues (20)
- how can we use cardiodataentryviewcontroller ui in our project,
- Card.IO breaks with OpenCV 3.0 or above
- how to install the credit card scanning function (app) in my iphone
- archive all repositories? HOT 3
- Changing the models HOT 2
- Get high resolution of card image
- Does it scan credit cards only? HOT 3
- Block.h XprType does not refer to a value.
- Stuck at Carthage Update HOT 10
- Cannot use card.io as a pod dependency HOT 1
- Finnish localization is still not working HOT 3
- EXC_BAD_ACCESS upon [CardIOGPURenderer withContextDo:] (glFlush)
- Change Title
- Frame of card scanner
- Support for new Visa quick read format
- when running 'fab build:outdir=~' getting error 'Fatal error: Couldn't find any fabfiles!' HOT 4
- I'd like to replace the card. IO of OpenCV, could you tell me how to operate. How to build your own platform-specific OpenCV static libraries ?
- Card IO Native Ionic Plugin
- Using front camera HOT 1
- card.io-iOS-source unable to run, HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from card.io-ios-source.