Applying Quantization Matrix in which specific coefficients are zero'd out

조회 수: 6 (최근 30일)
Hello,
I'm trying to quantize 8x8 blocks using an 8x8 sample quantization matrix that I found online for image processing.
The only issue is that I want to be able to pick and choose which coefficients that I keep during quantization.
For instance if i want to zero out the circle'd portion of the matrix, how would I go about modifying my Quantization Matrix?
Sample Quantization Matrix and implementation:
Q_Matrix= [16 11 10 16 26 40 51 61
12 12 14 19 26 58 60 55
14 13 16 24 40 57 69 56
14 17 22 29 51 87 80 62
18 22 37 56 68 109 103 77
24 35 55 64 81 104 113 92
49 64 78 87 103 121 120 101
72 97 95 98 112 100 103 99];
Quantized_Matrix = floor(blocks_dct ./ Q_Matrix);
DeQuantized_Matrix = Quantized_Matrix .* Q_Matrix;
  댓글 수: 2
Image Analyst
Image Analyst 2023년 4월 28일
You can't have matrices with "ragged" rows or columns, so what does "get rid of" mean to you? Do you mean to set their values to zero?
KG573
KG573 2023년 4월 28일
Yes, to set their values to zero.

댓글을 달려면 로그인하십시오.

채택된 답변

Matt J
Matt J 2023년 4월 28일
편집: Matt J 2023년 4월 28일
One way would be to set Q_matrix to twice the maximum of blocks_dct. That will ensure that the floor() operation zeros them.
Another way would be to apply a binary mask to zero_out the blocks_dct ellements appropriately,
Quantized_Matrix = floor( (blocks_dct.*Mask) ./ Q_Matrix);

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Filtering and Enhancement에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by