Filter löschen
Filter löschen

ライブ ビデオ取得を使用した、QRコードの検出について

9 Ansichten (letzte 30 Tage)
輝
am 20 Dez. 2023
Beantwortet: covao am 6 Jan. 2024
こちらのリンクの「ライブ ビデオ取得を使用した、顔の検出と追跡」というドキュメンテーションを参考にライブ ビデオ取得を使用した、QRコードの検出を行いたいのですが、
faceDetector = vision.CascadeObjectDetector();
の部分をQRコード検出用に変更したいのですが、どうすれば良いでしょうか?

Akzeptierte Antwort

covao
covao am 6 Jan. 2024
Computer Vision ToolboxのreadBarcode()を使うと、バーコードやQRコードからテキストに変換できます。
I = imread("barcodeQR.jpg");
imshow(I);
msg = readBarcode(I);
disp("Decoded barcode message: " + msg);
Decoded barcode message: Sample text encoded as a QR code for use with the "readBarcode" function.
以下の例では、Webカメラの画像からQRコードを読み込み、変換したテキストを画像の上に表示します。
% カメラオブジェクトの作成
cam = webcam();
% カメラ画像の表示
figure;
% メインループ
while true
% カメラ画像の取得
img = snapshot(cam);
% 画像からテキストを読み取る
text = readBarcode(img);
% テキストをカメラ画像上に表示
img = insertText(img, [10 10], text, 'FontSize', 20, 'BoxColor', 'white', 'BoxOpacity', 0.8);
% カメラ画像の更新
imshow(img);
% キーボードの入力待ち('q'キーで終了)
if strcmpi(get(gcf, 'CurrentCharacter'), 'q')
break;
end
% フレームレートの調整(適宜調整してください)
pause(0.1);
end
% カメラオブジェクトの解放
clear cam;

Weitere Antworten (0)

Kategorien

Mehr zu 単一カメラとステレオ カメラのキャリブレーション finden Sie in Help Center und File Exchange

Tags

Produkte


Version

R2023b

Community Treasure Hunt

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

Start Hunting!