Dear community,
I have this 720×720 image and want to do a spatial transform in a way that a horizontal line will become a U-shape. So depending on the x-coordinate the rotation/translation will be different. Simply put the left side should rotate a bit clockwise and the right side counterclockwise.
Any thoughts?
nParts = 15;iWidth = size(IM,2)/nParts;iRotation = (-(nParts-1)/2:(nParts-1)/2)*2;for iPart = 1:nParts; K(iPart) = {imrotate(IM(:,iPart*iWidth- iWidth+1:iPart*iWidth),iRotation(iPart),'bilinear','loose')};end
This is what I came up with only now the K(i) elements have to be combined, or even better solution would be a single transformation matrix, like:
x' = x*?*cos(t) + y*?*sin(t) y' = -x*?*sin(t) + y*?*cos(t).
Kind regards,
Mats
Best Answer