This commit is contained in:
iperov 2021-09-30 23:49:27 +04:00
parent 4fe2da23c0
commit c37882ebd1

View file

@ -17,6 +17,8 @@ class ImageProcessor:
""" """
def __init__(self, img : np.ndarray, copy=False): def __init__(self, img : np.ndarray, copy=False):
if copy:
img = img.copy()
ndim = img.ndim ndim = img.ndim
if ndim not in [2,3,4]: if ndim not in [2,3,4]:
raise ValueError(f'img.ndim must be 2,3,4, not {ndim}.') raise ValueError(f'img.ndim must be 2,3,4, not {ndim}.')