Deleting points in a contour

I am attempting to clean up my contour that has unneeded points in it but have not found a method that allows me to delete a single point in the contour, causing the path to now be drawn from point 1 to point 3.

Ex:
[1,1]
[1,2]
[2,2]
[2,1]

If I want to turn the above square into a triangle, what is the best way to do this?

learn some python:

Thank you for the attempt at providing feedback @berak, but you made no valuable contribution other than the attempt at humor.

The answer to this is: “contours are numphy arrays, and thus can be edited as such.”

the assumption with an advanced library like OpenCV is that you know the prerequisites, which are python and numpy. or that you understand that it’s your responsibility to learn them. the best we can do is point the way.

and point he did. you were given perfectly suitable material to prepare you for (some of) the challenges that await you.

here’s another pointer: https://docs.opencv.org/ you decide what you make of it.

you yourself recognize that your trivial question has a trivial answer, that you formulated. the response should not have surprised you. we are used to some trivial questions, but sometimes our expectations are… exceeded.