Library for scanning documents via MRZ using Vision API.
- iOS 13.0+
- macOS 10.15+
- Mac Catalyst 13.0+
- tvOS 13.0+
dependencies: [
.package(url: "https://github.com/romanmazeev/MRZScanner.git", .upToNextMajor(from: "1.1.0"))
]
The library has an SPM dependency for MRZ code parsing.
- For both image scanning and live scanning, we need to create
ScanningConfiguration
ScanningConfiguration(orientation: .up, regionOfInterest: roi, minimumTextHeight: 0.1, recognitionLevel: .fast)
- After you need to start scanning
/// Live scanning
for try await scanningResult in imageStream.scanForMRZCode(configuration: configuration) {
// Handle `scanningResult` here
// Use `return` to cancel scanning
return
}
/// Single scanning
let scanningResult = try await image.scanForMRZCode(configuration: configuration)
The example project is located inside the Example
folder.
To run it, you need a device with the minimum required OS version.
The library is distributed under the MIT LICENSE.