Reduce the steps within this code

1 Ansicht (letzte 30 Tage)
Ayesha
Ayesha am 19 Jan. 2014
Bearbeitet: Image Analyst am 19 Jan. 2014
Hi there!
I've been wondering of a way to cut down the steps of sorting the transform and thresholding which constructs an image based on specific # of coefficicents. f is the image and M=4096:
R = fft2(f);
s = sort(abs(R(:)));
s = s(end:-1:1);
T = s(M+1);
R = R.*(abs(R)>T);
f1 = real(ifft2(R));
Just a thought. What do you suggest?

Akzeptierte Antwort

Amit
Amit am 19 Jan. 2014
Bearbeitet: Amit am 19 Jan. 2014
R = fft2(f);
s = sort(abs(R(:)),1,'descend');
%s = s(end:-1:1);
T = s(M+1);
%R = R.*(abs(R)>T);
f1 = real(ifft2(R.*(abs(R)>T)));

Weitere Antworten (0)

Kategorien

Mehr zu Images finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by