diff --git a/samples/python/mosse.py b/samples/python/mosse.py index e11e9215c6..04d3cf8763 100755 --- a/samples/python/mosse.py +++ b/samples/python/mosse.py @@ -107,7 +107,7 @@ class MOSSE: h, w = f.shape f = np.roll(f, -h//2, 0) f = np.roll(f, -w//2, 1) - kernel = np.uint8( (f-f.min()) / f.ptp()*255 ) + kernel = np.uint8( (f-f.min()) / np.ptp(f)*255 ) resp = self.last_resp resp = np.uint8(np.clip(resp/resp.max(), 0, 1)*255) vis = np.hstack([self.last_img, kernel, resp]) diff --git a/samples/python/turing.py b/samples/python/turing.py index dc920d1295..d8f517cf9f 100755 --- a/samples/python/turing.py +++ b/samples/python/turing.py @@ -62,7 +62,7 @@ def main(): vs.append(v) mi = np.argmin(vs, 0) a += np.choose(mi, ms) * 0.025 - a = (a-a.min()) / a.ptp() + a = (a-a.min()) / np.ptp(a) if out: out.write(a)