##SmartID Scan Library (v1.0.0)
SmartID Scan is a real-time video stream decoder, allowing to scan various type of content.
Depending on the version you ordered, you will be able to use it to decode any combination of the following codes :
-
1D/2D barcodes (EAN8, EAN13, UPC, Code39, Code128, Datamatrix, databars, QRCodes, Aztec codes, ... )
-
Multiple OCR types :
- OCR-B MRZ used on official papers (Swiss ID Cards, Swiss Passports, Swiss Driving license)
- Swiss car plates
- European Health Insurance Card
- Swiss Inpayment Slips
-
Our decoder never stops growing, ask us about what's new in SmartID Scan !
This project has been tested with iOS 6+ and build with xCode 5.0+. If your project supports lower versions of the iOS framework, SmartID Scan may not work as expected and could show unexpected behaviour in your application.
This project is compatible with ARC and non-ARC projects
The library has been build with iOS SDK 7.1. It is strongly advised to use it as well to compile your projet.
##Integration steps
This project is a demo iOS app to show how to integrate our decoding library in an iOS application. To make it work, just follow the few steps below :
-
Add the library libSmartIDScan.a to your project (drag & drop to your project)
-
Add the library headers : SmartScanner.h (library functions) and SmartIDScanTypes.h
-
In your project properties, you will need to add the following framework :
libc++.dylib
libstdc++.dylib
AVFundation
CoreVideo
CoreMedia
-
If you own a version of SmartID Scan providing OCR features, you will also need to download an iOS version of the OpenCV Framework 2.4.9 . You can download it and drag and drop it on your project.
-
In your project target properties, in the "Build Settings" you will also need to set the "C++ Standard Library" to value "libstdc++".
-
If you don't have any other part of your code using C++ apis, you will also need to drop into your project the "DummyCPPEnable" (.h and .mm) class to let XCode know that part of the project will contain c++ content.
This is all you need to be able to launch this project on a real device for testing purposes.
##Minimal implementation (See the example project for more details)
Interaction with the SmartID Scan library is done with a SmartScanner object. Instantiate it inside a view controller, when you want to use it :
##Start to scan //Create the SmartScanner object reference SmartScanner* sc;
//Init SmartScanner when needed, and set the delegate
sc = [[SmartScanner alloc] init];
sc.scDelegate = self;
//Set which type of code you want to decode
[sc setDecodingType:CODE_INSURANCE_CARDS];
//Retrieve the preview screen and display it on your view
UIView* preview = [sc previewViewWithViewSize:self.view.bounds];
[self.view addSubview:preview];
##Select the type of code you want to decode
You can use a combination of any type (defined in the SmartDecodingTypes enum) that is enabled in the version you have. At any point you can set another decoding type (Verify the enabled types of your SmartID Scan version by calling the version function).
Here are some examples :
-
1D/2D barcodes (EAN8, EAN13, UPC, Code39, Code128, QRCodes, ... )
[sc setDecodingType:CODE_QR_CODES | CODE_1D2D_BARCODES_ALL ];
-
OCR-B MRZ used on official papers (Swiss ID Cards, Swiss Passports, Swiss Driving license)
[sc setDecodingType:CODE_OCR_B_SWISS_IDS | CODE_OCR_B_SWISS_PASSPORTS | CODE_OCR_B_DRV_LICENSES ];
-
Swiss car plates
[sc setDecodingType:CODE_PLATES ];
-
European Health Insurance Card
[sc setDecodingType:CODE_INSURANCE_CARDS ];
-
Swiss Inpayment Slips
[sc setDecodingType:CODE_OCR_B_BVR ];
##Retrieve the results by implementing the delegate protocol
-(void)SmartScannerFoundCode:(SmartScanner*)smartScan code:(NSString*) aCode ofType:(int)aType
{
NSLog(@"SmartScanner result : %@ with type : %d", aCode, aType);
}
##Release the resources when you don't need to use the smartscanner anymore
[sc closeCameraStream];
sc = nil; //ARC
//[sc release] //not ARC
-
Download our decoding libraries (1) on : http://scan.smartidlab.com
-
Download our demo app source code on : https://github.com/SmartIDLab/smartidscan-ios-demo
(1) The demonstration decoding libraries replace some characters in the result string with the character 'X'