0

ZXing から Objective-C へのポートであり、複数のバーコード スキャンをサポートするこのライブラリhttps://github.com/TheLevelUp/ZXingObjCを見つけました。アプリに必要なので、機能させようとしましたが、複数のバーコードを含む画像を渡すと何も検出されません使用しているコードは次のとおりです

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 配列を返し、エラーには「バーコードが見つかりません」というエラーが含まれます。1 つのバーコードだけで MultiFormatReader を使用する場合は問題ありませんが、MultiFormatReader でよく認識される同じバーコードを複数含む画像を追加すると、何も検出されません。

4

1 に答える 1

1

レビューを受けるのに 4 か月かかりましたが、これに対する修正は既にマスター上にあります。

+情報: https://github.com/TheLevelUp/ZXingObjC/pull/235

于 2015-10-09T08:20:23.843 に答える