help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: imtranslate


From: Peter Cloetens
Subject: Re: imtranslate
Date: Sun, 30 Dec 2007 11:28:52 +0100
User-agent: Thunderbird 1.5.0.7 (X11/20060909)



Søren Hauberg wrote:
lør, 29 12 2007 kl. 14:06 -0600, skrev Daniel Elliott:
Hello,

I tried contacting the author, but the email address is no longer
functional.  I have not done my homework before asking the question...

The imtranslate function takes the absolute value of the image as it
is brought out of FFT-space.  Is this because of some property of FFT
where it can potentially flip the sign of a pixel?

I am using this method to permute images that may have negative
values.  Does anyone know why the absolute value is used here?
I haven't written (or even used) imtranslate so I don't know the
details. I assume that FFT sometimes returns complex values, so an abs()
is needed. Depending on your problem, I suggest you either
  1) Separate the signs from the data and transform each separately.
Something like:
    S = sign(im);
    im = abs(im);
    St = imtranslate(S, ...)
    imt = imtranslate(im, ...)
    T = St.*imt;
  2) Use the more general 'imperspectivewarp'. You can just apply an
affine transformation matrix like
    T = [eye(2), [Tx; Ty]];
where Tx and Ty are your translations.

Hope that helps,
Søren

_______________________________________________
Help-octave mailing list
address@hidden
https://www.cae.wisc.edu/mailman/listinfo/help-octave

Hello,
The succession of fft2/ifft2 may indeed introduce a spurious imaginary part one must get rid off. But I think it is much better to use real() instead of abs(). In that case it will work for any real image also if it contains negative values.
Peter


reply via email to

[Prev in Thread] Current Thread [Next in Thread]