When imread() of matlab reads a jpeg
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.
Answers (1)
Guillaume
on 20 Nov 2014
1 vote
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
Dmn
on 21 Nov 2014
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.
Categories
Find more on Morphological Operations 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!