smartidscan-ios-demo
Objective-C Objective-C++
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
SmartIDScanDemo.xcodeproj
SmartIDScanDemo
doc/ch.icare.smartscan.SmartID-Scan.docset/Contents
.gitignore
LICENSE
README.md

README.md

##SmartID Scan Library (v1.2.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 !

Requirements

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

##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 :

  1. Add the library libSmartIDScan.a to your project (drag & drop to your project)

  2. Add the library headers : SmartScanner.h (library functions) and SmartIDScanTypes.h

  3. In your project properties, you will need to add the following framework :

    AVFundation

    CoreVideo

    CoreMedia

    CoreGraphics

  4. If you own a version of SmartID Scan providing OCR features, you will also need to download an iOS version of the 2.4.10 OpenCV Framework. You can download it and drag and drop it on your project.

  5. In your project target properties, in the "Build Settings" you will also need to set the "C++ Standard Library" to value "libc++".

  6. 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.

  7. You'll need to add the following key description in your project (since iOS10) to allow your app to use the camera

    NSCameraUsageDescription Some description Text

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

Links

(1) The demonstration decoding libraries replace some characters in the result string with the character 'X'