Search code examples
pythoncropopencv

Cut Image with different Coordinates non-rectangular


I want to cut a region in a picture with different coordinates.

I have points like that:

  <point x="720" y="549" />
  <point x="805" y="665" />
  <point x="715" y="698" />
  <point x="644" y="582" />

And I want to use them to get a new picture without a mask in the background or something like that. Only the Region from this coordinates. I have something like that: NumPy/OpenCV 2: how do I crop non-rectangular region? But I can not transform it, to my solution. Maybe someone of you can help me.

Thank you! Felix


Solution

  • I have found a solution with this https://jdhao.github.io/2019/02/23/crop_rotated_rectangle_opencv/