Ask Your Question

How to delete point(already inserted) in subdiv2d (python)

asked 2019-01-03 04:25:56 -0500

Vikum Dheemantha gravatar image

updated 2019-01-03 04:45:25 -0500

berak gravatar image

I implemented subdiv2d and insert some points as the following way to construct Delaunay triangulation.

    size = img.shape
    rect = (0, 0, size[0], size[1])
    subdiv  = cv2.Subdiv2D(rect)
    points = []
    x = 0
        y = 0
            points.append((x, y))
            y = (y + 50)
        points.append((x, size[1]-1))
        x = x + 50


I want to remove some points after that, let's assume I want to remove (0, 0), or (50,50) point from subdiv, that I already inserted through point array. How can I do this? please help me.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2019-01-03 05:01:03 -0500

berak gravatar image

it is not possible to remove anything there. have a look at the docs , please.

edit flag offensive delete link more


@berak, After I create Delaunay triangulation, then I have to check each vertex and check whether each vertex is important or not (By Do some maths on each triangle associated with the particular vertex). if the vertex is not important then I have to remove it and create Delaunay triangles from the remaining vertex. If it is not possible, Is there any way that I can complete my task.

Vikum Dheemantha gravatar imageVikum Dheemantha ( 2019-01-03 22:18:38 -0500 )edit

well you can't. just believe it.

berak gravatar imageberak ( 2019-01-04 00:28:34 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2019-01-03 04:25:56 -0500

Seen: 183 times

Last updated: Jan 03 '19