minor changes : Replace ndarray.ptp() with np.ptp() for NumPy 2.0 Compatibility

This commit is contained in:
shyama7004 2025-03-23 23:38:33 +05:30
parent 855f20fdfe
commit ef474e06fc
2 changed files with 2 additions and 2 deletions

View File

@ -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])

View File

@ -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)