mirror of
https://github.com/wassname/scikit-image.git
synced 2026-08-12 12:30:16 +08:00
Fix bug in array padding, template matching
This commit is contained in:
@@ -3,14 +3,7 @@ from .dtype import (img_as_float, img_as_int, img_as_uint, img_as_ubyte,
|
||||
from .shape import view_as_blocks, view_as_windows
|
||||
from .noise import random_noise
|
||||
|
||||
import numpy
|
||||
ver = numpy.__version__.split('.')
|
||||
chk = int(ver[0] + ver[1])
|
||||
if chk < 18: # Use internal version for numpy versions < 1.8.x
|
||||
from .arraypad import pad
|
||||
else:
|
||||
from numpy import pad
|
||||
del numpy, ver, chk
|
||||
from .arraypad import pad
|
||||
from ._regular_grid import regular_grid
|
||||
from .unique import unique_rows
|
||||
|
||||
|
||||
@@ -1027,7 +1027,11 @@ def _normalize_shape(narray, shape):
|
||||
"""
|
||||
normshp = None
|
||||
shapelen = len(np.shape(narray))
|
||||
if (isinstance(shape, int)) or shape is None:
|
||||
|
||||
if isinstance(shape, np.ndarray):
|
||||
shape = shape.tolist()
|
||||
|
||||
if isinstance(shape, (int, float)) or shape is None:
|
||||
normshp = ((shape, shape), ) * shapelen
|
||||
elif (isinstance(shape, (tuple, list))
|
||||
and isinstance(shape[0], (tuple, list))
|
||||
|
||||
Reference in New Issue
Block a user