decodeJpeg

Version 1.0.0.0 (1,08 KB) von Evgeny
decodes encoded JPEG array into a Matlab array (image)
496 Downloads
Aktualisiert 29. Okt 2015

Lizenz anzeigen

I was looking for this functionality for some time, but all file exchange submissions seem to be some custom decoders
Then on stackoverflow I found a snippet which uses java for decoding: http://stackoverflow.com/questions/18659586/from-raw-bits-to-jpeg-without-writing-into-a-file
This snippet worked for me and I am submitting it as a function here.

USAGE:
% get a stream of bytes representing an endcoded JPEG image
fid = fopen('football.jpg', 'rb');
data = fread(fid, Inf, '*uint8');
fclose(fid);

% decode jpeg
img = decodeJpeg(data);

% check results against directly reading the image using IMREAD
img2 = imread('football.jpg');
assert(isequal(img, img2))

Zitieren als

Evgeny (2026). decodeJpeg (https://de.mathworks.com/matlabcentral/fileexchange/53716-decodejpeg), MATLAB Central File Exchange. Abgerufen.

Kompatibilität der MATLAB-Version
Erstellt mit R2015a
Kompatibel mit allen Versionen
Plattform-Kompatibilität
Windows macOS Linux
Kategorien
Mehr zu Resizing and Reshaping Matrices finden Sie in Help Center und MATLAB Answers
Version Veröffentlicht Versionshinweise
1.0.0.0