Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

QRCode from a file using IOS 7 API

I know there is third parties alternatives, but I would like to know if it's possible using the iOS 7 API.

Since iOS 7 AVFoundation can parse QRCode in real time. Example

Is it possible to use this API but for a image in a file? Using for exemple a image as input device(?) or other solution?

Thanks for your help.

like image 550
teixeiras Avatar asked Nov 11 '22 09:11

teixeiras


1 Answers

Yes, it's possible, though you will have to use a slightly different API.

The example you linked to uses AVCaptureMetadataOutput, which makes integration easy in the AVFoundation framework, especially for real-time video.

In the case of a single still image, it's easier to use a CIDetector with the appropriate type (CIDetectorTypeQRCode).

A full example of the use of CIDetector can be found in Detecting Faces in an Image in the Core Image Programming Guide. You'll just have to switch the type you want.

like image 173
jcaron Avatar answered Nov 15 '22 04:11

jcaron