Question

I am using opencv and c++. I have successfully obtained the transformation matrix between images A and B based on 3 common points in the images. Now I want to apply this found transformation matrix to the whole image. I was hoping that warpAffine could do the job but it gives me this error http://i.imgur.com/T7Xl0cw.jpg. However, I used only part of the affineTransform code where it finds the warped image because I already found the transformation matrix using another method. Can anybody tell if this is the correct way to transform the whole image if I already have a transformation marix?Here is the piece of that code http://pastebin.com/HFYSneG2

Était-ce utile?

La solution

If you already have the transformation matrix, then cv::warpAffine is the right way to go. Your error message seems to be about the type of the transformation matrix and/or its size, which should be 2x3 float or double precision.

Autres conseils

The matrix of the common points found on both images needed to be transposed and then warpAffine used

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top