I am new to OpenCV and I am learning to do some image processing. As a part of my project, I have a problem of warping an image patch in form of an ellipse into a destination ellipse. As far as I understand, I would need to calculate the affine transform between the two patches, and then warp this transformation into the destination patch. Browsing the internet for help, I didn’t find a way to calculate affine transforms between two elliptical patches. Am I on the right track? I would be grateful if you could give me some suggestions how to proceed or where to look for more information.
Share
The fact that your elements are ellipses is not relevant to the calculating of the transform. Transforms work equally well on arbitrary shapes. Say you have affine transforms [A] and [B] with respect to some origin O, you want the transform between [A] and [B]. There are several ways of thinking about doing this, the simplest one, is to get the transform from [A] to O, then from O to [B] and combine them. [A] to O is simply the inverse of [A] and O to [B] is just [B] so
here is a similar question, solving with vector representations is equally valid.
To do the actual warping you can use cv::warpAffine