Skip to content

Commit

Permalink
updated sample apps
Browse files Browse the repository at this point in the history
  • Loading branch information
dino.gustin committed Jun 30, 2016
1 parent 0728517 commit 2ad9047
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class ViewController: UIViewController, PPScanningDelegate {
/** 2. Setup the license key */

// Visit www.microblink.com to get the license key for your app
settings.licenseSettings.licenseKey = "N7E2CVWA-53NU6P42-4R5PPORH-EG4IDJLM-2DYMTRYX-YYID4OQ4-QQGZRDLH-PL22BO5S"
settings.licenseSettings.licenseKey = "DQJ6ICMF-YSQFSXVG-YMCULUIW-RGFDKJGE-UL4FWYU7-RI2SJRFC-7BNWEHZK-QERKXNQU"


/**
Expand Down
2 changes: 1 addition & 1 deletion Samples/BlinkOCR-sample/BlinkOCR-sample/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ - (PPCameraCoordinator *)coordinatorWithError:(NSError**)error {
/** 2. Setup the license key */

// Visit www.microblink.com to get the license key for your app
settings.licenseSettings.licenseKey = @"E5GAM3PR-QUAAZNCG-4OZNNF5A-6M3ZZNAG-EO4V2VWM-ZOWXP23P-AJB2Q76G-CJYXH7NE";
settings.licenseSettings.licenseKey = @"IYKDZ5KK-Z43DS2MO-R6PU43YC-IOUP7NYN-B3YM4B2Y-FMLRZ6TY-CIGQ44BR-7T4PV7RO";


/**
Expand Down
2 changes: 1 addition & 1 deletion Samples/Detector-sample/Detector-sample/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ - (PPCameraCoordinator *)coordinatorWithError:(NSError**)error {
/** 2. Setup the license key */

// Visit www.microblink.com to get the license key for your app
settings.licenseSettings.licenseKey = @"G5R3PKW5-7KUCFX6B-HHG4VJE4-76CSSGVD-6FJ6JFSP-5U4AH3JY-APWTQA7N-HABZVSIJ"; // Valid temporarily
settings.licenseSettings.licenseKey = @"EXWAJZZY-A4G7YT5N-FDEXLOKC-6LSZHCGZ-WX7YKKI2-UPYVHZEW-J7WTRA63-WTKN5A6Y"; // Valid temporarily


/** 3. Set up what is being scanned. See detailed guides for specific use cases. */
Expand Down
11 changes: 3 additions & 8 deletions Samples/DirectAPI-sample/DirectAPI-sample/CameraViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ - (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIVi
}

- (IBAction)closeCamera:(id)sender {
[((AVCaptureVideoDataOutput *)_captureSession.outputs[0]) setVideoSettings:[NSDictionary dictionaryWithObject:[NSNumber numberWithInt:kCVPixelFormatType_32BGRA] forKey:(id)kCVPixelBufferPixelFormatTypeKey]];
[self dismissViewControllerAnimated:YES completion:nil];
}

- (void)viewDidAppear:(BOOL)animate {
Expand Down Expand Up @@ -188,13 +188,8 @@ - (AVCaptureDevice *)cameraWithPosition:(AVCaptureDevicePosition) position {
}

- (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection {
OSType pixelFormat = CVPixelBufferGetPixelFormatType(CMSampleBufferGetImageBuffer(sampleBuffer));

if(pixelFormat == kCVPixelFormatType_420YpCbCr8BiPlanarFullRange) {
NSLog(@"YUV");
} else {
NSLog(@"BGRA");
}
[self.coordinator processImage:[PPImage imageWithCmSampleBuffer:sampleBuffer]];

}

Expand All @@ -211,7 +206,7 @@ - (void)createCoordinator {
/** 2. Setup the license key */

// Visit www.microblink.com to get the license key for your app
settings.licenseSettings.licenseKey = @"UJ4FY6F5-BWLRGC6Y-3DKUK6NN-YVJURO7R-4WPK5D6C-FP5ITGVQ-6SW4LU2D-PAG6EA5V";
settings.licenseSettings.licenseKey = @"7J7EBQVU-I5OSBF2E-QT7LBDCU-4RSDE72H-L4TSFPDR-XRY3Y4N4-OG6HCPAR-STLYN6KU";


/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ - (void)createCoordinator {
/** 2. Setup the license key */

// Visit www.microblink.com to get the license key for your app
settings.licenseSettings.licenseKey = @"UJ4FY6F5-BWLRGC6Y-3DKUK6NN-YVJURO7R-4WPK5D6C-FP5ITGVQ-6SW4LU2D-PAG6EA5V";
settings.licenseSettings.licenseKey = @"7J7EBQVU-I5OSBF2E-QT7LBDCU-4RSDE72H-L4TSFPDR-XRY3Y4N4-OG6HCPAR-STLYN6KU";


/**
Expand Down
31 changes: 21 additions & 10 deletions Samples/Templating-Sample/Templating-Sample/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ - (PPCameraCoordinator *)coordinatorWithError:(NSError**)error {
/** 2. Setup the license key */

// Visit www.microblink.com to get the license key for your app
settings.licenseSettings.licenseKey = @"PXDINEKM-NYNWDIZO-MOG7DWJD-2MVL5I3O-DE3YGZK4-Z5SVZT3F-LTHWLXBO-NMHHINUI"; // Valid temporarily
settings.licenseSettings.licenseKey = @"VOEZDAU5-OY4L6N6D-IML6XBV6-UNXBSN4D-MVOM6ZK4-Z5SVZT3F-LTHWLXBO-NMHHINJ6"; // Valid temporarily



Expand Down Expand Up @@ -106,14 +106,16 @@ - (PPCameraCoordinator *)coordinatorWithError:(NSError**)error {
/**
* tweak OCR engine options - allow only recognition of uppercase letters used in Croatia
*/
nameParser.options.charWhitelist = [self uppercaseCharsWhitelist];

PPOcrEngineOptions *options = [[PPOcrEngineOptions alloc] init];
options.charWhitelist = [self uppercaseCharsWhitelist];
[nameParser setOptions:options];

/**
* Add parser to recognizer settings
*/
[ocrSettings addOcrParser:nameParser name:ID_FIRST_NAME group:ID_FIRST_NAME];

/**
/**
* Locations of first name string on borth old and new ID cards
*/
CGRect oldIdNameLocation = CGRectMake(0.282, 0.333, 0.306, 0.167);
Expand All @@ -131,7 +133,10 @@ - (PPCameraCoordinator *)coordinatorWithError:(NSError**)error {
{
int dewarpHeight = 150;
PPRegexOcrParserFactory *nameParser = [[PPRegexOcrParserFactory alloc] initWithRegex:@"([A-ZŠĐŽČĆ]+ ?)+"];
nameParser.options.charWhitelist = [self uppercaseCharsWhitelist];

PPOcrEngineOptions *options = [[PPOcrEngineOptions alloc] init];
options.charWhitelist = [self uppercaseCharsWhitelist];
[nameParser setOptions:options];

[ocrSettings addOcrParser:nameParser name:ID_LAST_NAME group:ID_LAST_NAME];

Expand All @@ -155,13 +160,17 @@ - (PPCameraCoordinator *)coordinatorWithError:(NSError**)error {
[charWhitelist addObject:[PPOcrCharKey keyWithCode:'F' font:PP_OCR_FONT_ANY]];
[charWhitelist addObject:[PPOcrCharKey keyWithCode:'/' font:PP_OCR_FONT_ANY]];
[charWhitelist addObject:[PPOcrCharKey keyWithCode:0xC5 font:PP_OCR_FONT_ANY]];
sexParser.options.charWhitelist = charWhitelist;
PPOcrEngineOptions *options = [[PPOcrEngineOptions alloc] init];
options.charWhitelist = charWhitelist;
[sexParser setOptions:options];

[ocrSettings addOcrParser:sexParser name:ID_SEX group:ID_SEX_CITIZENSHIP_DOB];

/** Setup citizenship parser */
PPRegexOcrParserFactory *citizenshipParser = [[PPRegexOcrParserFactory alloc] initWithRegex:@"[A-Z]{3}"];
citizenshipParser.options.charWhitelist = [self uppercaseCharsWhitelist];
options = [[PPOcrEngineOptions alloc] init];
options.charWhitelist = [self uppercaseCharsWhitelist];
[citizenshipParser setOptions:options];

[ocrSettings addOcrParser:citizenshipParser name:ID_CITIZENSHIP group:ID_SEX_CITIZENSHIP_DOB];

Expand Down Expand Up @@ -195,8 +204,10 @@ - (PPCameraCoordinator *)coordinatorWithError:(NSError**)error {
for (int c = '0'; c <= '9'; c++) {
[charWhitelist addObject:[PPOcrCharKey keyWithCode:c font:PP_OCR_FONT_ANY]];
}
documentNumberParser.options.charWhitelist = charWhitelist;
documentNumberParser.options.minimalLineHeight = 35;
PPOcrEngineOptions *options = [[PPOcrEngineOptions alloc] init];
options.charWhitelist = charWhitelist;
options.minimalLineHeight = 35;
[documentNumberParser setOptions:options];

[ocrSettings addOcrParser:documentNumberParser name:ID_DOCUMENT_NUMBER group:ID_DOCUMENT_NUMBER_NEW];
[ocrSettings addOcrParser:documentNumberParser name:ID_DOCUMENT_NUMBER group:ID_DOCUMENT_NUMBER_OLD];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class ViewController: UIViewController, PPScanningDelegate {
/** 2. Setup the license key */

// Visit www.microblink.com to get the license key for your app
settings.licenseSettings.licenseKey = "JK3VEQ6N-NJGUTY2C-3GRZ53K4-A66MQJO2-SHETBEOJ-GCI4SMER-ZEYJCSPC-E7GBIII7"
settings.licenseSettings.licenseKey = "FNTJASXT-CWXGYGXU-JJQWKISK-NQNLJ2OQ-6ZOVNPGI-EXNJDSJQ-SHETAEK5-LYJRSZUT"


/**
Expand Down
2 changes: 1 addition & 1 deletion Samples/pdf417-sample/pdf417-sample/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ - (PPCameraCoordinator *)coordinatorWithError:(NSError**)error {
/** 2. Setup the license key */

// Visit www.microblink.com to get the license key for your app
settings.licenseSettings.licenseKey = @"TZXZM4BO-GWEDAAYD-INKHNUUW-H3WZJE6C-HTQIZMGR-BBCGAQHU-Q62SSGXH-D7365VBI";
settings.licenseSettings.licenseKey = @"755A7BPT-B635RWMZ-JF5HBDIK-RIX2OBFQ-2EEEIYCA-6SD3KKM2-66MUT54Y-6JMVP4RH";


/**
Expand Down

0 comments on commit 2ad9047

Please sign in to comment.