From 3961d073710026dd23275e208e8cd9dc90467b25 Mon Sep 17 00:00:00 2001 From: Dan Kapner Date: Thu, 25 Jul 2019 20:48:45 -0700 Subject: [PATCH] one-liner for src array --- renderapi/transform/leaf/thin_plate_spline.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/renderapi/transform/leaf/thin_plate_spline.py b/renderapi/transform/leaf/thin_plate_spline.py index c8abc9a7..793fc0f9 100644 --- a/renderapi/transform/leaf/thin_plate_spline.py +++ b/renderapi/transform/leaf/thin_plate_spline.py @@ -435,10 +435,7 @@ def src_array(xmin, ymin, xmax, ymax, nx, ny): (nx * ny) x 2 array of coordinated. """ - x = np.linspace(xmin, xmax, nx) - y = np.linspace(ymin, ymax, ny) - xt, yt = np.meshgrid(x, y) - src = np.vstack((xt.flatten(), yt.flatten())).transpose() + src = np.mgrid[xmin:xmax:nx*1j, ymin:ymax:ny*1j].reshape(2, -1).T return src def scale_coordinates(