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

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

[Octave-bug-tracker] [bug #61754] Bicubic interpolation in interp2() inc


From: Christof Kaufmann
Subject: [Octave-bug-tracker] [bug #61754] Bicubic interpolation in interp2() incompatible with Matlab
Date: Wed, 19 Jan 2022 11:43:51 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:96.0) Gecko/20100101 Firefox/96.0

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

I implemented bicubic interpolation in interp2.m, see attached file. To make
the implementation easier to understand, I also attached a PDF (LaTeX source
<https://gist.github.com/ChristofKaufmann/71a2e41461136f49f3b9e702aca815d7>)
to explain the approach. I also added tests, not only for the bicubic
interpolation, but for the sake of consistency also for the existing methods.
I found a few bugs:
* Interpolating complex matrixes gave an NA + 0i instead of NA + NAi. I could
fix this.
* Spline interpolation does only support meshgrid format, but not index pairs.
Matlab supports that. There is already a note in __splinen__.m. I added a
failing test using xtest.
* Spline interpolation returns a row, when interpolating a single column,
though with the correct values. I added a failing test using xtest.
I have not opened new bug reports nor checked for existing ones regarding the
two spline interpolation issues.

Where to go from here?
* I have not checked interp1.m, interp3.m, interpn.m. The cubic interpolation
might also be Matlab incompatible.
* Bilinear interpolation could also be implemented by convolution easily. This
might be faster, maybe only for specific situations. When switching from
interp2 to the convolutional approach in imresize.m to support anti-aliasing
(submitted in bug #61760, not yet pushed), the speed-up was quite big for some
tests.

Please let me know if the implementation needs improvements.

(file #52682, file #52683)
    _______________________________________________________

Additional Item Attachment:

File name: interp2.m                      Size:26 KB
    <https://file.savannah.gnu.org/file/interp2.m?file_id=52682>

File name: bicubic.pdf                    Size:103 KB
    <https://file.savannah.gnu.org/file/bicubic.pdf?file_id=52683>



    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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