Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use estimateRigidTransform in OpenCV 3.0 or higher, Is there any other alternative?

I want to use estimateRigidTransform function of OpenCV but it throws up an error.

AttributeError Traceback (most recent call last) in 30 31 #Find transformation matrix ---> 32 m = cv2.estimateRigidTransform(prev_pts, curr_pts, fullAffine=False) #will only work with OpenCV-3 or less 33 34 # Extract traslation

AttributeError: module 'cv2.cv2' has no attribute 'estimateRigidTransform'

my openCV version is 4.0.0.

like image 776
user9437069 Avatar asked Apr 19 '19 07:04

user9437069


1 Answers

As indicated in the documentation of estimateRigidTransform, this function has been deprecated:

Deprecatd: Use cv::estimateAffine2D, cv::estimateAffinePartial2D instead. If you are using this fuction with images, extract points using cv::calcOpticalFlowPyrLK and then use the estimation fuctions.

cv::estimateAffine2D should be more robust to noise, but more computationally expensive than cv::estimateAffinePartial2D. They are similar to estimateRigidTransform with the fullAffine parameter set to true or false, respectively.

like image 130
Paul92 Avatar answered Oct 21 '22 13:10

Paul92