I'm trying to search a specific object in input images by matching SIFT descriptors and finding the transformation matrix by RANSAC. The object can only be modified in scene by similarity transform in 2D space (scaled, rotated, translated), so I need to estimate 2x2 transform matrix instead of 3x3 homography matrix in 3D space. How can I achieve this in OpenCV?
相关问题
- How to get the background from multiple images by
- Try to load image with Highgui.imread (OpenCV + An
- CV2 Image Error: error: (-215:Assertion failed) !s
- Is it a bug of opencv RotatedRect?
- How do I apply a perspective transform with more t
相关文章
- How do I append metadata to an image in Matlab?
- opencv fails to build with ipp support enabled
- Code completion is not working for OpenCV and Pyth
- Face unlock code in Android open source project?
- Python open jp2 medical images - Scipy, glymur
- How to compile a c++ application using static open
- On a 64 bit machine, can I safely operate on indiv
- Converting PIL Image to GTK Pixbuf
You can use estimateRigidTransform (I do not know whether it is RANSAC, the code at http://code.opencv.org/projects/opencv/repository/revisions/2.4.4/entry/modules/video/src/lkpyramid.cpp says RANSAC in its comment), the third parameter is set to
false
in order to get just scale+rotation+translation:compiled and tested with OpenCV 2.4.4. The output is:
You can use find an affine transformation between the point sets using opencv, this is slightly more general than the case you are describing (known as a similarity transform) as it describes shearing transformations of the shapes as well.
It can be performed using the function
getAffineTransform(InputArray src, InputArray dst)
. This takes 2 sets of three points and calculates an affine transform between them.