How to generate QR code of image in MATLAB R2019b.

85 views (last 30 days)
I want to generate QR code of document image in MATLAB.
Please help
Thanks in advance
  4 Comments

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 17 Mar 2021
filename = 'Tu_logo.png';
[fid, msg] = fopen(filename, 'r');
if fid < 0
error('could not open file "%s" because "%s"', msg)
end
bytes = fread(fid, 'uint8=>char', [1 inf]);
fclose(fid);
qr_array = encode_qr(bytes, [160 160]);
  4 Comments
Walter Roberson
Walter Roberson on 31 May 2022
Note that the code above replies on the File Exchange contribution that I linked to. If you are using the newer https://www.mathworks.com/matlabcentral/fileexchange/41437-qr-code-encoder then instead of passing [160 160] you would pass 'Size', [160 160]

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!