Menu ▾ ▴

Reading out Barcodes/Data matrix

2016-04-08
2016-06-12
  • Pavel Efremov

    Pavel Efremov - 2016-04-08

    Hey Guys,
    i hope it isn't too dumb Question. I'm relative new in qt and absolute new in QZXing. I'm trying to read the Info from Barcodes and it isn't working very well. I achieved that i can read the Info from an .png Image but i can't read it from an Picture shot with my Mobile Phone for example.
    I use Qt 5.5 and work with Ubuntu and Windows and try to work with QZXing v 2.4.
    This is my code:

    #include "mainwindow.h"
    #include <QApplication>
    #include <QZXing.h>
    using namespace std;
    #include <iostream>
    int main(int argc, char *argv[])
    {
        QZXing decoder;
        decoder.setDecoder(decoder.DecoderFormat_QR_CODE |
                           decoder.DecoderFormat_DATA_MATRIX |
                           decoder.DecoderFormat_UPC_E |
                           decoder.DecoderFormat_UPC_A |
                           decoder.DecoderFormat_EAN_8 |
                           decoder.DecoderFormat_EAN_13 |
                           decoder.DecoderFormat_CODE_128 |
                           decoder.DecoderFormat_CODE_39 |
                           decoder.DecoderFormat_ITF |
                           decoder.DecoderFormat_Aztec);
        QImage image;
        QString imageFilePath="file://C:/Users/Asus/Documents/build-zxing_test-Desktop_Qt_5_5_1_MinGW_32bit-Debug/qrcode1.png";
        QUrl imageURL(imageFilePath);
        QString bla;
        bla=decoder.decodeImageQML(imageURL);
        cout<<bla.toStdString()<<endl;
    
        //    QApplication a(argc, argv);
        //    MainWindow w;
        //    w.show();
        //    return a.exec();
    }
    

    I also make include(QXZing/QXZing.pri) in my .pro file.
    I can read codes like that: URL
    But not like that: http://bardecode.com/images/barcode_ean13.jpg
    What should i do, or have to.
    Thank you for youre Help and sorry for my bad english.

     

    Last edit: Nikolaos Ftylitakis 2016-06-12
  • Nikolaos Ftylitakis

    Hello Pavel,

    Your code is correct.

    The past few weeks i have made some changes that noticably increased the success rate at the decoding of 1D barcodes. The barcode image that you have posted "barcode_ean13.png" can be decoded correctly.

    I would recommend you to use the latest code (even though beta), and as soon as there is an official release you can switch to the offical.

    Waiting for your feedback.

    Best regards
    Nikos

     

    Last edit: Nikolaos Ftylitakis 2016-06-20

Anonymous
Anonymous

Add attachments
Cancel