Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Embedded Image Resizing using FFT
Date: Thu, 20 Nov 2008 21:04:02 +0000 (UTC)
Organization: Xoran Technologies
Lines: 34
Message-ID: <gg4jc2$bck$1@fred.mathworks.com>
References: <gg4co5$2cu$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 1227215042 11668 172.30.248.37 (20 Nov 2008 21:04:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 20 Nov 2008 21:04:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1440443
Xref: news.mathworks.com comp.soft-sys.matlab:502144


"Kevin Voet" <kevin.voet@gmail.com> wrote in message <gg4co5$2cu$1@fred.mathworks.com>...
> I'm currently looking for a way to rescale/resize images using Embedded Matlab. 
> I've read it should be possible using the Frequency domain. And since the fft2 and ifft2 functions are supported by the Embedded Matlab subset I thought I'd go this way. If you have any other suggestions they are also welcome
> 
> However I haven't found any actual information on the subject or how to proceed. Can you offer any help or examples? 
> 
> I'd like to achieve something like:
> 
> factor = 0.5;
> image = imread('test.bmp');
> %Each of the RGB planes is 0 to 255
> imageR(:,:,1) = fftResize(image(:,:,1), factor);
> imageR(:,:,2) = fftResize(image(:,:,2), factor);
> imageR(:,:,3) = fftResize(image(:,:,3), factor);
> imwrite(imageR, 'test_resized.bmp', 'bmp');
> 
> function img_re = fftResize(img, factor)
> img = im2double(img);
> fft = fft2(img);
> 
> %Part where I need help%
> 
> img_re = ifft2(img_resized);
> img_re = uint8(floor(img_re));
> end



Presumably the method exploits the property that  f(a*t) Fourier transforms into
F(w/a)/|a|.

However, I can't see why this would be better than resizing in the non-Fourier domain. You end up doing this same operation, pretty much, in either domain.