title: How can I find quantized coefficients from MATLAB using Sallee's code?
body: <p>First, I admit that this is a homework question. However, I seem to be stuck. I need to get all quantized coefficients from a jpeg image using <a href="http://dde.binghamton.edu/download/feature_extractors/" rel="nofollow">Phil Sallee's JPEG Toolbox</a> (link listed at the bottom of the table under an "update" heading)(I'll be building a histogram, but that part I can handle once I can get to the data I need). I have a JPEG image that is about 5 MB in size and get back this data when I run it through Sallee's code:</p>
  
  <pre><code>  image_width: 3000
    image_height: 4000
    image_components: 3
    image_color_space: 2
    jpeg_components: 3
    jpeg_color_space: 3
    comments: {}
    coef_arrays: {[4000x3000 double]  [2000x3000 double]  [2000x3000 double]}
    quant_tables: {[8x8 double]  [8x8 double]}
    ac_huff_tables: [1x2 struct]
    dc_huff_tables: [1x2 struct]
    optimize_coding: 0
    comp_info: [1x3 struct]
    progressive_mode: 0
  </code></pre>
  
  <p>How do I get the quantized coefficients from this image? At first I tried something like this to just spit out the coefficients so I could see what I was dealing with:</p>
  
  <pre><code>pic = jpeg_read(image)
  img_coef = pic.quant_tables{pic.comp_info(1).quant_tbl_no}
  img_coef = pic.quant_tables{pic.comp_info(2).quant_tbl_no}
  </code></pre>
  
  <p><code>img_coef</code> is run twice because there are two elements to the <code>quant_tables</code> data point above. However, this seems like a very low amount of coefficients for such a large image. Can someone more knowledgeable than me in this regard point me in the right direction? Where/how do I pull the quantized coefficients from a jpeg image?</p>