how to change these parts to 0??
1 次查看(过去 30 天)
显示 更早的评论
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/251554/image.png)
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 个评论
Walter Roberson
2019-11-30
dctstuff = dct(...);
dct1 = dctstuff;
dct1(1:20, 1:20) = 0;
idct1 = idct(dct1);
回答(1 个)
Sourav Bairagya
2019-12-9
![dct.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/253568/image.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);
0 个评论
另请参阅
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!