[Scipy-tickets] [SciPy] #515: ndimage.zoom introduces artefacts at right and bottom edges
SciPy
scipy-tickets@scipy....
Tue Oct 16 22:47:41 CDT 2007
#515: ndimage.zoom introduces artefacts at right and bottom edges
---------------------------+------------------------------------------------
Reporter: 0ion9 | Owner: somebody
Type: defect | Status: new
Priority: normal | Milestone: 0.7
Component: scipy.ndimage | Version: devel
Severity: normal | Keywords:
---------------------------+------------------------------------------------
.. when zoom factor approaches or exceeds 2.0.
Paste the following code into a new file and run it to see the bug.
{{{
import numpy
arr = numpy.array (range (25))
arr.shape = (5,5)
import scipy.ndimage as sn
result = sn.zoom (arr, 2.0)
print (result)
#
# Produces the following output:
# (note the erroneous line of zeros along R + B edge;
# instead of this output, the input should be stretched to fully
# fit the output size requested.)
#
#array([[ 0, 0, 1, 2, 2, 2, 3, 4, 4, 0],
# [ 2, 2, 3, 3, 4, 4, 5, 5, 6, 0],
# [ 5, 5, 6, 7, 7, 7, 8, 9, 9, 0],
# [ 8, 8, 9, 9, 10, 10, 11, 11, 12, 0],
# [10, 10, 11, 12, 12, 12, 13, 14, 14, 0],
# [12, 13, 13, 14, 14, 15, 15, 16, 16, 0],
# [15, 15, 16, 17, 17, 17, 18, 19, 19, 0],
# [18, 19, 19, 20, 20, 21, 21, 22, 22, 0],
# [20, 20, 21, 22, 22, 22, 23, 24, 24, 0],
# [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]])
}}}
Also, if you try running the following lines, you will see it causes an
exception
(apparently the output array, shape = (10,10) is not of the correct shape!
But the output of sn.zoom (arr, 2.0) *is* 10x10 in size!)
{{{
output = numpy.zeros (shape = (10,10), dtype = numpy.uint8)
sn.zoom (arr, 2.0, output = output)
}}}
--
Ticket URL: <http://scipy.org/scipy/scipy/ticket/515>
SciPy <http://www.scipy.org/>
SciPy is open-source software for mathematics, science, and engineering.
More information about the Scipy-tickets
mailing list