【发布时间】:2012-11-15 11:51:53
【问题描述】:
我找到了这个库https://github.com/TheLevelUp/ZXingObjC,它是ZXing 到Objective-C 的一个端口,支持多个条码扫描。我需要一个应用程序,所以我试图让它工作,但是当我传递带有多个条形码的图像时它没有检测到任何东西 这是我正在使用的代码
CGImageRef imageToDecode = self.imgn.image.CGImage; // Given a CGImage in which we are looking for barcodes
ZXLuminanceSource* source = [[[ZXCGImageLuminanceSource alloc] initWithCGImage:imageToDecode] autorelease];
ZXBinaryBitmap* bitmap = [ZXBinaryBitmap binaryBitmapWithBinarizer:[ZXHybridBinarizer binarizerWithSource:source]];
NSError* error = nil;
ZXDecodeHints* hints = [ZXDecodeHints hints];
ZXMultiFormatReader* reader = [ZXMultiFormatReader reader];
ZXGenericMultipleBarcodeReader* multi = [[ZXGenericMultipleBarcodeReader alloc] initWithDelegate:reader];
NSArray * result = [multi decodeMultiple:bitmap hints:hints error:&error];
这将返回一个 nil 数组,并且错误包含“未找到条形码”错误。当我只使用带有一个条形码的 MultiFormatReader 时,它没问题,但是当我添加一张带有多个相同条形码的图片时,MultiFormatReader 可以很好地识别它没有检测到任何东西 谁能给我一个线索?
【问题讨论】:
-
其实如果有任何其他免费的 iOS 条形码库可以从图像中读取多个条形码,那也很棒
-
你找到任何库了吗?那可以读取多个二维码..一个接一个?
标签: ios zxing barcode-scanner