Opencv 2.4.3 evaluation of RigidTransform in python

This is really a mess for me, and I'm having a hard time trying to solve it. I want to use the cv2.estimateRigitTransform method in Python with numpy arrays, but I cannot find an example or anything else that explains the format of the required src and dst numpy arrays.

Can someone send me a small example of these two arrays that will work with this method? I have all the data (in 2D, of course), but I cannot find how to format it in a numpy array.

Please help me. Thanks!

+4
source share
1 answer

Here is 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) 

The documentation is here .

+4
source

All Articles