Skip to content

Commit

Permalink
one-liner for src array
Browse files Browse the repository at this point in the history
  • Loading branch information
djkapner committed Jul 26, 2019
1 parent 945168c commit 3961d07
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions renderapi/transform/leaf/thin_plate_spline.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 3961d07

Please sign in to comment.