All Projects β†’ hansemannn β†’ Ios11 Qr Code Example

hansemannn / Ios11 Qr Code Example

Example showing how to use the QR-code detection API (VNDetectBarcodesRequest) in iOS 11.

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Ios11 Qr Code Example

Chineseidcardocr
[Deprecated] πŸ‡¨πŸ‡³δΈ­ε›½δΊŒδ»£θΊ«δ»½θ―ε…‰ε­¦θ―†εˆ«
Stars: ✭ 1,015 (+1218.18%)
Mutual labels:  vision, ios11
CustomVisionMicrosoftToCoreMLDemoApp
This app recognises 3 hand signs - fist, high five and victory hand [ rock, paper, scissors basically :) ] with live feed camera. It uses a HandSigns.mlmodel which has been trained using Custom Vision from Microsoft.
Stars: ✭ 25 (-67.53%)
Mutual labels:  vision, ios11
Facelandmarksdetection
Finds facial features such as face contour, eyes, mouth and nose in an image.
Stars: ✭ 130 (+68.83%)
Mutual labels:  vision, ios11
Imagedetect
βœ‚οΈ Detect and crop faces, barcodes and texts in image with iOS 11 Vision api.
Stars: ✭ 286 (+271.43%)
Mutual labels:  vision, ios11
React Native Vision Camera
πŸ“Έ The Camera library that sees the vision.
Stars: ✭ 443 (+475.32%)
Mutual labels:  vision, qrcode
Ios 11 By Examples
πŸ‘¨πŸ»β€πŸ’» Examples of new iOS 11 APIs
Stars: ✭ 3,327 (+4220.78%)
Mutual labels:  vision, ios11
Visionfacedetection
An example of use a Vision framework for face landmarks detection in iOS 11
Stars: ✭ 258 (+235.06%)
Mutual labels:  vision, ios11
Facecropper
βœ‚οΈ Crop faces, inside of your image, with iOS 11 Vision api.
Stars: ✭ 479 (+522.08%)
Mutual labels:  vision, ios11
Facevision
iOS11 Vision framework example. Detection of face landmarks
Stars: ✭ 47 (-38.96%)
Mutual labels:  vision, ios11
Codeslam
Implementation of CodeSLAM β€” Learning a Compact, Optimisable Representation for Dense Visual SLAM paper (https://arxiv.org/pdf/1804.00874.pdf)
Stars: ✭ 64 (-16.88%)
Mutual labels:  vision
Easy Gpg To Paper
easy-gpg-to-paper aims to make exporting your secret gpg key to paper, and then restoring from paper, an easy and painless process.
Stars: ✭ 68 (-11.69%)
Mutual labels:  qrcode
Eskf
ROS Error-State Kalman Filter based on PX4/ecl. Performs GPS/Magnetometer/Vision Pose/Optical Flow/RangeFinder fusion with IMU
Stars: ✭ 63 (-18.18%)
Mutual labels:  vision
Quasar Qrcode Reader
πŸ“·πŸ”³ A simple QRCode reader and Genarator.
Stars: ✭ 64 (-16.88%)
Mutual labels:  qrcode
Qrcode
A pure JavaScript QRCode encode and decode library.
Stars: ✭ 69 (-10.39%)
Mutual labels:  qrcode
Qr Ascii
A small library to generate QR codes with ascii
Stars: ✭ 63 (-18.18%)
Mutual labels:  qrcode
Chrome Extensions
Google Chrome ζ‰©ε±•εˆι›†
Stars: ✭ 74 (-3.9%)
Mutual labels:  qrcode
Blabel
🏷 Python label/sticker PDF generation. HTML templates, built-in barcodes, qr codes, and other goodies
Stars: ✭ 63 (-18.18%)
Mutual labels:  qrcode
Korea Startups
🌟 κ΅­λ‚΄ μŠ€νƒ€νŠΈμ—… λͺ©λ‘ 및 μ„€λͺ… 🌟
Stars: ✭ 63 (-18.18%)
Mutual labels:  vision
Qrcodereader.swift
Simple QRCode reader in Swift
Stars: ✭ 1,202 (+1461.04%)
Mutual labels:  qrcode
Unjailme
A sandbox escape based on the proof-of-concept (CVE-2018-4087) by Rani Idan (Zimperium)
Stars: ✭ 73 (-5.19%)
Mutual labels:  ios11

πŸ”² iOS11 QR-Code Example

A quick example showing how to use the Vision system-framework in iOS 11 and Swift 4.

Prerequisites

  • Xcode 9 and later

Getting Started

First, import the Vision framework.

import Vision

Next, create a barcode-request that will call the completion-handler asynchronously when it detects a code:

// Create a barcode detection-request
let barcodeRequest = VNDetectBarcodesRequest(completionHandler: { request, error in

    guard let results = request.results else { return }

    // Loopm through the found results
    for result in results {
        
        // Cast the result to a barcode-observation
        if let barcode = result as? VNBarcodeObservation {
            
            // Print barcode-values
            print("Symbology: \(barcode.symbology.rawValue)")
            
            if let desc = barcode.barcodeDescriptor as? CIQRCodeDescriptor {
                let content = String(data: desc.errorCorrectedPayload, encoding: .utf8)
                
                // FIXME: This currently returns nil. I did not find any docs on how to encode the data properly so far.
                print("Payload: \(String(describing: content))")
                print("Error-Correction-Level: \(desc.errorCorrectionLevel)")
                print("Symbol-Version: \(desc.symbolVersion)")
            }
        }
    }
})

Finally, call the image-request-handler with the previously create barcode-request:

// Create an image handler and use the CGImage your UIImage instance.
guard let image = myImage.cgImage else { return }
let handler = VNImageRequestHandler(cgImage: image, options: [:])

// Perform the barcode-request. This will call the completion-handler of the barcode-request.
guard let _ = try? handler.perform([barcodeRequest]) else {
    return print("Could not perform barcode-request!")
}

That's it! Run the app on the simulator / device and detect QR-codes.

Author

Hans KnΓΆchel (@hansemannnn)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].