diff --git a/modules/util/util.py b/modules/util/util.py
index 1c6ed66e51953ba3ff7de1bfde76f0e48a909368..542a15c771ed5d434231e329068231b530a3b744 100644
--- a/modules/util/util.py
+++ b/modules/util/util.py
@@ -1330,9 +1330,10 @@ def downscale_2x(original, smoothing=False, samples_axis_first=False):
     return lr
 
 
-def resample(x, y, z, x_min, x_max, y_min, y_max):
+def resample(x, y, z, x_new, y_new):
     z_intrp = []
     for k in range(z.shape[0]):
         z_k = z[k, :, :]
-        z_intrp.append(RectBivariateSpline(x, y, z_k, [x_min, x_max, y_min, y_max]))
+        f = RectBivariateSpline(x, y, z_k)
+        z_intrp.append(f(x_new, y_new))
     return np.stack(z_intrp)