Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Embedded Image Resizing using FFT
Date: Fri, 21 Nov 2008 01:39:01 +0000 (UTC)
Organization: Oxford University
Lines: 12
Message-ID: <gg53fl$f0n$1@fred.mathworks.com>
References: <gg4co5$2cu$1@fred.mathworks.com> <gg4jc2$bck$1@fred.mathworks.com> <gg4kn6$2va$1@fred.mathworks.com> <gg4mdj$sjg$1@fred.mathworks.com> <gg4o3u$qfh$1@fred.mathworks.com> <gg4pkl$h47$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1227231541 15383 172.30.248.37 (21 Nov 2008 01:39:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 21 Nov 2008 01:39:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1073021
Xref: news.mathworks.com comp.soft-sys.matlab:502212


"Matt" wrote:
> Doing geometric transformations this way on an NxN image is an O(N^2)  operation.
> Taking FFTs of an NxN image is an O( N^2*log(N) ) operation and so is more intensive.

Have you tried this? There are scale factors to consider. In practice fft2 isn't too bad:
>> A = rand(1000,1000,3);
>> tic; imresize(A, 1/2); toc
Elapsed time is 0.606730 seconds.
>> tic; fft2(A); toc
Elapsed time is 0.519417 seconds.

Forgetting speed for a minute, I think a benefit of the frequency domain approach---simply cropping the unwanted high frequencies out---is that it gives you the best possible resizing (if someone can work out whether it's possible and how) because it keeps all the frequencies which will be visible in the smaller (assuming this is for downsampling) image. You don't need to work out any optimal smoothing filter for the spatial domain.