Alex Rothberg
Alex Rothberg

Reputation: 10983

Affine Transforming Coordinate Set in OpenCV

In OpenCV, I can affine transform an image using:

M = np.float32(...)
array_tform = cv2.warpAffine(arr, M, (cols, row))

this works if the image is represented as bitmap.

What about if the "image" is instead represented as a set of points (coordinates)? i.e. I want to perform the affine transformation on a set of points. For example, translate by (+1,+1):

{ (1, 2), (3, 4) } --> { (2, 3), (4, 5) } 

Is there a way to affine transform a point set?

Upvotes: 0

Views: 1863

Answers (1)

Michael Burdinov
Michael Burdinov

Reputation: 4428

You can use transform() function. It can by used for a lot of different things, but the most basic use is applying affine transformation to every point in array.

Upvotes: 1

Related Questions