Sir,how can i read the QR barcode in Matlab software

Answers (1)

In testing this, it appears the function only works with truecolor or grayscale images, not binary, so that is why I multiplied by 255. Otherwise, the code comes straight from the example I linked to. Since your image is the QR Code, it was not necessary to specify an roi.
Note: this solution requires the Computer Vision toolbox.
I = imread("https://www.mathworks.com/matlabcentral/answers/uploaded_files/1232262/image.png");
I = I*255;
imshow(I)
[msg,~,loc] = readBarcode(I,"QR-CODE")
msg = "QR Code Generator by TEC-IT"
loc = 4×2
77.5000 471.5000 77.5000 77.5000 471.5000 77.5000 406.0000 406.0000
xyText = loc(2,:);
Imsg = insertText(I,xyText,msg,"BoxOpacity",1,"FontSize",25);
Imsg = insertShape(Imsg, "FilledCircle", [loc, ...
repmat(10, length(loc), 1)],"Color","red","Opacity",1);
figure
imshow(Imsg)

4 Comments

sir,after i try this solution it says Undefined function or variable 'readBarcode'.so now what can i do...
please help me
thanku....
Sir,Is this solution applicable for all type QR code....
but after try this solution it will say undefined function of readBarcode....
You need the Computer Vision Toolbox R2020a or later

Sign in to comment.

Categories

Tags

Asked:

on 15 Dec 2022

Commented:

on 16 Dec 2022

Community Treasure Hunt

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

Start Hunting!