zxing returns wrong position of CODE_39-Barcode

╄→尐↘猪︶ㄣ 提交于 2020-01-04 02:43:14

问题


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

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

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)).

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.


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

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()));
        }
    }

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.


回答1:


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



来源:https://stackoverflow.com/questions/18685142/zxing-returns-wrong-position-of-code-39-barcode

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!