2
$\begingroup$

What happens when an image is compressed by thresholding (choosing a suitable threshold and setting the values below the threshold to zero)? Setting the values to zero doesn't mean removing them. They still need to be coded to to be stored or transmitted over a channel, and thus no reduction in the size of image occurs. Is my understanding correct? Are there any steps following the setting to zero step (example Huffman Coding) is performed in order to reduce the number of bits required to encode the image?

$\endgroup$

1 Answer 1

3
$\begingroup$

Thresholding alone cannot perform data compression. You need to employ some encoding strategy to discard those ignored coefficients, to achive actual bit reduction.

For example, in lossy JPEG image compression, quantization of DCT coefficients helps you reduce the number of states the variables can take; hence reduce the number of bits necessary to encode the codebook.

Thresholding is applied after quantization, and sets a number of coefficients to zero. Typically, consecutive groups of coefficients tend to go to zero together, especially after zigzag scanning pattern. In effect, for a typical nonzero DCT coefficient, there will be a tail of zero coefficients following. Then instead of individually storing each coefficient alone, you define some special symbols for every 1-nonzero-K-zero combination, and store the codeword instead. This is a variant of run length coding (RLC), and is the very step where the actual bit-reduction happens.

$\endgroup$
5
  • $\begingroup$ The idea is applicable, as you said, with DCT coefficients, and can also be applied with wavelet coefficients, since both transforms have high energy compaction property, right? $\endgroup$
    – Noha
    Dec 28, 2019 at 7:38
  • $\begingroup$ I think also that Huffman coding, which is an entropy based coding technique, can be applied after setting the coefficients to zero. Its main idea is to assign shorter code words with most probable values and longer code words with values with less probability of occurrence, thus ensuring minimum average length for code words. With DCT and wavelet coefficients, I think the number of zero coefficients after the thresholding stage will be large, and thus can be encoded with small number of bits using Huffman coding. Do you agree? $\endgroup$
    – Noha
    Dec 28, 2019 at 7:45
  • 1
    $\begingroup$ to first comment yes. To the second comment yes but no :Huffman is not applied to DCT coefficients directly but to the special symbol/category run length coded elements. To get a clear view; I recommend you read Standard Codecs from Ghanbari... $\endgroup$
    – Fat32
    Dec 28, 2019 at 15:54
  • $\begingroup$ Ok, I will read them. What about Huffman coding? when can it be applied? I know that when it is applied alone, it performs lossless data compression. When can it be applied after a lossy compression step to encode the data in less number of bits? $\endgroup$
    – Noha
    Dec 28, 2019 at 17:26
  • 1
    $\begingroup$ Yes Huffman entropy coding is also performed on the final stage of JPEG (dct) and JPEG2000 (wavelet) based image codecs. $\endgroup$
    – Fat32
    Dec 28, 2019 at 18:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.