BlinkID / blinkid-ios

Everything you need to add AI-driven ID scanning into your native iOS app.
https://microblink.com/products/blinkid
380 stars 90 forks source link

Barcode on GreenID is not scanning. #116

Closed sunitadoubleeye closed 6 years ago

sunitadoubleeye commented 6 years ago

// document detector var documentDetectorSetting = PPDocumentDetectorSettings(numStableDetectionsThreshold: 5) var specification = PPDocumentSpecification.new(from: .a4Landscape) // specification.portraitScale = PPMakeScale(0.8,0.2); specification.scanningMode = .auto

    if (docType == CFADocumentType.CFALicense)
    {
        specification = PPDocumentSpecification.new(from: .id1Card)
    }
    else if (docType == CFADocumentType.CFAGreenID)
    {
        specification = PPDocumentSpecification.new(from: .a4Portrait)
    }
    else if (docType == CFADocumentType.CFAPassport_Landscape)
    {
        specification = PPDocumentSpecification.new(from: .a4Landscape)
    }
    var documentDecoding:[PPDecodingInfo] = [PPDecodingInfo]()

    let decodingInfo:PPDecodingInfo = PPDecodingInfo(location: CGRect(x: 0.0, y: 0.0, width: 1.0, height: 1.0), dewarpedHeight: 700, uniqueId: "IDCard1")
    documentDecoding.append(decodingInfo)
    specification.setDecodingInfo(documentDecoding)
    documentDetectorSetting.setDocumentSpecifications([specification])
    return documentDetectorSetting

    //  Mrtd detector
     var mrtdDecoding:[PPDecodingInfo] = [PPDecodingInfo]()
    let decodingInfo:PPDecodingInfo = PPDecodingInfo(location: CGRect(x: 0.0, y: 0.0, width: 1.0, height: 1.0), dewarpedHeight: 700, uniqueId: "MRTD")
    mrtdDecoding.append(decodingInfo)
    let mrtdDetectorSettings: PPMrtdDetectorSettings = PPMrtdDetectorSettings(decodingInfoArray: mrtdDecoding)

    // Mutli detector Setup
    let multiDetectorSettings:PPMultiDetectorSettings =  PPMultiDetectorSettings(settingsArray: [documentDetectorSetting, mrtdDetectorSettings])
    multiDetectorSettings.allowMultipleResults = true;

    // barCode detector Setup

let barcodeRecognizerSettings:PPBarDecoderRecognizerSettings = PPBarDecoderRecognizerSettings() barcodeRecognizerSettings.scanCode39 = true

    // Detector recognizer
    let detectorRecognizerSettings:PPDetectorRecognizerSettings = PPDetectorRecognizerSettings(detectorSettings: multiDetectorSettings)
    settings.scanSettings.add(detectorRecognizerSettings)
    settings.scanSettings.add(barcodeRecognizerSettings)

ID Card is scanning smoothly but greenID is only capturing document image only not barcode.

ghost commented 6 years ago

Hi @sunitadoubleeye,

sorry for the late response, could you send the code you use to retrieve results in PPScanningDelegate method scanningViewController:didOutputResults: . Could you also send a sample of this type of document, something like a link to a photo of document on web.

Kind regards, Jure

sunitadoubleeye commented 6 years ago

Thanks, It is working now.

On Nov 2, 2017 7:32 PM, "Jure Čular" notifications@github.com wrote:

Hi @sunitadoubleeye https://github.com/sunitadoubleeye,

sorry for the late response, could you send the code you use to retrieve results in PPScanningDelegate method scanningViewController: didOutputResults: . Could you also send a sample of this type of document, something like a link to a photo of document on web.

Kind regards, Jure

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/BlinkID/blinkid-ios/issues/116#issuecomment-341429836, or mute the thread https://github.com/notifications/unsubscribe-auth/AeZnbm5nHwoeDyEtltfO1XA6pNjRv69Bks5sycsEgaJpZM4P9-QS .