From d7d51e4cc7e413b44e440bd8f955255ba5822a91 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Sun, 4 Oct 2020 14:52:13 +0000 Subject: [PATCH] python: replace numpy.full() to support numpy<1.13 --- modules/python/test/test_copytomask.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/python/test/test_copytomask.py b/modules/python/test/test_copytomask.py index 05e30ed..ce0e614 100644 --- a/modules/python/test/test_copytomask.py +++ b/modules/python/test/test_copytomask.py @@ -24,10 +24,12 @@ class copytomask_test(NewOpenCVTests): valeurBGRSup = np.array([70, 70,255]) maskRed = cv.inRange(img, valeurBGRinf, valeurBGRSup) #New binding - dstcv = np.full(np.array((2, 2, 1))*img.shape, 255, dtype=img.dtype) + dstcv = np.ndarray(np.array((2, 2, 1))*img.shape, dtype=img.dtype) + dstcv.fill(255) cv.copyTo(img, maskRed, dstcv[:img.shape[0],:img.shape[1],:]) #using numpy - dstnp = np.full(np.array((2, 2, 1))*img.shape, 255, dtype=img.dtype) + dstnp = np.ndarray(np.array((2, 2, 1))*img.shape, dtype=img.dtype) + dstnp.fill(255) mask2=maskRed.astype(bool) _, mask_b = np.broadcast_arrays(img, mask2[..., None]) np.copyto(dstnp[:img.shape[0],:img.shape[1],:], img, where=mask_b) -- 2.7.4