问题
I am looking at CIDetectorTypeQRCode. How can I detect other types of barcodes? I can read other barcode types via AVMetadataObjectType, however I want to do the same with CIDetector. I am trying to achieve real time highlighting of the barcode.
Trying for a sort of zoom in effect before my AVCaptureMetadataOutputObjectsDelegate achieves a full lock and read of the code.
回答1:
CIDetector has only following types to detect, So we can't use it to detect another type of barcodes.
CIDetectorTypeFace
CIDetectorTypeRectange
CIDetectorTypeQRCode
CIDetectorTypeText
But since iOS 11 has introduced a new set of Vision API's. Now it is possible to read barcodes from an image.
if you are targeting >iOS 11, you can use VNDetectBarcodesRequest
to read barcode results.
来源:https://stackoverflow.com/questions/36365710/does-cidetector-for-other-barcode-types