generate Delaunay triangle mesh

asked 2016-04-01 07:39:55 -0600

marcoE gravatar image

updated 2016-04-04 09:09:29 -0600

Hello people,

Is it possible generate a 2D using opencv python?

I have this image: image description

I want to gerenate something like this: image description

Thanks

edit retag flag offensive close merge delete

Comments

1

this does not look like a delauny triangulation, more like a regular triangle-grid, deformed with some crude heightfield

berak gravatar imageberak ( 2016-04-01 08:25:20 -0600 )edit

This is not a delaunay. I want to know if it is possible doing something similar in opencv. This one was made using the trimesh module.

marcoE gravatar imagemarcoE ( 2016-04-01 08:30:46 -0600 )edit
1

sure, there is Subdiv2D . (but again, to produce something like above, you would not need it)

berak gravatar imageberak ( 2016-04-01 08:40:41 -0600 )edit

I look into Subdiv2D . I'm not sure how it could be controlled the "mesh size". It is need a set of points. Do I need yo use findnonzero at the first image?

What is your advice @berak ?

marcoE gravatar imagemarcoE ( 2016-04-01 08:51:21 -0600 )edit
1

with Subdiv2d , you start with the boundingrect. then you consecutively add points(e.g. landmarks), and each point will split an existing triangle

berak gravatar imageberak ( 2016-04-01 09:29:29 -0600 )edit

@berak do you mean something like that? http://pastebin.com/0XMqH0zC

however you're right. I need triangles (because I want to create a FEM model) I don't want pure delaunay. Is the process the same?

marcoE gravatar imagemarcoE ( 2016-04-01 09:53:02 -0600 )edit

@berak I'm sorry to bother you with lamme questions. I want to achieve something like this: http://www.learnopencv.com/delaunay-t... But I don't know how. I just want to create 2D mesh with triangles. Then using this 2D mesh as mask to apply on different images and create FEM model. But at this stage, I just want a 2D triangle mesh on this image. This picture has holes (stronger lines)

marcoE gravatar imagemarcoE ( 2016-04-01 10:26:27 -0600 )edit

Looking at the example on the website, I don't know how I can create something similiar to the points.txt ,

marcoE gravatar imagemarcoE ( 2016-04-01 11:00:50 -0600 )edit

didn't you mention, you had a list of points, the other day ? just insert them, one after the other.

berak gravatar imageberak ( 2016-04-01 11:02:54 -0600 )edit