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

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

[Octave-bug-tracker] [bug #57504] [octave forge] (image) Scaling error f


From: anonymous
Subject: [Octave-bug-tracker] [bug #57504] [octave forge] (image) Scaling error for imresize in Image 2.0.0
Date: Tue, 31 Dec 2019 09:46:16 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:71.0) Gecko/20100101 Firefox/71.0

Follow-up Comment #3, bug #57504 (project octave):

[comment #2 comment #2:]
> To OP:
> Thanks for reporting.
> Image package last version is 2.10.0.
> Could you please add an example that shows that imresize has a problem in
this version? 
> 

Of course. In version 2.10 of Image in the lines 134-135 there is:

> [XI, YI] = meshgrid (linspace (1, inCols, outCols), linspace (1, inRows,
outRows));
> im = imremap (im, XI, YI, method);

which is exactly what I mentioned (the indexes of pixels are computed using
linspace from 1 to the final index.

I have not made checks in regards to clever indexing implemented for the case
of the nearest neighbour. for for each other method the lines I provided above
are used. The simplest explanation why this approach is wrong can be seen in
two things. First the pixels are supposed to be points of reference in their
centres. Second, the pixels represent an area; in a system that starts
indexing from 0, an image that's N-pixels wide would have coordinate 0
represented as the left border of the first pixel and the coordinate N as the
right border of the last pixel (in case of systems indexing from 1 like
Octave, the right edge represents N+1).

OP

    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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