numpy – Python OpenCV: How to split image diagonally – Stack Overflow

Questions:

I have images like below. I would like to split them diagonally, probably using the centroid of the image or get the angle of the bounding rect/ellipse and cut along that.
I can cut the images horizontally or vertically using list slicing:

eg img_split=img[:50%,:]

How do I do it diagonally in OpenCV Python/Numpy?

Images:

enter image description here

enter image description here

Split sample:

enter image description here

enter image description here

Answers:

Leave a Reply

Your email address will not be published. Required fields are marked *