Sir,how can i read the QR barcode in Matlab software
조회 수: 10 (최근 30일)
이전 댓글 표시
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1232262/image.png)
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!