# Deleting points in a contour

**URL:** <https://forum.opencv.org/t/deleting-points-in-a-contour/6365>\
**Category:** Python\
**Created:** [November 22, 2021, 5:22pm UTC](https://forum.opencv.org/t/deleting-points-in-a-contour/6365 "2021-11-22T17:22:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_Berry](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/john_berry/32/3836_2.png) [@John\_Berry](https://forum.opencv.org/u/John_Berry)\
**Post date:** [November 22, 2021, 5:22pm UTC](https://forum.opencv.org/t/deleting-points-in-a-contour/6365/1 "2021-11-22T17:22:57Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![berak](https://avatars.discourse-cdn.com/v4/letter/b/85f322/32.png) [@berak](https://forum.opencv.org/u/berak)\
**Post date:** [November 23, 2021, 7:41am UTC](https://forum.opencv.org/t/deleting-points-in-a-contour/6365/2 "2021-11-23T07:41:03Z")

</div>

> [@John\_Berry](#):
>
> but have not found a method that allows me to delete a single point in the contour

learn some python:

> **[How to Remove Elements from an Array/List in Python](https://stackabuse.com/remove-element-from-an-array-in-python/)**
>
> In this tutorial, we'll showcase examples of how to remove an element from an array in Python using remove(), pop(), the del keyword, and Numpy.

---

<div class="post-metadata">

**Author:** ![John\_Berry](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/john_berry/32/3836_2.png) [@John\_Berry](https://forum.opencv.org/u/John_Berry)\
**Post date:** [November 23, 2021, 3:58pm UTC](https://forum.opencv.org/t/deleting-points-in-a-contour/6365/3 "2021-11-23T15:58:21Z")

</div>

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.”

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [November 23, 2021, 7:34pm UTC](https://forum.opencv.org/t/deleting-points-in-a-contour/6365/4 "2021-11-23T19:34:23Z")

</div>

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/](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.
