When imread() of matlab reads a jpeg
5 views (last 30 days)
Show older comments
I want to know when the imread() of MATLAB reads a .jpeg file, What values are actually displayed. Are the pixel values are the decompressed values after inverse DCT.
0 Comments
Answers (1)
Guillaume
on 20 Nov 2014
Of course, imread decodes the image whatever the format. With jpg you're getting the decoded RGB triplet for each pixel (as a m*n*3 matrix integer matrix).
3 Comments
David Young
on 21 Nov 2014
I don't think the blocks represent DCT coefficients. Just converting to YCbCr and splitting into blocks does not do any compression. You need at least to call fft() to get coefficients. It will get complicated - but why reimplement JPEG compression?
If you want the DCT coefficients stored in the JPEG file, read it using fread(). That way you get the values from the file without doing any decoding. You'll need to look up the JPEG format so you can work out where the headers are and how the coefficients are arranged. It's still quite a big task.
See Also
Categories
Find more on Import, Export, and Conversion in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!