OpenCV: Decoding QR Codes using libdecoderqr

"libdecodeqr" is a C/C++ library for decoding QR code based on JIS X 0510 and ISO/IEC18004.
This library is able to decode various image formats whether it's taken from a file, webcam, scanner, or any other image formats available.


Download the stable release. Extract the file. Open the libdecoderqr project file present in

Convert to latest version and Build the project. Add a sample project to it and build it.

Copy the sample images to the debug folder of the sample program. Open the command prompt and navigate to the debug folder of the sample program.
cd \libdecodeqr-0.9.3\src\sample\simple\Debug

Enter the name of the program followed by the name of the image.
C:\libdecodeqr-0.9.3\src\sample\simple\Debug\simple 1.jpg

You might want to add the following commands to the sample program to save the decoded information.

        char *buf=new char[header.byte_size+1];
        qr_decoder_get_body(decoder,(unsigned char *)buf,header.byte_size+1);
        //To save the decoded information as a comment in an XML file:
        //Add the following lines to the sampple program
        CvFileStorage* fs = cvOpenFileStorage("QR.xml",0,CV_STORAGE_WRITE);
        cvReleaseFileStorage( &fs );
        //Till Here.

Download Test Images:


  1. Hi, link is dead, could you reup it, please :-)

  2. Here is the unmodified libdecodeqr pack.

    Note: (License)The code is under LGPL.
    Non-commercial use only.

  3. re-upload the library please...

    the link is dead...

  4. Is it working for all the images?

  5. No..
    It does not detect some other type of Encoding... I'm not sure why this is happening..

  6. hi i got memory leak in galios .cpp in the following line

    new Nomial(gf,x);

    please help me to find out thanx

  7. Maybe someone can upload working project somewhere? I get the lib from the rapidshare link, I have OpenCV installed and when I try to run webcam sample or simple sample I get cannot find openCV.

    So I set up paths correctly to point to OpenCV include and lib, then I get 133 errors saying pretty much everything is a redefinition in ws2def.h and winsock2.h and also some syntax errors in ecidecoder.h

  8. doesn't work anyore

  9. i got an error when compiling,
    1>c:\josephholsten\libdecodeqr\imagereader.cpp(1097): error C2094: 'exit' is not defined

    =S i dont know how to fic it, any suggestion pleasE?