image compression using FFT

16 ビュー (過去 30 日間)
Jitesh Bhanushali
Jitesh Bhanushali 2014 年 4 月 3 日
コメント済み: Sulaymon Eshkabilov 2023 年 11 月 15 日
Sir how can we compress image using FFT transform..RLE coding is not suitable with the FFT..what coding technique is suitable for FFT to compress the image..

回答 (2 件)

Walter Roberson
Walter Roberson 2014 年 4 月 3 日
RLE is a lossless compression technique. Compression with FFT is a lossy compression technique. You do the FFT, and you throw away some of the coefficients and output the rest; then for reconstruction you let the missing coefficients be 0 and do the inverse FFT.
Which coefficients you should throw away is something for you to explore.

sam k
sam k 2020 年 6 月 6 日
a=imread('link.jpeg');
grayIm =rgb2gray(a);
[row col] = size(grayIm);
subplot(2, 2, 1);
imshow(grayIm);
title('original image')
A=fft2(grayIm); %2D fft
count_pic=2;
for thresh=0.1*[0.001 0.005 0.006]*max(max(abs(A)))
ind=abs(A)>thresh;
count=row*col-sum(sum(ind));
Alow=A.*ind;
per=100-count/(row*col)*100;
Blow=uint8(ifft2(Alow));
subplot(2,2,count_pic);
imshow(Blow);
count_pic=count_pic+1;
title([num2str(per) '% of fft basis'])
end
  2 件のコメント
Thinh
Thinh 2022 年 10 月 26 日
can you explain this, please
Sulaymon Eshkabilov
Sulaymon Eshkabilov 2023 年 11 月 15 日
This means what % of the highest FFT coeffcients to keep.
It can be also applied for color (RGB) images as well:
A = imread('A1.jpeg');
Afft=fft2(A);
Asort = sort(abs(Afft(:)));
counter=0;
for Keep = [.95 .1 .05 .001]
threshold = Asort(floor((1-Keep)*length(Asort)));
Ind = abs(Afft)>threshold;
Atlow = Afft.*Ind;
Alow = uint8(ifft2(Atlow));
s = whos('Alow');
totSize = s.bytes;
counter=counter+1;
figure(counter)
imshow(Alow)
saveas(gcf, strcat(['FFT_IMG', num2str(counter) '.jpeg']))
s = dir(strcat(['FFT_IMG', num2str(counter) '.jpeg']));
filesize(counter)=s.bytes
title([num2str(Keep) '% of fft basis is kept and updated image file size is: ' num2str(s.bytes)])
end

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeDenoising and Compression についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by