W
W
Wynell_ru2020-05-12 23:22:35
Python
Wynell_ru, 2020-05-12 23:22:35

How to insert text on an image so that it lies on a plane given by coordinates?

Good evening.
I think the question from the title is not very clear, so I tried to depict it in the picture.
I apologize for its quality.
5ebb0532cd84b056603769.png
Here, the points P1, P2, P3, P4 set the plane under which the text must be deformed so that it lies on it.
Not necessarily in this way, the main thing is that it looks like what is in the picture.
I have a rather weak knowledge of geometry, please do not scold me for this.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
U
U235U235, 2020-05-18
@Wynell_ru

Use cv2.getPerspectiveTransform to find the transformation matrix from 4 pairs of points (corners). And then cv2.warpPerspective for actually transforming the image.
You can also use Imagemagick instead of OpenCV.

S
Sergey Pankov, 2020-05-12
@trapwalker

You need affine transformations .
Here you can google them on the stack-overflow

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question