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

Sdk Issue #26

Closed
nrvraghu opened this issue Jun 28, 2016 · 26 comments
Closed

Sdk Issue #26

nrvraghu opened this issue Jun 28, 2016 · 26 comments

Comments

@nrvraghu
Copy link

Hi BlinkId Team,
After downloading this app and running into my device it is showing the following errors. approximately i have 12 issues. I am trying to fixe those issues. but i can't . will you please help me on this.

warning: ignoring file ../../MicroBlink.framework/MicroBlink, file was built for unsupported file format ( 0x76 0x65 0x72 0x73 0x69 0x6F 0x6E 0x20 0x68 0x74 0x74 0x70 0x73 0x3A 0x2F 0x2F ) which is not the architecture being linked (arm64): ../../MicroBlink.framework/MicroBlink

Thanks in Advance.

@dgust6
Copy link
Contributor

dgust6 commented Jun 28, 2016

Hello,
This is probably related to not having Git LFS installed. To fix this, you need to install Git LFS (https://git-lfs.github.com) and then clone or reinstall pod completely.

Kind regards,
Dino

@matthewjcooper
Copy link

matthewjcooper commented Jun 28, 2016

I'm getting the exact same issue. i have Git LFS installed and am using xcode version 7.3.1 (7D1014)

please help! below is the error output:

Ld /Users/matthew/Library/Developer/Xcode/DerivedData/BlinkOCRTest-faoogcxslycgoienhlsougicgetd/Build/Products/Debug-iphonesimulator/BlinkOCRTest.app/BlinkOCRTest normal x86_64
cd /Users/matthew/Documents/projects/sandbox/BlinkOCRTest
export IPHONEOS_DEPLOYMENT_TARGET=9.3
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.3.sdk -L/Users/matthew/Library/Developer/Xcode/DerivedData/BlinkOCRTest-faoogcxslycgoienhlsougicgetd/Build/Products/Debug-iphonesimulator -F/Users/matthew/Library/Developer/Xcode/DerivedData/BlinkOCRTest-faoogcxslycgoienhlsougicgetd/Build/Products/Debug-iphonesimulator -F/Users/matthew/Documents/projects/sandbox/BlinkOCRTest/Pods/PPBlinkID -F/Users/matthew/Documents/projects/sandbox/BlinkOCRTest/BlinkOCRTest -filelist /Users/matthew/Library/Developer/Xcode/DerivedData/BlinkOCRTest-faoogcxslycgoienhlsougicgetd/Build/Intermediates/BlinkOCRTest.build/Debug-iphonesimulator/BlinkOCRTest.build/Objects-normal/x86_64/BlinkOCRTest.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -mios-simulator-version-min=9.3 -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -ObjC -lc++ -liconv -framework AVFoundation -framework Accelerate -framework AssetsLibrary -framework AudioToolbox -framework CoreMedia -framework MicroBlink -fobjc-arc -fobjc-link-runtime -lPods-BlinkOCRTest -Xlinker -dependency_info -Xlinker /Users/matthew/Library/Developer/Xcode/DerivedData/BlinkOCRTest-faoogcxslycgoienhlsougicgetd/Build/Intermediates/BlinkOCRTest.build/Debug-iphonesimulator/BlinkOCRTest.build/Objects-normal/x86_64/BlinkOCRTest_dependency_info.dat -o /Users/matthew/Library/Developer/Xcode/DerivedData/BlinkOCRTest-faoogcxslycgoienhlsougicgetd/Build/Products/Debug-iphonesimulator/BlinkOCRTest.app/BlinkOCRTest

ld: warning: ignoring file /Users/matthew/Documents/projects/sandbox/BlinkOCRTest/Pods/PPBlinkID/MicroBlink.framework/MicroBlink, file was built for unsupported file format ( 0x76 0x65 0x72 0x73 0x69 0x6F 0x6E 0x20 0x68 0x74 0x74 0x70 0x73 0x3A 0x2F 0x2F ) which is not the architecture being linked (x86_64): /Users/matthew/Documents/projects/sandbox/BlinkOCRTest/Pods/PPBlinkID/MicroBlink.framework/MicroBlink
Undefined symbols for architecture x86_64:
"OBJC_CLASS$_PPCameraCoordinator", referenced from:
objc-class-ref in ViewController.o
"OBJC_CLASS$_PPMrtdRecognizerSettings", referenced from:
objc-class-ref in ViewController.o
"OBJC_CLASS$_PPSettings", referenced from:
objc-class-ref in ViewController.o
"OBJC_CLASS$_PPUsdlRecognizerSettings", referenced from:
objc-class-ref in ViewController.o
"OBJC_CLASS$_PPViewControllerFactory", referenced from:
objc-class-ref in ViewController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

@dgust6
Copy link
Contributor

dgust6 commented Jun 28, 2016

Are you installing our SDK via CocoaPods or manually (by cloning, or downloading a release)?

@matthewjcooper
Copy link

I’ve tried downloading the cloning project and running the samples. Downloading the zip from gitup and running the samples. Manually copying the frameworks into a new project and now I just tried using cocoa pods. And every method I try I get the same issue. It compiles with just referencing the header, but the minute I add the code below to my main view controller it gives the errors I’ve attached:

  • (IBAction)didTapScan:(id)sender {

    /** Instantiate the scanning coordinator */

    NSError *error;

    PPCameraCoordinator *coordinator = [self coordinatorWithError:&error];

    /** If scanning isn't supported, present an error */

    if (coordinator == nil) {

    NSString *messageString = [error localizedDescription];
    
    [[[UIAlertView alloc] initWithTitle:@"Warning"
    
                                message:messageString
    
                               delegate:nil
    
                      cancelButtonTitle:@"OK"
    
                      otherButtonTitles:nil, nil] show];
    
    
    
    return;
    

    }

    /** Allocate and present the scanning view controller */

    UIViewController* scanningViewController = [PPViewControllerFactory cameraViewControllerWithDelegate:self coordinator:coordinator error:nil];

    /** You can use other presentation methods as well */

    [self presentViewController:scanningViewController animated:YES completion:nil];

}

/**

  • Method allocates and initializes the Scanning coordinator object.

  • Coordinator is initialized with settings for scanning

  • Modify this method to include only those recognizer settings you need. This will give you optimal performance

  • @param error Error object, if scanning isn't supported

*/

  • (PPCameraCoordinator )coordinatorWithError:(NSError*)error {

    /** 0. Check if scanning is supported */

    if ([PPCameraCoordinator isScanningUnsupportedForCameraType:PPCameraTypeBack error:error]) {

    return nil;
    

    }

    /** 1. Initialize the Scanning settings */

    // Initialize the scanner settings object. This initialize settings with all default values.

    PPSettings *settings = [[PPSettings alloc] init];

    /** 2. Setup the license key */

    // Visit www.microblink.com to get the license key for your app

    settings.licenseSettings.licenseKey = @"6EZH3JXN-CYKHWVII-4EOV34IK-AJMPUV3I-VJKQRYI4-MKDM4QXI-SNQ3V527-VARHA7EY";

    /**

      1. Set up what is being scanned. See detailed guides for specific use cases.
    • Here's an example for initializing MRTD and USDL scanning

      */

    // To specify we want to perform MRTD (machine readable travel document) recognition, initialize the MRTD recognizer settings

    PPMrtdRecognizerSettings *mrtdRecognizerSettings = [[PPMrtdRecognizerSettings alloc] init];

    // Add MRTD Recognizer setting to a list of used recognizer settings

    [settings.scanSettings addRecognizerSettings:mrtdRecognizerSettings];

    // To specify we want to perform USDL (US Driver's license) recognition, initialize the USDL recognizer settings

    PPUsdlRecognizerSettings *usdlRecognizerSettings = [[PPUsdlRecognizerSettings alloc] init];

    // Add USDL Recognizer setting to a list of used recognizer settings

    [settings.scanSettings addRecognizerSettings:usdlRecognizerSettings];

    /** 4. Initialize the Scanning Coordinator object */

    PPCameraCoordinator *coordinator = [[PPCameraCoordinator alloc] initWithSettings:settings];

    return coordinator;

}

From: Pickles112358 <notifications@github.commailto:notifications@github.com>
Reply-To: BlinkID/blinkid-ios <reply@reply.github.commailto:reply@reply.github.com>
Date: Tuesday, June 28, 2016 at 10:37 AM
To: BlinkID/blinkid-ios <blinkid-ios@noreply.github.commailto:blinkid-ios@noreply.github.com>
Cc: Matthew Cooper <matthewc@atiba.commailto:matthewc@atiba.com>, Comment <comment@noreply.github.commailto:comment@noreply.github.com>
Subject: Re: [BlinkID/blinkid-ios] Sdk Issue (#26)

Are you installing our SDK via CocoaPods or manually (by cloning, or downloading a release)?


You are receiving this because you commented.
Reply to this email directly, view it on GitHubhttps://github.com//issues/26#issuecomment-229088393, or mute the threadhttps://github.com/notifications/unsubscribe/ABXggYEC4nRSn169E74tkViWL_Zhln5cks5qQT-sgaJpZM4JAG9x.

Matthew Cooper

6153893357x127
matthewc@atiba.com

ATIBA | ENGAGING SOLUTIONS
Network Services | Custom Software | Website Development | Mobile Apps
Interactive Marketing | Microsoft Certified Partner | Dell GeoPartner
www.atiba.comhttp://www.atiba.com

@dgust6
Copy link
Contributor

dgust6 commented Jun 28, 2016

Just for confirmation,
Could you please check the size of your local MicroBlink.framework/MicroBlink file (like this one: https://github.com/BlinkID/blinkid-ios/blob/master/MicroBlink.framework/MicroBlink)?

@matthewjcooper
Copy link

OK yeah I think that’s the issue, I checked to make sure earlier that it wasn’t under 100mb, but I read 134bytes as 134 mb :). So yeah ,looks like my git lfs isn’t working right. I installed it using brew, should I restart my machine or something?

From: Pickles112358 <notifications@github.commailto:notifications@github.com>
Reply-To: BlinkID/blinkid-ios <reply@reply.github.commailto:reply@reply.github.com>
Date: Tuesday, June 28, 2016 at 10:44 AM
To: BlinkID/blinkid-ios <blinkid-ios@noreply.github.commailto:blinkid-ios@noreply.github.com>
Cc: Matthew Cooper <matthewc@atiba.commailto:matthewc@atiba.com>, Comment <comment@noreply.github.commailto:comment@noreply.github.com>
Subject: Re: [BlinkID/blinkid-ios] Sdk Issue (#26)

Just for confirmation,
Could you please check the size of your local MicroBlink.framework/MicroBlink file (like this one: https://github.com/BlinkID/blinkid-ios/blob/master/MicroBlink.framework/MicroBlink)?


You are receiving this because you commented.
Reply to this email directly, view it on GitHubhttps://github.com//issues/26#issuecomment-229090666, or mute the threadhttps://github.com/notifications/unsubscribe/ABXggchMh-xbd_pJ_CyCS8eTdeznL_Gmks5qQUFQgaJpZM4JAG9x.

Matthew Cooper

6153893357x127
matthewc@atiba.com

ATIBA | ENGAGING SOLUTIONS
Network Services | Custom Software | Website Development | Mobile Apps
Interactive Marketing | Microsoft Certified Partner | Dell GeoPartner
www.atiba.comhttp://www.atiba.com

@dgust6
Copy link
Contributor

dgust6 commented Jun 28, 2016

Yeah, the issue is definetly with Git LFS then. I think restarting the console/terminal will be enough.
If it doesn't work then, try reinstalling Git LFS and restarting your machine.

If you do not wish to use Git LFS, you can manually download the release zip here: https://github.com/BlinkID/blinkid-ios/releases/download/v2.1.0/BlinkID-ios_v2.1.0.zip

Sample from that zip should work out of the box and you can follow manual installation guide with it.

Let me know if you managed to fix the error or if you have any other issues.

Kind regards,
Dino

@matthewjcooper
Copy link

Great it’s working now.

I have another issue with the OCR sdk. it’s building and running, and I’m trying to test capturing the text from an insurance card. I can see it highlighting all the letters on the overlay, but then it just sits there changing a couple of the letters back n forth and never completes. Is it supposed to auto complete the scan and call the did output method on it’s own or do I need to trigger it somehow when I am happy with the match?

From: Pickles112358 <notifications@github.commailto:notifications@github.com>
Reply-To: BlinkID/blinkid-ios <reply@reply.github.commailto:reply@reply.github.com>
Date: Tuesday, June 28, 2016 at 10:52 AM
To: BlinkID/blinkid-ios <blinkid-ios@noreply.github.commailto:blinkid-ios@noreply.github.com>
Cc: Matthew Cooper <matthewc@atiba.commailto:matthewc@atiba.com>, Comment <comment@noreply.github.commailto:comment@noreply.github.com>
Subject: Re: [BlinkID/blinkid-ios] Sdk Issue (#26)

Yeah, the issue is definetly with Git LFS then. I think restarting the console/terminal will be enough.
If it doesn't work then, try reinstalling Git LFS and restarting your machine.

If you do not wish to use Git LFS, you can manually download the release zip here: https://github.com/BlinkID/blinkid-ios/releases/download/v2.1.0/BlinkID-ios_v2.1.0.zip

Sample from that zip should work out of the box and you can follow manual installation guide with it.

Let me know if you managed to fix the error or if you have any other issues.

Kind regards,
Dino


You are receiving this because you commented.
Reply to this email directly, view it on GitHubhttps://github.com//issues/26#issuecomment-229093469, or mute the threadhttps://github.com/notifications/unsubscribe/ABXggSW3IMyRGqB-sLVh-xFMhBSkCViVks5qQUNYgaJpZM4JAG9x.

Matthew Cooper

6153893357x127
matthewc@atiba.com

ATIBA | ENGAGING SOLUTIONS
Network Services | Custom Software | Website Development | Mobile Apps
Interactive Marketing | Microsoft Certified Partner | Dell GeoPartner
www.atiba.comhttp://www.atiba.com

@dgust6
Copy link
Contributor

dgust6 commented Jun 28, 2016

This is intended behaviour:
Best video frames are sent to recognition
Scanning results on these frames are outputted and presented on screen.

For customization please checkout our GitHub wiki and our "Getting started" guide:
https://github.com/BlinkID/blinkid-ios/wiki/Getting-started

You can use our Templating API to scan custom objects: such as IDs, passports or in your case, insurance cards.

You can check our TemplatingAPI-sample for example of scanning croatian ID card.
Also, you can checkout our Templating API documentation on wiki: https://github.com/BlinkID/blinkid-ios/wiki/Using-Templating-API

Bear in mind that scanning custom cards is no easy task but all the documentation is available on the wiki.

If you need anything else don't hesitate to contact us.

Kind regards,
Dino

@matthewjcooper
Copy link

Actually ignore that I just noticed that it’s logging it to the system log. However it is switching back n forth a lot between correct recognition and bad recognition.

From: Pickles112358 <notifications@github.commailto:notifications@github.com>
Reply-To: BlinkID/blinkid-ios <reply@reply.github.commailto:reply@reply.github.com>
Date: Tuesday, June 28, 2016 at 10:52 AM
To: BlinkID/blinkid-ios <blinkid-ios@noreply.github.commailto:blinkid-ios@noreply.github.com>
Cc: Matthew Cooper <matthewc@atiba.commailto:matthewc@atiba.com>, Comment <comment@noreply.github.commailto:comment@noreply.github.com>
Subject: Re: [BlinkID/blinkid-ios] Sdk Issue (#26)

Yeah, the issue is definetly with Git LFS then. I think restarting the console/terminal will be enough.
If it doesn't work then, try reinstalling Git LFS and restarting your machine.

If you do not wish to use Git LFS, you can manually download the release zip here: https://github.com/BlinkID/blinkid-ios/releases/download/v2.1.0/BlinkID-ios_v2.1.0.zip

Sample from that zip should work out of the box and you can follow manual installation guide with it.

Let me know if you managed to fix the error or if you have any other issues.

Kind regards,
Dino


You are receiving this because you commented.
Reply to this email directly, view it on GitHubhttps://github.com//issues/26#issuecomment-229093469, or mute the threadhttps://github.com/notifications/unsubscribe/ABXggSW3IMyRGqB-sLVh-xFMhBSkCViVks5qQUNYgaJpZM4JAG9x.

Matthew Cooper

6153893357x127
matthewc@atiba.com

ATIBA | ENGAGING SOLUTIONS
Network Services | Custom Software | Website Development | Mobile Apps
Interactive Marketing | Microsoft Certified Partner | Dell GeoPartner
www.atiba.comhttp://www.atiba.com

@matthewjcooper
Copy link

Do you have a tamarin binding project for the Blink OCR library? Right now I only see one for Blink ID.

From: Pickles112358 <notifications@github.commailto:notifications@github.com>
Reply-To: BlinkID/blinkid-ios <reply@reply.github.commailto:reply@reply.github.com>
Date: Tuesday, June 28, 2016 at 10:52 AM
To: BlinkID/blinkid-ios <blinkid-ios@noreply.github.commailto:blinkid-ios@noreply.github.com>
Cc: Matthew Cooper <matthewc@atiba.commailto:matthewc@atiba.com>, Comment <comment@noreply.github.commailto:comment@noreply.github.com>
Subject: Re: [BlinkID/blinkid-ios] Sdk Issue (#26)

Yeah, the issue is definetly with Git LFS then. I think restarting the console/terminal will be enough.
If it doesn't work then, try reinstalling Git LFS and restarting your machine.

If you do not wish to use Git LFS, you can manually download the release zip here: https://github.com/BlinkID/blinkid-ios/releases/download/v2.1.0/BlinkID-ios_v2.1.0.zip

Sample from that zip should work out of the box and you can follow manual installation guide with it.

Let me know if you managed to fix the error or if you have any other issues.

Kind regards,
Dino


You are receiving this because you commented.
Reply to this email directly, view it on GitHubhttps://github.com//issues/26#issuecomment-229093469, or mute the threadhttps://github.com/notifications/unsubscribe/ABXggSW3IMyRGqB-sLVh-xFMhBSkCViVks5qQUNYgaJpZM4JAG9x.

Matthew Cooper

6153893357x127
matthewc@atiba.com

ATIBA | ENGAGING SOLUTIONS
Network Services | Custom Software | Website Development | Mobile Apps
Interactive Marketing | Microsoft Certified Partner | Dell GeoPartner
www.atiba.comhttp://www.atiba.com

@Natelegreat1
Copy link

Sounds similar to mine! #25
Good luck!

@nrvraghu
Copy link
Author

Hi Dino,
Thanks a lot for the reply. The following link is working fine for me.
https://github.com/BlinkID/blinkid-ios/releases/download/v2.1.0/BlinkID-ios_v2.1.0.zip

@Cerovec
Copy link
Contributor

Cerovec commented Jun 29, 2016

@matthewjcooper We currently support xamarin plugin only for BlinkID. BlinkID actually contains all the features from BlinkOCR (most importantly - BlinkOcrRecognizer), but the functionality is not exported to Xamarin wrapper.

We plan to expose basic BlinkOCR functionality in BlinkID-Xamarin project, but all the customizations, parsing, templating, and so on, will be available only using Native API.

Please open a new issue in BlinkID-xamarin project for this.

@Cerovec
Copy link
Contributor

Cerovec commented Jun 29, 2016

@nrvraghu if the problem is solved, please close the issue. All other issues should be in posted separately :)

@Akshay-iOS-Developer
Copy link

Hi BlinkId Team,
I have updated my blinkId sdk to version 2.9.0 using cocapods and now i am unable to build my project. I have also installed git LFS successfully. I even tried to install it manually but no luck. Also the given sample is not working. It is showing 9 errors. Below is the attached screenshot:-
screen shot 2017-06-11 at 11 41 44 am

@gumnym
Copy link

gumnym commented Jul 31, 2017

Have this same issue

@DoDoENT
Copy link
Member

DoDoENT commented Jul 31, 2017

The error is caused by binaries not being downloaded from LFS.

In your repository, issue following command:

git lfs pull

This will download new binaries and you will not get the same linker error anymore.

@Nalbornoz
Copy link

hi, I've this problem when I build ...

screen shot 2017-10-16 at 8 43 04 pm

@culoi
Copy link
Contributor

culoi commented Oct 17, 2017

@nahuelnewsdeveloper

Please check answer from @DoDoENT above yours:

In your repository, issue following command:

git lfs pull

This will download new binaries and you will not get the same linker error anymore.

@Vitalii-Gozhenko
Copy link

I faced with same issue. I used CocoaPods to install Microblink framework.
Problem is definitelly in git lfs.
Installing (see https://git-lfs.github.com/) and updating (git lfs pull) will resolve the problem.

BUT CocoaPods still keep old PPBlinkID download in cache.
So you need clean cached pod using pod cache clean PPBlinkID.
After that remove Pods folder from your project and re-install pods with pod update

@TusharLama
Copy link

Hi i have implemented pod 'PPBlinkID', '~> 2.17.2’ and Git gls the problem i am facing is the after i put my iphone or ipad camera on the license or any other document i doesn't scan the document i mean to say i am not getting any scan results on this function
func scanningViewController(_ scanningViewController: (UIViewController & PPScanningViewController)?, didOutputResults results: [PPRecognizerResult])
and apart from it ,it call my this function func scanningViewController(_ scanningViewController: (UIViewController & PPScanningViewController)?, didOutputMetadata metadata: PPMetadata)
Kindly help me on this part .Here is my source code

import UIKit
import MicroBlink

class ViewController: UIViewController {

override func viewDidLoad() {
    super.viewDidLoad()
    // Do any additional setup after loading the view, typically from a nib.
}

override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
    // Dispose of any resources that can be recreated.
}

@IBAction func onClickCamera(_ sender: Any) {
    /** Instantiate the scanning coordinator */
    let error: NSErrorPointer = nil
    let coordinator = self.coordinatorWithError(error: error)
    
    /** If scanning isn't supported, present an error */
    if coordinator == nil {
        let messageString: String = (error?.pointee?.localizedDescription) ?? ""
        self.present(UIAlertController(title: "Warning", message: messageString, preferredStyle: .alert), animated: true)
        return
    }
    
    /** Allocate and present the scanning view controller */

    let scanningViewController: UIViewController & PPScanningViewController = PPViewControllerFactory.cameraViewController(with: self, coordinator: coordinator!, error: nil)
    scanningViewController.autorotate = true
    scanningViewController.supportedOrientations = UIInterfaceOrientationMask.all

// /** Allocate and present the scanning view controller */
// let scanningViewController: UIViewController = PPViewControllerFactory.cameraViewController(with: self, coordinator: coordinator!, error: nil)

    /** You can use other presentation methods as well */
    self.present(scanningViewController, animated: true, completion: nil)
}

}

extension ViewController{

func coordinatorWithError(error: NSErrorPointer) -> PPCameraCoordinator? {
    
    /** 0. Check if scanning is supported */
    if (PPCameraCoordinator.isScanningUnsupported(for: PPCameraType.back, error: error)) {
        return nil;
    }
    
    /** 1. Initialize the Scanning settings */
    // Initialize the scanner settings object. This initialize settings with all default values.
    let settings: PPSettings = PPSettings()
    settings.metadataSettings.debugMetadata.debugDetectionFrame = true
    
    
    /** 2. Setup the license key */
    // Visit www.microblink.com to get the license key for your app
    settings.licenseSettings.licenseKey = "************************"
    
    
    /**
     * 3. Set up what is being scanned. See detailed guides for specific use cases.
     * Remove undesired recognizers (added below) for optimal performance.
     */
    
    do { // Remove this if you're not using MRTD recognition
        
        // To specify we want to perform MRTD (machine readable travel document) recognition, initialize the MRTD recognizer settings
        let mrtdRecognizerSettings = PPMrtdRecognizerSettings()
        mrtdRecognizerSettings.allowSpecialCharacters = true
        mrtdRecognizerSettings.allowUnparsedResults = true
        mrtdRecognizerSettings.allowUnverifiedResults = true
        
        /** You can modify the properties of mrtdRecognizerSettings to suit your use-case */
        // tell the library to get full image of the document. Setting this to YES makes sense just if
        // settings.metadataSettings.dewarpedImage = YES, otherwise it wastes CPU time.
       // mrtdRecognizerSettings.dewarpFullDocument = false;
        
        // Add MRTD Recognizer setting to a list of used recognizer settings
        settings.scanSettings.add(mrtdRecognizerSettings)
    }
    
    
    do { // Remove this if you're not using USDL recognition
        
        // To specify we want to perform USDL (US Driver's license) recognition, initialize the USDL recognizer settings
        let usdlRecognizerSettings = PPUsdlRecognizerSettings()
        
        /** You can modify the properties of usdlRecognizerSettings to suit your use-case */
        
        // Add USDL Recognizer setting to a list of used recognizer settings
        settings.scanSettings.add(usdlRecognizerSettings)
    }
    
    /** 4. Initialize the Scanning Coordinator object */
    
    return PPCameraCoordinator(settings: settings)
}

}

extension ViewController: PPScanningDelegate{

func scanningViewControllerUnauthorizedCamera(_ scanningViewController: UIViewController & PPScanningViewController) {
    debugPrint("scanning view controller unauthorize camera")
}

func scanningViewController(_ scanningViewController: UIViewController & PPScanningViewController, didFindError error: Error) {
    debugPrint("Scanning View controller called")
}

func scanningViewControllerDidClose(_ scanningViewController: UIViewController & PPScanningViewController) {
    self.dismiss(animated: true, completion: nil)
}

func scanningViewController(_ scanningViewController: (UIViewController & PPScanningViewController)?, didOutputResults results: [PPRecognizerResult]) {
    
    guard results.count > 0 else {
        return
    }
    
    guard let scanningViewController = scanningViewController else {
        return
    }
    
    /**
     * Here you process scanning results. Scanning results are given in the array of PPRecognizerResult objects.
     * Each member of results array will represent one result for a single processed image
     * Usually there will be only one result. Multiple results are possible when there are 2 or more detected objects on a single image (i.e. pdf417 and QR code side by side)
     */
    
    // first, pause scanning until we process all the results
    scanningViewController.pauseScanning()
    
    var message = ""
    var title = ""
    
    
    // Collect data from the result
    for result in results {
        
        title = "Scan result"
        message = result.description

// if (result is PPGermanIDFrontRecognizerResult) {
// // do something with result
// }
}

    // present the alert view with scanned results
    
    let alertController: UIAlertController = UIAlertController.init(title: title, message: message, preferredStyle: UIAlertControllerStyle.alert)
    
    let okAction: UIAlertAction = UIAlertAction.init(title: "OK", style: UIAlertActionStyle.default,
                                                     handler: { (action) -> Void in
                                                        self.dismiss(animated: true, completion: nil)
    })
    
    alertController.addAction(okAction)
    scanningViewController.present(alertController, animated: true, completion: nil)
    

}


func scanningViewController(_ scanningViewController: (UIViewController & PPScanningViewController)?, didOutputMetadata metadata: PPMetadata) {
    
    if (metadata is PPImageMetadata) {
        
        let result: PPImageMetadata = metadata as! PPImageMetadata
        
        let image: UIImage = result.image()
        
        print("result \(image)")

// if (result.name == PPMyKadRecognizerSettings.full_DOCUMENT_IMAGE()) {
// print("This image is EUDL full document");
// }
}
}

}

@culoi
Copy link
Contributor

culoi commented Apr 27, 2018

Hi @nrvraghu

What type of the document are you scanning?

ID, DL, Passport?

Also, from which country?

Regards

@TusharLama
Copy link

TusharLama commented Apr 27, 2018 via email

@culoi
Copy link
Contributor

culoi commented Apr 27, 2018

Hi @TusharLama

At moment we don't support scanning of the Adhar card and India DL.

We are currently working on the refactor of our API and including machine learning OCR model in all of our products. Once we finish refactor we will be open to support these documents.

You can contact our sales team with more information about your use-case at sales@microblink.com

Regards

@TusharLama
Copy link

TusharLama commented Apr 27, 2018 via email

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

No branches or pull requests