can any one fixed this code.

I = imread("barcode1D.jpg");
[msg, format, locs] = readBarcode(I);
disp("Detected format and message: " + format + ", " + msg)
% The line above shows "Detected format and message: EAN-13, 1234567890128"
xyBegin = locs(1,:); imSize = size(I);
I = insertShape(I,"Line",[1 xyBegin(2) imSize(2) xyBegin(2)], ...
"LineWidth", 7);
I = insertShape(I, "FilledCircle", [locs, ...
repmat(10, length(locs), 1)], "Color", "red", "Opacity", 1);
% Display image.
imshow(I)

2 件のコメント

Jan
Jan 2022 年 6 月 19 日
What do you want to be fixed? It would be useful if you mention, what is broken.
Jeffrey Clark
Jeffrey Clark 2022 年 6 月 19 日
@Faizan, are you trying to duplicate the code given on the readBarcode documentation page example Search Image for 1D Barcode. Seems you just want to use that code and modify the insertShape and insertText parameters?

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeConvert Image Type についてさらに検索

質問済み:

2022 年 6 月 19 日

コメント済み:

2022 年 6 月 19 日

Community Treasure Hunt

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

Start Hunting!

Translated by