Skip to content

Scale thinplate#146

Merged
RussTorres merged 4 commits intodevelopfrom
scale_thinplate
Jul 26, 2019
Merged

Scale thinplate#146
RussTorres merged 4 commits intodevelopfrom
scale_thinplate

Conversation

@djkapner
Copy link
Copy Markdown
Contributor

ThinPlateSplineTransform.scale_coordinates() is a brute-force way to copy a thin plate spline into scaled coordinates. It creates a grid of control points with the original srcPts optional. If small size is important, I think the use case would be to follow this new call with adaptive_mesh_estimate()

I did not have immediate success just trying to scale transform parameters. This will work, especially for the first use case of apply_rough.

Also, had to adjust pytest requirements because pytest >= 5 does not work with python 2.7:
https://docs.pytest.org/en/latest/py27-py34-deprecation.html

@djkapner djkapner requested a review from RussTorres July 23, 2019 22:30
@codecov
Copy link
Copy Markdown

codecov bot commented Jul 23, 2019

Codecov Report

Merging #146 into develop will increase coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #146      +/-   ##
===========================================
+ Coverage    95.88%   95.91%   +0.03%     
===========================================
  Files           30       30              
  Lines         2091     2107      +16     
===========================================
+ Hits          2005     2021      +16     
  Misses          86       86
Impacted Files Coverage Δ
renderapi/transform/leaf/thin_plate_spline.py 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0225da9...3961d07. Read the comment docs.

y = np.linspace(ymin, ymax, ny)
xt, yt = np.meshgrid(x, y)
src = np.vstack((xt.flatten(), yt.flatten())).transpose()
return src
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really a suggestion, but there is a one-liner to do this (with a different ordering) using mgrid's complex step length:
numpy.mgrid[ymin:ymax:ny*1j, xmin:xmax:nx*1j].reshape(2, -1).T

@RussTorres RussTorres merged commit a12126e into develop Jul 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants