iterative_closest_point_2d | Iterative Closest Point 2D with python and opencv | Image Editing library
kandi X-RAY | iterative_closest_point_2d Summary
kandi X-RAY | iterative_closest_point_2d Summary
#usage Call like this,. . d1, d2 are numpy array of 2d points. The return value ret is the convert matrix with 2 rows and 3 coloums. icp estimates rotation, moving, scaling(each x and y Separately) convertion.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Compute the distance between two points .
- Check if tr is a converge .
- Removes occurrences from a given distance distribution .
iterative_closest_point_2d Key Features
iterative_closest_point_2d Examples and Code Snippets
Community Discussions
Trending Discussions on iterative_closest_point_2d
QUESTION
I have to images, one simulation, one real data, with bright spots.
I can detect the spots just fine and get the coordinates. Now I need to compute transformation matrix (scale, rotation, translation, maybe shear) between the two coordinate systems. If needed, I can pick some (5-10) corresponding points by hand to give to the algorithm
I tried a lot of approaches already, including: 2 implementations of ICP: https://engineering.purdue.edu/kak/distICP/ICP-2.0.html#ICP
https://github.com/KojiKobayashi/iterative_closest_point_2d
Implementing affine transformations: https://math.stackexchange.com/questions/222113/given-3-points-of-a-rigid-body-in-space-how-do-i-find-the-corresponding-orienta/222170#222170
Implementations of affine transformations: Determining a homogeneous affine transformation matrix from six points in 3D using Python
how to perform coordinates affine transformation using python? part 2
Most of them simply fail somehow like this: The red points are the spots from the simulation transformed into the reality - coordinate system.
The best approach so far is this one how to perform coordinates affine transformation using python? part 2 yielding this:
As you see, the scaling and translating mostly works, but the image still needs to be rotated / mirrored.
Any ideas on how to get a working algorithm? If neccessary, I can provide my current non-working implementations, but they are basically as linked.
...ANSWER
Answered 2019-Dec-12 at 10:14I found the error.
I used plt.imshow
to display both the simulated and real image and from there, pick the reference points from which to calculate the transformation.
Turns out, due to the usual array-to-image-index-flipping-voodoo (or a bad missunderstanding of the transformation on my side), I need to switch the x and y indices of the reference points from the simulated image.
With this, everything works fine using this how to perform coordinates affine transformation using python? part 2
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install iterative_closest_point_2d
You can use iterative_closest_point_2d like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page