Ask Your Question
0

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

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

Vikum Dheemantha gravatar image

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

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
    while(x<size[0]):
        y = 0
        while(y<size[1]):
            points.append((x, y))
            y = (y + 50)
        points.append((x, size[1]-1))
        x = x + 50

subdiv.insert(points)

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
0

answered 2019-01-03 05:01:03 -0600

berak gravatar image

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

edit flag offensive delete link more

Comments

@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 -0600 )edit

well you can't. just believe it.

berak gravatar imageberak ( 2019-01-04 00:28:34 -0600 )edit

Question Tools

1 follower

Stats

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

Seen: 547 times

Last updated: Jan 03 '19