imtranslate
Peter Cloetens
cloetens at esrf.fr
Sun Dec 30 04:28:52 CST 2007
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
> Help-octave at octave.org
> 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
More information about the Help-octave
mailing list