File Exchange

image thumbnail

QR Code reader example

version 1.0.0 (692 KB) by Kei Otsuka
Read characters embedded as QR Code using MATLAB functions


Updated 01 Apr 2019

View License

This example shows how to decode QR Code to read characters embedded in QR Code using MATLAB functions. QR Code used in this example is encoded in version2 format that has 25x25 modules, and error correction level is "L". Since this is just example focusing on how MATLAB functions can be used rather than algorithms, have fun in exploring algorithms to make it more robust.
*QR Code is a registered trademark of DENSO WAVE INCORPORATED

[Japanese] 本例題ではQRコードに埋め込まれた(符号化された)文字列をMATLAB関数群を利用して復号する流れをご紹介しています。使用したQRコードのバージョンは2、誤り訂正レベルはLになります。本例題は復号のアルゴリズムよりも関数の使い方に焦点をあてています。MATLAB上では様々なアルゴリズムを試すことができますので、より堅牢なアルゴリズムの作成にトライしてみてください。

[Keyward] 画像処理・誤り訂正・コンピュータービジョン・デモ・IPCVデモ・QRコード・QR Code

Cite As

Kei Otsuka (2021). QR Code reader example (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (9)

Ji-Ru Lee

I fugured out!! The simplest way is that calculate the cross product!!

Ji-Ru Lee

How to deal with a QR-code which rotation angle > 45 deg.??
Because finder (idxY) may be calculated as another (idxX)

Kei Otsuka

Sorry for delayed response. 0x5412(101010000010010) is fixed mask pattern for the 15 bit format information. This is to make sure that combination of the error correction level and the mask pattern reference is not all zero.



Tatyana Serditova

Kei Otsuka, thank you very much! Your example is realy helpful!
Will you be so kind to explain why the format this 101010000010010 mask pattern is selected?
Isn't it match M error correction level?

Tatyana Serditova

emrah dönmez

I am getting below error.

Error using strjoin (line 53)
First input must be a string array or cell array of character vectors.

Takuji Fukumoto

Tohru Kikawada

MATLAB Release Compatibility
Created with R2019a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!