Answer the question
In order to leave comments, you need to log in
How to cut rectangle from image and rotate horizontally on OpenCv + python?
Good afternoon, there is a picture, the coordinates of a rectangular area are known. It is necessary to cut out the area and tighten it to a horizontal position. How to do it?
I understand how to cut a rectangle if it is not rotated
imageCut=image[y1:y2,x1:x2]
But how to cut a rectangle by 4 points?
And then how to trust?
Answer the question
In order to leave comments, you need to log in
First you need to rotate around the center of the rectangle, taking into account the size of the rectangle (see cv2.getRotationMatrix2D and cv2.warpAffine, example: https://stackoverflow.com/questions/22041699/rotat... and then cut.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question