CV003: Image Transform

Here, I would like to introduce a basic operation of CV, transform. It is a very import part, which is Similarity Transform, Affine Transform and Perspective Transform.

Similarity Transform

Actually, similarity transform is rotation, translation and scale. So we need two point pairs. Features: regard (0,0) (default: left-top) as base, scale and rotate around (0,0), then translate to the new center. Importantly, the angle of two lines in the image is fixed and proportion is fixed, besides, the type of the line is fixed.

We need import a new lib if we wanna do it. It is called skimage and we need the function transform to use SimilarityTransform.

cv003_3

Affine Transform

Same as Similarity transform, but the angle is not fixed and we need three point pairs(Non-Collinear).

cv003_2

Perspective Transform

Same as Affine Transform, but only the type of line is fixed. We need 4 point pairs to determine it.

CV003_1

More

Besides, I will show you two more things that are image erode and image dilate.

Erode

That is very easy, we have a function erode in cv2. And the bigger the value of iterations is, the thicker the font is.

cv003_4

Dilate

cv003_5

Ending! And if you need, you can click this link to see all the code on my github.


END

Illustrator / Cagy

Text / Cagy

Editor / Cagy

Design / Cagy