how to change these parts to 0??

1 visualización (últimos 30 días)
DOHYUN JANG
DOHYUN JANG el 30 de Nov. de 2019
Respondida: Sourav Bairagya el 9 de Dic. de 2019
This is the picture of a gray image after DCT porcess. I want make other 4 images which are : 1. make part 1 in picture to 0 and then idct 2. make part 2 in picture to 0 and then idct 3. make part 3 in picture to 0 and then idct 4. make part 4 in picture to 0 and then idct
please help me ....
  1 comentario
Walter Roberson
Walter Roberson el 30 de Nov. de 2019
dctstuff = dct(...);
dct1 = dctstuff;
dct1(1:20, 1:20) = 0;
idct1 = idct(dct1);

Iniciar sesión para comentar.

Respuestas (1)

Sourav Bairagya
Sourav Bairagya el 9 de Dic. de 2019
dct.png
Assuming the dct image is ‘dct_img’ and the indexes of the sections are as shown here in this figure, you can create four inverse DCTs in the following way:
%For section 1
dct1 = dct_img;
dct1(1:25, 1:25) = 0;
img1 = idct(dct1);
%For section 2
dct2 = dct_img;
dct2(1:25, 25:256) = 0;
img2 = idct(dct2);
%For section 3
dct3 = dct_img;
dct3(25:256, 1:25) = 0;
img3 = idct(dct3);
%For section 4
dct4 = dct_img;
for i=1:256
for j=256:-1:(256-i+1)
dct4(i, j)=0;
end
end
img4 = idct(dct4);

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by