octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #60226] [octave forge] (image) psf2otf does no


From: Hartmut
Subject: [Octave-bug-tracker] [bug #60226] [octave forge] (image) psf2otf does not allow complex numbers for psf
Date: Sat, 27 Mar 2021 15:45:03 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:87.0) Gecko/20100101 Firefox/87.0

Follow-up Comment #2, bug #60226 (project octave):

(Sorry my last post got corrupted, here is the full text again:)
-----
Thanks for letting us know this compatibility issue in our psf2otf.

I can confirm this behavior:
* A complex input value PSF into our psf2otf currently throws a (useful) error
message: PSF  must be numeric and real.
* The Matlab docs claim that they accept a complex PSF input. A quick test in
their online Matlab confirmed this.
* I have not found any hint in the Matlab release notes (R2016a up to today)
that they changed this, so this is incompatibilit is probably there already
for some time.

Question to the original reporter: Do you have a usecase where a complex input
value of PSF makes sense? (I know that in the formal definition the PSF can
have a phase and thus be complex, but have you met such complex PSFs in "real
life"?)

Question to everyone, especially to Avinoam and Carne: When I simply remove
the input test for realness of PSFs in our psf2otf (line 35 in psf2otf.m) and
then run the following code using our modifued psf2otf, I then get a fully
Matlab compatible result. Should we simply remove the check for realness (and
the corresponding error message), or was there a good reason to have this?
(The file is copywrited by Carne in 2015.)


PSF  = fspecial('gaussian',5,1) + 1i;

OTF  = psf2otf(PSF,[6 6]);
R_OTF = real(OTF);
I_OTF = imag(OTF);

Matlab_R = [ ...
1 .5923 .1039 .0232 .1039 .5923; ...
.5923 .3509 .0616 .0137 .0616 .3509; ...
.1039 .0616 .0108 .0024 .0108 .0616; ...
.0232 .0137 .0024 .0005 .0024 .0137; ...
.1039 .0616 .0108 .0024 .0108 .0616; ...
.5923 .3509 .0616 .0137 .0616 .3509] ;

Matlab_I = [ ...
25 5 -5 5 -5 5; ...
5 1 -1 1 -1 1; ...
-5 -1 1 -1 1 -1; ...
5 1 -1 1 -1 1; ...
-5 -1 1 -1 1 -1; ...
5 1 -1 1 -1 1];

maxDeltaReal = max(Matlab_R(:) - R_OTF(:))
maxDeltaImag = max(Matlab_I(:) - I_OTF(:))


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?60226>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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