When imread() of matlab reads a jpeg

5 views (last 30 days)
Dmn
Dmn on 20 Nov 2014
Edited: Dmn on 25 Nov 2014
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
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
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.
Dmn
Dmn on 25 Nov 2014
Edited: Dmn on 25 Nov 2014
***************************************************
2) Feature Extraction Based on DCT Coefficients: Three features including the intensity, color, and texture are extracted based on the DCT coefficients to build the saliency detection model. DCT coefficients in one block are comprised of the DC coefficient and AC coefficients. In each block, the DC coefficient is a measure of the average energy over all the 8 × 8 pixels, while the remaining 63 AC coefficients represent the detailed frequency properties of this block. The JPEG compression standard takes advantage of the fact that most of the energy is included in the first several low-frequency (LF) coefficients, which are in the left-upper corner of the block. The high-frequency (HF) coefficients from the right-bottom of the block are almost close to zero and thus they are neglected during the quantization of DCT coefficients. The AC coefficients are ordered by zig–zag scanning from LF to HF.
The YCrCb color space is used to encode color images in the JPEG standard. The Y channel represents the Luminance information while the Cr and Cb channels include the Chrominance information for JPEG images.The DC coefficients represent the average energy of each block including 8 × 8 pixels. Here transfer the DC coefficients from YCrCb color space to the RGB color space to extract the intensity and color features for JPEG images.
********************************************************* saliency detection in the compressed domain for adaptive image retargeting ********************************************************
In this the values are extracted as I said above. ie; by converting RGB to YCbCr and then to blocks.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!