[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #60322] [octave forge] (image) imresize bicubi
From: |
Christof Kaufmann |
Subject: |
[Octave-bug-tracker] [bug #60322] [octave forge] (image) imresize bicubic interpolation inaccurate |
Date: |
Wed, 7 Apr 2021 12:17:14 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:87.0) Gecko/20100101 Firefox/87.0 |
Follow-up Comment #6, bug #60322 (project octave):
So I finished the implementation in imremap, see attached patch.
Here are some discussion points about the code:
* I left in a commented out test of a local function in the bottom of
imremap.m. Is there some way to add unit tests for local functions? I saw e.
g. the "@strel" directory, but did not want to go the same way on my own. If
you think unit testing the local functions is important, we could go this
way.
* I changed the demos in imremap to RGB images to see how the interpolation
reacts to RGB images. However, there is also a unit test in imresize to check
this.
* There is now a padding option in imremap that can be used instead of
extrapval (which is actually constant padding). The padding argument is only
valid for bicubic interpolation. It is necessary for imresize, when the output
size is rounded up in such a way, that the interpolation point are outside of
the input image. This happens in one of the unit tests in imresize (the one
with scale 1/3).
* Regarding the tolerance of 1 in the comparison with the Matlab results in
the imresize unit tests, I found that Matlab does not seem to do the algorithm
in double and round afterwards, but using another algorithm for integer types.
The floating point results are quite the same, but when using integer the
result in Matlab is sometimes rounded up and sometimes rounded down. So the
bicubic interpolation is not completely compatible, because we are more
accurate.
(file #51207)
_______________________________________________________
Additional Item Attachment:
File name: bicubicpatch1.diff Size:16 KB
<https://file.savannah.gnu.org/file/bicubicpatch1.diff?file_id=51207>
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?60322>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #60322] [octave forge] (image) imresize bicubic interpolation inaccurate, Avinoam Kalma, 2021/04/01
- [Octave-bug-tracker] [bug #60322] [octave forge] (image) imresize bicubic interpolation inaccurate, Christof Kaufmann, 2021/04/02
- [Octave-bug-tracker] [bug #60322] [octave forge] (image) imresize bicubic interpolation inaccurate, Avinoam Kalma, 2021/04/02
- [Octave-bug-tracker] [bug #60322] [octave forge] (image) imresize bicubic interpolation inaccurate, Christof Kaufmann, 2021/04/03
- [Octave-bug-tracker] [bug #60322] [octave forge] (image) imresize bicubic interpolation inaccurate, Hartmut, 2021/04/04
- [Octave-bug-tracker] [bug #60322] [octave forge] (image) imresize bicubic interpolation inaccurate, Christof Kaufmann, 2021/04/04
- [Octave-bug-tracker] [bug #60322] [octave forge] (image) imresize bicubic interpolation inaccurate,
Christof Kaufmann <=
- [Octave-bug-tracker] [bug #60322] [octave forge] (image) imresize bicubic interpolation inaccurate, Hartmut, 2021/04/09
- [Octave-bug-tracker] [bug #60322] [octave forge] (image) imresize bicubic interpolation inaccurate, Hartmut, 2021/04/09
- [Octave-bug-tracker] [bug #60322] [octave forge] (image) imresize bicubic interpolation inaccurate, Christof Kaufmann, 2021/04/10
- [Octave-bug-tracker] [bug #60322] [octave forge] (image) imresize bicubic interpolation inaccurate, Hartmut, 2021/04/13