Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Construct affine transforms from point-pairs #87

Merged
merged 4 commits into from
May 7, 2023

Conversation

timholy
Copy link
Member

@timholy timholy commented Apr 29, 2023

Given a set of point pairs from => to, compute the affine
transformation that best reproduces the observed mapping.

Closes #30

Given a set of point pairs `from => to`, compute the affine
transformation that best reproduces the observed mapping.

Closes #30
@timholy timholy closed this Apr 29, 2023
@timholy timholy reopened this Apr 29, 2023
@codecov
Copy link

codecov bot commented Apr 29, 2023

Codecov Report

Merging #87 (9e67de2) into master (78f5a5c) will increase coverage by 2.63%.
The diff coverage is 58.82%.

❗ Current head 9e67de2 differs from pull request most recent head ff37a34. Consider uploading reports for the commit ff37a34 to get more accurate results

@@            Coverage Diff             @@
##           master      #87      +/-   ##
==========================================
+ Coverage   63.90%   66.54%   +2.63%     
==========================================
  Files           4        4              
  Lines         266      275       +9     
==========================================
+ Hits          170      183      +13     
+ Misses         96       92       -4     
Impacted Files Coverage Δ
src/affine.jl 56.97% <53.33%> (+8.87%) ⬆️
src/coordinatesystems.jl 79.28% <100.00%> (+0.30%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@c42f c42f left a comment

Choose a reason for hiding this comment

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

Looks good to me.

src/affine.jl Outdated
If there are more points than this, the transformation will be over-determined and a least-squares
solution will be computed.
"""
function AffineMap(mappedpairs::AbstractVector{<:Pair})
Copy link
Member

Choose a reason for hiding this comment

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

I wonder might this be better as AffineMap((from_points,to_points)::Pair) ?

That way there may be less unpacking and packing to do for typical use cases? For example, in the tests you'd have

A2 = AffineMap(from=>from)

without the need to construct and allocate mappedpairs

@timholy timholy merged commit a2c7197 into master May 7, 2023
@timholy timholy deleted the teh/affine_from_points branch May 7, 2023 21:43
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.

Set of measured points to known coordinates
2 participants