ios - Scanning barcode from UIImage natively (i.e., not using ZBar) -
i've been using native barcode scanner functionality provided apple since ios7 , great, needed scan static images had automatically catalogue barcodes.
i couldn't find way natively, used open source package called zbar, , part, works fine.
however, returns false values , flat out fails find barcode. built c++ library scratch got same results in os x build. seems abandoned project.
apple's native solution finds barcode on static image if scan image computer monitor! same thing goes images return false/incorrect values.
so there anyway use apple's libraries scan uiimage?
try this
cidetector* detector = [cidetector detectoroftype:cidetectortypeqrcode context:nil options:@{cidetectoraccuracy:cidetectoraccuracyhigh}]; if (detector) { nsarray* featuresr = [detector featuresinimage:scannedimg.ciimage]; nsstring* decoder; (ciqrcodefeature* featurer in featuresr) { nslog(@"decode %@ ",featurer.messagestring); decoder = featurer.messagestring; } }
Comments
Post a Comment