This is really a mess for me and I have a hard time trying to solve this. I want to use the method cv2.estimateRigitTransform in Python with numpy arrays but I can't find anywhere an example or something else that explains the format of the src and dst numpy arrays needed.
Could somebody send me a little example of these 2 arrays that will work with this method? I have all the data (in 2D of course) but can't find how to shape it in a numpy array.
Please help me. Thank you!
Here's a basic example that tries to align two random sets of 10 points
import numpy as np
import cv2
shape = (1, 10, 2) # Needs to be a 3D array
source = np.random.randint(0, 100, shape).astype(np.int)
target = source + np.array([1, 0]).astype(np.int)
transformation = cv2.estimateRigidTransform(source, target, False)
Documentation is here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With