zxing 返回错误的 CODE_39-Barcode 位置 [英] zxing returns wrong position of CODE_39-Barcode

查看:38
本文介绍了zxing 返回错误的 CODE_39-Barcode 位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 zxing 在网络摄像头图像中查找条形码:

I'm using zxing to find barcodes in webcam images:

http://s21.postimg.org/vxdrx07av/zxing.png

zxing 找到可靠的条形码并提取信息.它还将条形码的位置返回为两个点 (x1,y) (x2,y) (两个点的值相同,因为它使用扫描线(我认为)).

zxing finds the barcode reliable and extracts the information. It also returns the position of the barcode as two points (x1,y) (x2,y) (same value for both points since it uses scanlines (I think)).

如果我绘制这些点,y 值是可以的,第一个(左)x 值在大多数图像中有点正确,而右端点相距很远.(参见示例图像).

If I plot these points, the y-value is ok, the first (left) x-value is a bit right in most images and the right end point is far off. (See example image).

我打算做一些后期处理,所以我需要条码的位置.有没有人见过这种行为?我不知道渲染过程中的错误如何导致这种情况,并且像在命令行演示应用程序中一样提取点.

I plan some post-processing, so I need the position of the barcode. Has anyone seen this behavior before? I don't see how a mistake during rendering could cause this and the points are extracted like in the command-line demo application.

我只是尝试读取 EAN_13 并获得了完美的条形码位置.图片中的代码是CODE_39,所以这个检测器可能有问题.

I just tried to read an EAN_13 and got perfect barcode location. The code in the image is CODE_39 so there could be a problem with this detector.

原始图片和带标记的在评论中

Edit 2: Original Image and one with marker are in the comment

我使用 Qt 包装器并将端点提取为 (qzxing.cpp l. 140ff)

I use the Qt wrapper and extract the endpoints as (qzxing.cpp l. 140ff)

    res = ((MultiFormatReader*)decoder)->decode(ref, hints);

    if (pts){
        pts->clear();
        for (int j = 0; j < res->getResultPoints()->size(); j++) {
            cout << "  Point[" << j <<  "]: "
                 << res->getResultPoints()[j]->getX() << " "
                 << res->getResultPoints()[j]->getY() << endl;
            pts->push_back(QPointF(res->getResultPoints()[j]->getX(),res->getResultPoints()[j]->getY()));
        }
    }

如果我提取一个 EAN14-Barcode,端点正好在结束标记(两个小条)内,所以我认为我正确读取和可视化这些点.

If I extract an EAN14-Barcode, the endpoints are exactly within the end-markers (the two small bars) so I think that I read and visualize the points correctly.

推荐答案

不错,这是一个错误.现在正在 HEAD 中修复它.答案是这是一个错误:https://code.google.com/p/zxing/issues/detail?id=1776

Nice one, that's a bug. It's being fixed in HEAD now. Answer is that it's a bug: https://code.google.com/p/zxing/issues/detail?id=1776

这篇关于zxing 返回错误的 CODE_39-Barcode 位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆