Sir,how can i read the QR barcode in Matlab software
11 次查看(过去 30 天)
显示 更早的评论
how can i read this type of QR code please anyone help me.
0 个评论
回答(1 个)
Cris LaPierre
2022-12-15
编辑:Cris LaPierre
2022-12-15
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")
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 个评论
Walter Roberson
2022-12-16
编辑:Walter Roberson
2022-12-16
You need the Computer Vision Toolbox R2020a or later
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Computer Vision with Simulink 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!